forked from sakaiproject/sakai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SAK-32035 : Replace courier service in chat with some other service (s…
- Loading branch information
Showing
34 changed files
with
1,695 additions
and
2,477 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
chat/chat-api/api/src/java/org/sakaiproject/chat2/model/DeleteMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.sakaiproject.chat2.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
public class DeleteMessage{ | ||
private String id; | ||
private String channelId; | ||
} |
12 changes: 12 additions & 0 deletions
12
chat/chat-api/api/src/java/org/sakaiproject/chat2/model/MessageDateString.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.sakaiproject.chat2.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
public class MessageDateString{ | ||
private String localizedDate; | ||
private String localizedTime; | ||
private String dateID; | ||
} |
47 changes: 0 additions & 47 deletions
47
chat/chat-api/api/src/java/org/sakaiproject/chat2/model/PresenceObserver.java
This file was deleted.
Oops, something went wrong.
48 changes: 0 additions & 48 deletions
48
chat/chat-api/api/src/java/org/sakaiproject/chat2/model/RoomObserver.java
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
chat/chat-api/api/src/java/org/sakaiproject/chat2/model/SimpleUser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.sakaiproject.chat2.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@EqualsAndHashCode(of={"id"}) | ||
public class SimpleUser{ | ||
private String id; | ||
private String name; | ||
} |
94 changes: 94 additions & 0 deletions
94
chat/chat-api/api/src/java/org/sakaiproject/chat2/model/TransferableChatMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package org.sakaiproject.chat2.model; | ||
|
||
import java.io.IOException; | ||
import java.io.ObjectInputStream; | ||
import java.io.ObjectOutputStream; | ||
import java.io.Serializable; | ||
import java.util.Date; | ||
|
||
import lombok.Data; | ||
|
||
/** | ||
* | ||
* Class used to transfer data through jGroups | ||
* | ||
*/ | ||
@Data | ||
public class TransferableChatMessage implements Serializable { | ||
|
||
public enum MessageType { | ||
CHAT, | ||
HEARTBEAT, | ||
CLEAR, | ||
REMOVE; | ||
} | ||
|
||
public MessageType type; | ||
public String id; | ||
public String owner; | ||
public String siteId; | ||
public String channelId; | ||
public String content; | ||
public long timestamp; | ||
|
||
public TransferableChatMessage(ChatMessage msg) { | ||
this(MessageType.CHAT, msg.getId(), msg.getOwner(), msg.getChatChannel().getContext(), msg.getChatChannel().getId(), msg.getBody()); | ||
} | ||
|
||
public TransferableChatMessage(MessageType type, String id) { | ||
this(type, id, null, null, null, null); | ||
} | ||
|
||
public TransferableChatMessage(MessageType type, String id, String channelId) { | ||
this(type, id, null, null, channelId, null); | ||
} | ||
|
||
public TransferableChatMessage(MessageType type, String id, String owner, String siteId, String channelId, String content) { | ||
this.type = type; | ||
this.id = id; | ||
this.owner = owner; | ||
this.siteId = siteId; | ||
this.channelId = channelId; | ||
this.content = content; | ||
this.timestamp = (new Date()).getTime(); | ||
} | ||
|
||
public static TransferableChatMessage HeartBeat(String channelId, String sessionKey){ | ||
return new TransferableChatMessage(MessageType.HEARTBEAT, sessionKey, channelId); | ||
} | ||
|
||
public ChatMessage toChatMessage() { | ||
return toChatMessage(null); | ||
} | ||
public ChatMessage toChatMessage(ChatChannel channel) { | ||
ChatMessage message = new ChatMessage(); | ||
|
||
message.setId(id); | ||
message.setChatChannel(channel); | ||
message.setOwner(owner); | ||
message.setRawBody(content); | ||
message.setMessageDate(new Date(timestamp)); | ||
|
||
return message; | ||
} | ||
|
||
public void writeObject(ObjectOutputStream out) throws IOException { | ||
out.writeObject(type.toString()); | ||
out.writeObject(id); | ||
out.writeObject(owner); | ||
out.writeObject(siteId); | ||
out.writeObject(channelId); | ||
out.writeObject(content); | ||
out.writeObject(timestamp); | ||
} | ||
|
||
public void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { | ||
this.type = MessageType.valueOf((String) in.readObject()); | ||
this.id = (String) in.readObject(); | ||
this.owner = (String) in.readObject(); | ||
this.siteId = (String) in.readObject(); | ||
this.channelId = (String) in.readObject(); | ||
this.content = (String) in.readObject(); | ||
this.timestamp = (Long) in.readObject(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<config xmlns="urn:org:jgroups" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/jgroups.xsd"> | ||
<UDP | ||
mcast_port="${jgroups.udp.mcast_port:45589}" | ||
ip_ttl="4" | ||
tos="8" | ||
ucast_recv_buf_size="5M" | ||
ucast_send_buf_size="5M" | ||
mcast_recv_buf_size="5M" | ||
mcast_send_buf_size="5M" | ||
max_bundle_size="64K" | ||
enable_diagnostics="true" | ||
thread_naming_pattern="cl" | ||
|
||
thread_pool.min_threads="0" | ||
thread_pool.max_threads="20" | ||
thread_pool.keep_alive_time="30000"/> | ||
|
||
<PING /> | ||
<MERGE3 max_interval="30000" | ||
min_interval="10000"/> | ||
<FD_SOCK/> | ||
<FD_ALL/> | ||
<VERIFY_SUSPECT timeout="1500" /> | ||
<BARRIER /> | ||
<pbcast.NAKACK2 xmit_interval="500" | ||
xmit_table_num_rows="100" | ||
xmit_table_msgs_per_row="2000" | ||
xmit_table_max_compaction_time="30000" | ||
use_mcast_xmit="false" | ||
discard_delivered_msgs="true"/> | ||
<UNICAST3 xmit_interval="500" | ||
xmit_table_num_rows="100" | ||
xmit_table_msgs_per_row="2000" | ||
xmit_table_max_compaction_time="60000" | ||
conn_expiry_timeout="0"/> | ||
<pbcast.STABLE desired_avg_gossip="50000" | ||
max_bytes="4M"/> | ||
<pbcast.GMS print_local_addr="true" join_timeout="2000" | ||
view_bundling="true"/> | ||
<UFC max_credits="2M" | ||
min_threshold="0.4"/> | ||
<MFC max_credits="2M" | ||
min_threshold="0.4"/> | ||
<FRAG2 frag_size="60K" /> | ||
<RSVP resend_interval="2000" timeout="10000"/> | ||
<pbcast.STATE_TRANSFER /> | ||
<!-- pbcast.FLUSH /--> | ||
</config> |
Oops, something went wrong.