public abstract class AbstractChannel<T extends Transport> extends java.lang.Object implements Channel
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
clientId |
protected Credentials |
credentials |
protected java.lang.String |
id |
protected T |
transport |
protected java.lang.Object |
transportData |
protected java.net.URI |
uri |
BYTEARRAY_BODY_HEADER, DEFAULT_TIME_TO_LIVE, RECONNECT_INTERVAL_MS_KEY, RECONNECT_MAX_ATTEMPTS_KEY| Constructor and Description |
|---|
AbstractChannel(T transport,
java.lang.String id,
java.net.URI uri) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getClientId()
Internal client id received from the server on the first ping
|
Credentials |
getCredentials()
Current security credentials for this channel
|
java.lang.String |
getId()
Channel identifier
|
T |
getTransport()
Transport used by this channel
|
<D> D |
getTransportData()
Internal data object that can be used by a transport to store channel-specific state
|
java.net.URI |
getUri()
Server application uri
|
void |
setCredentials(Credentials credentials)
Set the security credentials for this channel
Once the credentials are set, the next
Channel.send(org.granite.client.messaging.messages.RequestMessage, org.granite.client.messaging.ResponseListener...) will trigger the authentication with the server |
void |
setTransportData(java.lang.Object data)
Set the channel-specific state object for the transport
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddListener, bindStatus, getDefaultTimeToLive, isAuthenticated, isStarted, logout, logout, onCancelled, onDisconnect, onError, onMessage, removeListener, send, setDefaultTimeToLive, start, stop, unbindStatusprotected final java.lang.String id
protected final java.net.URI uri
protected volatile java.lang.String clientId
protected volatile Credentials credentials
protected volatile java.lang.Object transportData
public AbstractChannel(T transport, java.lang.String id, java.net.URI uri)
public T getTransport()
ChannelgetTransport in interface Channelpublic java.lang.String getId()
Channelpublic java.net.URI getUri()
Channelpublic java.lang.String getClientId()
ChannelgetClientId in interface Channelpublic void setCredentials(Credentials credentials)
ChannelChannel.send(org.granite.client.messaging.messages.RequestMessage, org.granite.client.messaging.ResponseListener...) will trigger the authentication with the serversetCredentials in interface Channelcredentials - credentialspublic Credentials getCredentials()
ChannelgetCredentials in interface Channelpublic <D> D getTransportData()
ChannelgetTransportData in interface ChannelD - type of transport datapublic void setTransportData(java.lang.Object data)
ChannelsetTransportData in interface Channeldata - transport state object