public class RespokeGroup extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
RespokeGroup.GetGroupMembersCompletionListener
A listener interface to receive a notification that the task to get the list of group members has completed
|
static interface |
RespokeGroup.Listener
A listener interface to notify the receiver of events occurring with the group
|
Constructor and Description |
---|
RespokeGroup(java.lang.String newGroupID,
RespokeSignalingChannel channel,
RespokeClient newClient) |
RespokeGroup(java.lang.String newGroupID,
RespokeSignalingChannel channel,
RespokeClient newClient,
java.lang.Boolean isJoined)
The constructor for this class
|
Modifier and Type | Method and Description |
---|---|
void |
connectionDidJoin(RespokeConnection connection)
Notify the group that a connection has joined.
|
void |
connectionDidLeave(RespokeConnection connection)
Notify the group that a connection has left.
|
void |
didReceiveMessage(java.lang.String message,
RespokeEndpoint endpoint,
java.util.Date timestamp)
Notify the group that a group message was received.
|
java.lang.String |
getGroupID()
Get the ID for this group
|
void |
getMembers(RespokeGroup.GetGroupMembersCompletionListener completionListener)
Get an array containing the members of the group.
|
boolean |
isConnected() |
boolean |
isJoined()
Return true if the local client is a member of this group and false if not.
|
void |
join(Respoke.TaskCompletionListener completionListener)
Join this group
|
void |
leave(Respoke.TaskCompletionListener completionListener)
Leave this group
|
void |
sendMessage(java.lang.String message,
boolean push,
boolean persist,
Respoke.TaskCompletionListener completionListener)
Send a message to the entire group.
|
void |
sendMessage(java.lang.String message,
boolean push,
Respoke.TaskCompletionListener completionListener) |
void |
setListener(RespokeGroup.Listener listener)
Set a receiver for the Listener interface
|
public RespokeGroup(java.lang.String newGroupID, RespokeSignalingChannel channel, RespokeClient newClient, java.lang.Boolean isJoined)
newGroupID
- The ID for this groupchannel
- The signaling channel managing communications with this groupnewClient
- The client to which this group instance belongsisJoined
- Whether the group has already been joinedpublic RespokeGroup(java.lang.String newGroupID, RespokeSignalingChannel channel, RespokeClient newClient)
public void setListener(RespokeGroup.Listener listener)
listener
- The new receiver for events from the Listener interface for this group instancepublic void getMembers(RespokeGroup.GetGroupMembersCompletionListener completionListener)
completionListener
- A listener to receive a notification on the success of the asynchronous operationpublic void join(Respoke.TaskCompletionListener completionListener)
completionListener
- A listener to receive a notification upon completion of this
async operationpublic void leave(Respoke.TaskCompletionListener completionListener)
completionListener
- A listener to receive a notification on the success of the asynchronous operationpublic boolean isJoined()
public boolean isConnected()
public java.lang.String getGroupID()
public void sendMessage(java.lang.String message, boolean push, boolean persist, Respoke.TaskCompletionListener completionListener)
message
- The message to sendpush
- A flag indicating if a push notification should be sent for this messagepersist
- A flag indicating if history should be maintained for this message.completionListener
- A listener to receive a notification on the success of the asynchronous operationpublic void sendMessage(java.lang.String message, boolean push, Respoke.TaskCompletionListener completionListener)
public void connectionDidJoin(RespokeConnection connection)
connection
- The connection that has joined the grouppublic void connectionDidLeave(RespokeConnection connection)
connection
- The connection that has left the grouppublic void didReceiveMessage(java.lang.String message, RespokeEndpoint endpoint, java.util.Date timestamp)
message
- The body of the messageendpoint
- The endpoint that sent the messagetimestamp
- The message timestamp