public final class ClientEndpointImpl extends Object implements ClientEndpoint
ClientEndpoint
and Client
implementation.Constructor and Description |
---|
ClientEndpointImpl(ClientEngineImpl clientEngine,
Connection connection) |
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,
String clientVersion,
long authCorrelationId) |
void |
clearAllListeners() |
void |
destroy() |
long |
getAuthenticationCorrelationId() |
ClientType |
getClientType()
Returns the type of this client.
|
int |
getClientVersion() |
Connection |
getConnection() |
Credentials |
getCredentials() |
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 |
setClientVersion(String version) |
void |
setLoginContext(LoginContext loginContext) |
void |
setTransactionContext(TransactionContext transactionContext) |
String |
toString() |
public ClientEndpointImpl(ClientEngineImpl clientEngine, Connection connection)
public Connection getConnection()
getConnection
in interface ClientEndpoint
public String getUuid()
Client
public boolean isAlive()
ClientEndpoint
isAlive
in interface ClientEndpoint
public void setLoginContext(LoginContext loginContext)
setLoginContext
in interface ClientEndpoint
public Subject getSubject()
getSubject
in interface ClientEndpoint
public boolean isFirstConnection()
isFirstConnection
in interface ClientEndpoint
public void authenticated(ClientPrincipal principal, Credentials credentials, boolean firstConnection, String clientVersion, long authCorrelationId)
authenticated
in interface ClientEndpoint
public void authenticated(ClientPrincipal principal)
authenticated
in interface ClientEndpoint
public boolean isAuthenticated()
isAuthenticated
in interface ClientEndpoint
public int getClientVersion()
getClientVersion
in interface ClientEndpoint
BuildInfo
public void setClientVersion(String version)
setClientVersion
in interface ClientEndpoint
version
- The version string as obtained from the environmentpublic InetSocketAddress getSocketAddress()
Client
getSocketAddress
in interface Client
getSocketAddress
in interface Endpoint
public ClientType getClientType()
Client
getClientType
in interface Client
public TransactionContext getTransactionContext(String txnId)
getTransactionContext
in interface ClientEndpoint
public Credentials getCredentials()
getCredentials
in interface ClientEndpoint
public void setTransactionContext(TransactionContext transactionContext)
setTransactionContext
in interface ClientEndpoint
public void removeTransactionContext(String txnId)
removeTransactionContext
in interface ClientEndpoint
public void addListenerDestroyAction(String service, String topic, String id)
ClientEndpoint
addListenerDestroyAction
in interface ClientEndpoint
service
- 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)
ClientEndpoint
addDestroyAction
in interface ClientEndpoint
registrationId
- registration id of destroy actionremoveAction
- callable that will be called when endpoint is destroyedpublic boolean removeDestroyAction(String id)
removeDestroyAction
in interface ClientEndpoint
id
- registration id of destroy actionpublic void clearAllListeners()
clearAllListeners
in interface ClientEndpoint
public void destroy() throws LoginException
LoginException
public long getAuthenticationCorrelationId()
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.