public interface ConnectionBase
| Modifier and Type | Method and Description |
|---|---|
void |
closed(Runnable handler)
Sets the handler for the "Closed" event
|
void |
connected(Runnable handler)
Sets the handler for the "Connected" event
|
void |
connectionSlow(Runnable handler)
Sets the handler for the "ConnectionSlow" event
|
void |
disconnect()
Closes the connection
|
void |
error(ErrorCallback handler)
Sets the handler for the "Error" event
|
String |
getConnectionData()
Returns the data used by the connection
|
String |
getConnectionId()
Returns the connection Id
|
String |
getConnectionToken()
Returns the connection token
|
Credentials |
getCredentials()
Returns the credentials used by the connection
|
String |
getGroupsToken()
Returns the connection groups token
|
com.google.gson.Gson |
getGson()
Returns the Gson instance used by the connection
|
Map<String,String> |
getHeaders()
Returns the connection headers
|
com.google.gson.JsonParser |
getJsonParser()
Returns the JsonParser used by the connection
|
Logger |
getLogger()
Returns the Logger used by the connection
|
String |
getMessageId()
Returns the current message Id
|
String |
getQueryString()
Returns the query string used by the connection
|
ConnectionState |
getState()
Returns the connection state
|
String |
getUrl()
Returns the URL used by the connection
|
void |
onError(Throwable error,
boolean mustCleanCurrentConnection)
Triggers the Error event
|
void |
onReceived(com.google.gson.JsonElement message) |
void |
prepareRequest(Request request)
Prepares a request that is going to be sent to the server
|
void |
received(MessageReceivedHandler handler)
Sets the handler for the "Received" event
|
void |
reconnected(Runnable handler)
Sets the handler for the "Reconnected" event
|
void |
reconnecting(Runnable handler)
Sets the handler for the "Reconnecting" event
|
SignalRFuture<Void> |
send(String data)
Sends data using the connection
|
void |
setClientCertificate(String clientCertificatePath,
char[] clientCertificatePassword,
String clientCertificateAlias)
Set the client certificate information
|
void |
setCredentials(Credentials credentials)
Sets the credentials the connection should use
|
void |
setGroupsToken(String groupsToken)
Sets the groups token the connection should use
|
void |
setGson(com.google.gson.Gson gson)
Sets the Gson instance used by the connection
|
void |
setMessageId(String messageId)
Sets the message id the connection should use
|
SignalRFuture<Void> |
start(ClientTransport transport)
Starts the connection
|
void |
stateChanged(StateChangedCallback handler)
Sets the handler for the "StateChanged" event
|
void |
stop()
Aborts the connection and closes it
|
String getUrl()
Credentials getCredentials()
void setCredentials(Credentials credentials)
credentials - Credentialsvoid setMessageId(String messageId)
messageId - Message Idvoid setGroupsToken(String groupsToken)
groupsToken - Group Tokenvoid reconnecting(Runnable handler)
handler - Handlervoid reconnected(Runnable handler)
handler - Handlervoid connected(Runnable handler)
handler - Handlervoid error(ErrorCallback handler)
handler - Error Handlervoid stateChanged(StateChangedCallback handler)
handler - State change handlervoid onError(Throwable error, boolean mustCleanCurrentConnection)
error - The error that triggered the eventmustCleanCurrentConnection - True if the connection must be cleanedvoid received(MessageReceivedHandler handler)
handler - Message received handlervoid onReceived(com.google.gson.JsonElement message)
void connectionSlow(Runnable handler)
handler - Handlervoid closed(Runnable handler)
handler - HandlerString getConnectionToken()
String getConnectionId()
String getQueryString()
String getMessageId()
String getGroupsToken()
String getConnectionData()
ConnectionState getState()
SignalRFuture<Void> start(ClientTransport transport)
transport - Transport to be used by the connectionvoid stop()
void disconnect()
SignalRFuture<Void> send(String data)
data - Data to sendvoid prepareRequest(Request request)
request - The request to preparecom.google.gson.Gson getGson()
void setGson(com.google.gson.Gson gson)
gson - Gson instancecom.google.gson.JsonParser getJsonParser()
Logger getLogger()
void setClientCertificate(String clientCertificatePath, char[] clientCertificatePassword, String clientCertificateAlias)
clientCertificatePath - client certificate pathclientCertificatePassword - client certificate passwordclientCertificateAlias - client certificate aliasCopyright © 2019. All rights reserved.