public final class ClientEndpointImpl extends Object implements ClientEndpoint
ClientEndpoint and Client implementation.| Constructor and Description |
|---|
ClientEndpointImpl(ClientEngineImpl clientEngine,
Connection conn) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDestroyAction(String registrationId,
Callable<Boolean> removeAction)
Adds a remove callable to be called when endpoint is destroyed
Note: removeDestroyAction should be called when there is no need to destroy action anymore.
|
void |
addListenerDestroyAction(String service,
String topic,
String id)
Adds a remove callable to be called when endpoint is destroyed to clean related listener
Following line will be called when endpoint destroyed :
eventService.deregisterListener(service, topic, id);
Note: removeDestroyAction should be called when there is no need to destroy action anymore.
|
void |
authenticated(ClientPrincipal principal) |
void |
authenticated(ClientPrincipal principal,
Credentials credentials,
boolean firstConnection) |
void |
clearAllListeners() |
void |
destroy() |
ClientType |
getClientType()
Returns the type of this client.
|
Connection |
getConnection() |
Credentials |
getCredentials() |
ClientPrincipal |
getPrincipal() |
InetSocketAddress |
getSocketAddress()
Returns the socket address of this client.
|
Subject |
getSubject() |
TransactionContext |
getTransactionContext(String txnId) |
String |
getUuid()
Returns a unique uuid for this client.
|
boolean |
isAlive()
Checks if the endpoint is alive.
|
boolean |
isAuthenticated() |
boolean |
isFirstConnection() |
boolean |
removeDestroyAction(String id) |
void |
removeTransactionContext(String txnId) |
void |
sendClientMessage(ClientMessage clientMessage) |
void |
sendEvent(Object key,
Object event,
long callId) |
void |
sendResponse(Object response,
long callId) |
void |
setLoginContext(LoginContext loginContext) |
void |
setTransactionContext(TransactionContext transactionContext) |
String |
toString() |
public ClientEndpointImpl(ClientEngineImpl clientEngine, Connection conn)
public Connection getConnection()
getConnection in interface ClientEndpointpublic String getUuid()
Clientpublic boolean isAlive()
ClientEndpointisAlive in interface ClientEndpointpublic void setLoginContext(LoginContext loginContext)
setLoginContext in interface ClientEndpointpublic Subject getSubject()
getSubject in interface ClientEndpointpublic boolean isFirstConnection()
isFirstConnection in interface ClientEndpointpublic void authenticated(ClientPrincipal principal, Credentials credentials, boolean firstConnection)
authenticated in interface ClientEndpointpublic void authenticated(ClientPrincipal principal)
authenticated in interface ClientEndpointpublic boolean isAuthenticated()
isAuthenticated in interface ClientEndpointpublic ClientPrincipal getPrincipal()
getPrincipal in interface ClientEndpointpublic InetSocketAddress getSocketAddress()
ClientgetSocketAddress in interface ClientgetSocketAddress in interface Endpointpublic ClientType getClientType()
ClientgetClientType in interface Clientpublic TransactionContext getTransactionContext(String txnId)
getTransactionContext in interface ClientEndpointpublic Credentials getCredentials()
getCredentials in interface ClientEndpointpublic void setTransactionContext(TransactionContext transactionContext)
setTransactionContext in interface ClientEndpointpublic void removeTransactionContext(String txnId)
removeTransactionContext in interface ClientEndpointpublic void addListenerDestroyAction(String service, String topic, String id)
ClientEndpointaddListenerDestroyAction in interface ClientEndpointservice - name of the related service of listenertopic - topic name of listener(mostly distributed object name)id - registration id of remove actionpublic void addDestroyAction(String registrationId, Callable<Boolean> removeAction)
ClientEndpointaddDestroyAction in interface ClientEndpointregistrationId - registration id of destroy actionremoveAction - callable that will be called when endpoint is destroyedpublic boolean removeDestroyAction(String id)
removeDestroyAction in interface ClientEndpointid - registration id of destroy actionpublic void clearAllListeners()
clearAllListeners in interface ClientEndpointpublic void destroy()
throws LoginException
LoginExceptionpublic void sendResponse(Object response, long callId)
sendResponse in interface ClientEndpointpublic void sendClientMessage(ClientMessage clientMessage)
public void sendEvent(Object key, Object event, long callId)
sendEvent in interface ClientEndpointCopyright © 2016 Hazelcast, Inc.. All Rights Reserved.