public class RespokeClient extends java.lang.Object implements RespokeSignalingChannel.Listener
Modifier and Type | Class and Description |
---|---|
static interface |
RespokeClient.ConnectCompletionListener
A listener interface to receive a notification that the connect action has failed
|
static interface |
RespokeClient.JoinGroupCompletionListener
A listener interface to receive a notification that the task to join the groups has completed
|
static interface |
RespokeClient.Listener
A delegate protocol to notify the receiver of events occurring with the client
|
static interface |
RespokeClient.ResolvePresenceListener
A listener interface to ask the receiver to resolve a list of presence values for an endpoint
|
Modifier and Type | Field and Description |
---|---|
java.lang.String |
baseURL |
static java.lang.String |
PROPERTY_LAST_VALID_PUSH_TOKEN |
static java.lang.String |
PROPERTY_LAST_VALID_PUSH_TOKEN_ID |
Constructor and Description |
---|
RespokeClient() |
Modifier and Type | Method and Description |
---|---|
void |
callCreated(RespokeCall call)
Receive a notification from the signaling channel that a call has been created
|
void |
callTerminated(RespokeCall call)
Receive a notification from the signaling channel that a call has terminated
|
RespokeCall |
callWithID(java.lang.String sessionID)
Find a call with the specified session ID
|
void |
connect(java.lang.String tokenID,
java.lang.Object initialPresence,
android.content.Context context,
RespokeClient.ConnectCompletionListener completionListener) |
void |
connect(java.lang.String endpointID,
java.lang.String appID,
boolean shouldReconnect,
java.lang.Object initialPresence,
android.content.Context context,
RespokeClient.ConnectCompletionListener completionListener) |
void |
directConnectionAvailable(RespokeDirectConnection directConnection,
RespokeEndpoint endpoint)
This event is fired when the logged-in endpoint is receiving a request to open a direct connection
to another endpoint.
|
void |
disconnect() |
RespokeConnection |
getConnection(java.lang.String connectionID,
java.lang.String endpointID,
boolean skipCreate) |
RespokeEndpoint |
getEndpoint(java.lang.String endpointIDToFind,
boolean skipCreate) |
java.lang.String |
getEndpointID() |
RespokeGroup |
getGroup(java.lang.String groupIDToFind) |
java.lang.Object |
getPresence() |
RespokeClient.ResolvePresenceListener |
getResolvePresenceListener() |
boolean |
isConnected() |
void |
joinGroups(java.util.ArrayList<java.lang.String> groupIDList,
RespokeClient.JoinGroupCompletionListener completionListener) |
void |
onConnect(RespokeSignalingChannel sender,
java.lang.String endpointID,
java.lang.String connectionID)
Receive a notification from the signaling channel that it has connected to the cloud infrastructure
|
void |
onDisconnect(RespokeSignalingChannel sender)
Receive a notification from the signaling channel that it has disconnected to the cloud infrastructure
|
void |
onError(java.lang.String errorMessage,
RespokeSignalingChannel sender)
Receive a notification from the signaling channel that an error has occurred
|
void |
onGroupMessage(java.lang.String message,
java.lang.String groupID,
java.lang.String endpointID,
RespokeSignalingChannel sender,
java.util.Date timestamp)
Receive a notification that a group message was received
|
void |
onIncomingCall(org.json.JSONObject sdp,
java.lang.String sessionID,
java.lang.String connectionID,
java.lang.String endpointID,
java.util.Date timestamp,
RespokeSignalingChannel sender)
Receive a notification from the signaling channel that a remote endpoint is attempting to start a call
|
void |
onIncomingDirectConnection(org.json.JSONObject sdp,
java.lang.String sessionID,
java.lang.String connectionID,
java.lang.String endpointID,
java.util.Date timestamp,
RespokeSignalingChannel sender)
Receive a notification from the signaling channel that a remote endpoint is attempting to start a direct connection
|
void |
onJoinGroup(java.lang.String groupID,
java.lang.String endpointID,
java.lang.String connectionID,
RespokeSignalingChannel sender)
Receive a notification from the signaling channel that an endpoint has joined this group.
|
void |
onLeaveGroup(java.lang.String groupID,
java.lang.String endpointID,
java.lang.String connectionID,
RespokeSignalingChannel sender)
Receive a notification from the signaling channel that an endpoint has left this group.
|
void |
onMessage(java.lang.String message,
java.util.Date timestamp,
java.lang.String endpointID,
RespokeSignalingChannel sender)
Receive a notification from the signaling channel that a message has been sent to this group
|
void |
onPresence(java.lang.Object presence,
java.lang.String connectionID,
java.lang.String endpointID,
RespokeSignalingChannel sender)
Receive a notification that a presence change message was received
|
void |
registerPushServicesWithToken(java.lang.String token) |
void |
setListener(RespokeClient.Listener listener) |
void |
setPresence(java.lang.Object newPresence,
Respoke.TaskCompletionListener completionListener) |
void |
setResolvePresenceListener(RespokeClient.ResolvePresenceListener listener) |
public static final java.lang.String PROPERTY_LAST_VALID_PUSH_TOKEN
public static final java.lang.String PROPERTY_LAST_VALID_PUSH_TOKEN_ID
public java.lang.String baseURL
public void setListener(RespokeClient.Listener listener)
public void setResolvePresenceListener(RespokeClient.ResolvePresenceListener listener)
public RespokeClient.ResolvePresenceListener getResolvePresenceListener()
public void connect(java.lang.String endpointID, java.lang.String appID, boolean shouldReconnect, java.lang.Object initialPresence, android.content.Context context, RespokeClient.ConnectCompletionListener completionListener)
public void connect(java.lang.String tokenID, java.lang.Object initialPresence, android.content.Context context, RespokeClient.ConnectCompletionListener completionListener)
public void disconnect()
public boolean isConnected()
public void joinGroups(java.util.ArrayList<java.lang.String> groupIDList, RespokeClient.JoinGroupCompletionListener completionListener)
public RespokeConnection getConnection(java.lang.String connectionID, java.lang.String endpointID, boolean skipCreate)
public RespokeEndpoint getEndpoint(java.lang.String endpointIDToFind, boolean skipCreate)
public RespokeGroup getGroup(java.lang.String groupIDToFind)
public java.lang.String getEndpointID()
public void setPresence(java.lang.Object newPresence, Respoke.TaskCompletionListener completionListener)
public java.lang.Object getPresence()
public void onConnect(RespokeSignalingChannel sender, java.lang.String endpointID, java.lang.String connectionID)
RespokeSignalingChannel.Listener
onConnect
in interface RespokeSignalingChannel.Listener
sender
- The signaling channel that triggered the eventendpointID
- The endpointID for this connection, as reported by the serverpublic void onDisconnect(RespokeSignalingChannel sender)
RespokeSignalingChannel.Listener
onDisconnect
in interface RespokeSignalingChannel.Listener
sender
- The signaling channel that triggered the eventpublic void onIncomingCall(org.json.JSONObject sdp, java.lang.String sessionID, java.lang.String connectionID, java.lang.String endpointID, java.util.Date timestamp, RespokeSignalingChannel sender)
RespokeSignalingChannel.Listener
onIncomingCall
in interface RespokeSignalingChannel.Listener
sdp
- The SDP data for the callsessionID
- The session ID of the callconnectionID
- The connectionID that is callingendpointID
- The endpointID that is callingtimestamp
- The timestamp when the call was initiatedsender
- The signaling channel that triggered the eventpublic void onIncomingDirectConnection(org.json.JSONObject sdp, java.lang.String sessionID, java.lang.String connectionID, java.lang.String endpointID, java.util.Date timestamp, RespokeSignalingChannel sender)
RespokeSignalingChannel.Listener
onIncomingDirectConnection
in interface RespokeSignalingChannel.Listener
sdp
- The SDP data for the directConnectionsessionID
- The session ID of the directConnectionconnectionID
- The connectionID that is callingendpointID
- The endpointID that is callingtimestamp
- The timestamp when the call was initiatedsender
- The signaling channel that triggered the eventpublic void onError(java.lang.String errorMessage, RespokeSignalingChannel sender)
RespokeSignalingChannel.Listener
onError
in interface RespokeSignalingChannel.Listener
errorMessage
- Error messagesender
- The signaling channel that triggered the eventpublic void onJoinGroup(java.lang.String groupID, java.lang.String endpointID, java.lang.String connectionID, RespokeSignalingChannel sender)
RespokeSignalingChannel.Listener
onJoinGroup
in interface RespokeSignalingChannel.Listener
groupID
- The ID of the group triggering the join messageendpointID
- The ID of the endpoint that to which the connection belongsconnectionID
- The ID of the connection that has joined the groupsender
- The signaling channel that triggered the eventpublic void onLeaveGroup(java.lang.String groupID, java.lang.String endpointID, java.lang.String connectionID, RespokeSignalingChannel sender)
RespokeSignalingChannel.Listener
onLeaveGroup
in interface RespokeSignalingChannel.Listener
groupID
- The ID of the group triggering the leave messageendpointID
- The ID of the endpoint that to which the connection belongsconnectionID
- The ID of the connection that has left the groupsender
- The signaling channel that triggered the eventpublic void onMessage(java.lang.String message, java.util.Date timestamp, java.lang.String endpointID, RespokeSignalingChannel sender)
RespokeSignalingChannel.Listener
onMessage
in interface RespokeSignalingChannel.Listener
message
- The body of the messagetimestamp
- The timestamp of the messageendpointID
- The ID of the endpoint sending the messagesender
- The signaling channel that triggered the eventpublic void onGroupMessage(java.lang.String message, java.lang.String groupID, java.lang.String endpointID, RespokeSignalingChannel sender, java.util.Date timestamp)
RespokeSignalingChannel.Listener
onGroupMessage
in interface RespokeSignalingChannel.Listener
message
- The body of the messagegroupID
- The ID of the group to which the message was sentendpointID
- The ID of the endpoint that sent the messagesender
- The signaling channel that triggered the eventtimestamp
- The time at which the message was sentpublic void onPresence(java.lang.Object presence, java.lang.String connectionID, java.lang.String endpointID, RespokeSignalingChannel sender)
RespokeSignalingChannel.Listener
onPresence
in interface RespokeSignalingChannel.Listener
presence
- The new presence valueconnectionID
- The connection ID whose presence changedendpointID
- The endpoint ID to which the connection belongssender
- The signaling channel that triggered the eventpublic void callCreated(RespokeCall call)
RespokeSignalingChannel.Listener
callCreated
in interface RespokeSignalingChannel.Listener
call
- The RespokeCall instance that was createdpublic void callTerminated(RespokeCall call)
RespokeSignalingChannel.Listener
callTerminated
in interface RespokeSignalingChannel.Listener
call
- The RespokeCall instance that was terminatedpublic RespokeCall callWithID(java.lang.String sessionID)
RespokeSignalingChannel.Listener
callWithID
in interface RespokeSignalingChannel.Listener
sessionID
- SessionID to findpublic void directConnectionAvailable(RespokeDirectConnection directConnection, RespokeEndpoint endpoint)
RespokeSignalingChannel.Listener
directConnectionAvailable
in interface RespokeSignalingChannel.Listener
directConnection
- The direct connection objectendpoint
- The remote endpointpublic void registerPushServicesWithToken(java.lang.String token)