public class ClientEngineImpl extends Object implements ClientEngine, CoreService, PreJoinAwareService, ManagedService, MembershipAwareService, EventPublishingService<ClientEvent,ClientListener>
| Modifier and Type | Field and Description |
|---|---|
static String |
SERVICE_NAME
Service name to be used in requests.
|
| Constructor and Description |
|---|
ClientEngineImpl(Node node) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(ClientMessage clientMessage)
Performs this operation on the given argument.
|
String |
addOwnershipMapping(String clientUuid,
String ownerUuid) |
void |
applySelector(ClientSelector newSelector)
Only Clients that can pass through filter are allowed to connect to cluster.
|
boolean |
bind(ClientEndpoint endpoint)
Registers client endpoint to endpointManager.
|
Address |
clientAddressOf(Address memberAddress)
Locates the client address of the given member address.
|
void |
dispatchEvent(ClientEvent event,
ClientListener listener)
Notifies the service of a published event.
|
int |
getClientEndpointCount() |
ClientExceptions |
getClientExceptions() |
ExecutorService |
getClientManagementExecutor() |
Collection<Client> |
getClients() |
Map<String,String> |
getClientStatistics()
The statistics is a String that is composed of key=value pairs separated by ',' .
|
ClusterService |
getClusterService() |
Map<ClientType,Integer> |
getConnectedClientStats()
Returns Map which contains number of connected clients to the cluster.
|
ClientEndpointManager |
getEndpointManager() |
EventService |
getEventService() |
ILogger |
getLogger(Class clazz) |
String |
getOwnerUuid(String clientUuid) |
ClientPartitionListenerService |
getPartitionListenerService() |
IPartitionService |
getPartitionService() |
Operation |
getPreJoinOperation()
An operation to be executed on the joining member before it is set as joined.
|
ProxyService |
getProxyService() |
SecurityContext |
getSecurityContext() |
Address |
getThisAddress() |
String |
getThisUuid() |
TransactionManagerService |
getTransactionManagerService() |
void |
init(NodeEngine nodeEngine,
Properties properties)
Initializes this service.
|
boolean |
isClientAllowed(Client client) |
void |
memberAdded(MembershipServiceEvent event)
Invoked when a new member is added to the cluster.
|
Address |
memberAddressOf(Address clientAddress)
Locates the cluster member that has the provided client address and returns its member address,
to be used for intra-cluster communication.
|
void |
memberAttributeChanged(MemberAttributeServiceEvent event)
Invoked when a member attribute is changed.
|
void |
memberRemoved(MembershipServiceEvent event)
Invoked when an existing member leaves the cluster.
|
boolean |
removeOwnershipMapping(String clientUuid,
String memberUuid) |
void |
reset()
Resets this service back to its initial state.
|
void |
shutdown(boolean terminate)
Shuts down this service.
|
boolean |
trySetLastAuthenticationCorrelationId(String clientUuid,
long newCorrelationId) |
public static final String SERVICE_NAME
public ClientEngineImpl(Node node)
public ExecutorService getClientManagementExecutor()
public int getClientEndpointCount()
getClientEndpointCount in interface ClientEnginepublic void accept(ClientMessage clientMessage)
Consumeraccept in interface Consumer<ClientMessage>clientMessage - the input argumentpublic IPartitionService getPartitionService()
getPartitionService in interface ClientEnginepublic ClusterService getClusterService()
getClusterService in interface ClientEnginepublic EventService getEventService()
getEventService in interface ClientEnginepublic ProxyService getProxyService()
getProxyService in interface ClientEnginepublic Address getThisAddress()
getThisAddress in interface ClientEngineNode.getThisAddress()public String getThisUuid()
getThisUuid in interface ClientEnginepublic ILogger getLogger(Class clazz)
getLogger in interface ClientEnginepublic ClientEndpointManager getEndpointManager()
getEndpointManager in interface ClientEnginepublic ClientExceptions getClientExceptions()
getClientExceptions in interface ClientEnginepublic SecurityContext getSecurityContext()
getSecurityContext in interface ClientEnginepublic boolean bind(ClientEndpoint endpoint)
ClientEngineClientEngine.applySelector(com.hazelcast.client.impl.ClientSelector)bind in interface ClientEngineendpoint - to be registered to client enginepublic void applySelector(ClientSelector newSelector)
ClientEngineapplySelector in interface ClientEnginenewSelector - to select a client or group of clients to act uponpublic void dispatchEvent(ClientEvent event, ClientListener listener)
EventPublishingServicedispatchEvent in interface EventPublishingService<ClientEvent,ClientListener>event - the published eventlistener - the listener registered for this eventpublic void memberAdded(MembershipServiceEvent event)
MembershipAwareServicememberAdded in interface MembershipAwareServiceevent - the event for a new member added to the clusterpublic void memberRemoved(MembershipServiceEvent event)
MembershipAwareServicememberRemoved in interface MembershipAwareServiceevent - the event for an existing member leaving the clusterpublic void memberAttributeChanged(MemberAttributeServiceEvent event)
MembershipAwareServicememberAttributeChanged in interface MembershipAwareServiceevent - the event for a member attribute being changedpublic Collection<Client> getClients()
getClients in interface ClientEnginepublic void init(NodeEngine nodeEngine, Properties properties)
ManagedServiceinit in interface ManagedServicenodeEngine - the NodeEngine that this service belongs toproperties - the Properties (can be used to pass settings to the service)public void reset()
ManagedServiceTODO: what is the purpose of reset
reset in interface ManagedServicepublic void shutdown(boolean terminate)
ManagedServiceTODO: what is the purpose of the terminate variable
shutdown in interface ManagedServiceterminate - true to shut down this servicepublic boolean trySetLastAuthenticationCorrelationId(String clientUuid, long newCorrelationId)
public String getOwnerUuid(String clientUuid)
getOwnerUuid in interface ClientEnginepublic TransactionManagerService getTransactionManagerService()
getTransactionManagerService in interface ClientEnginepublic ClientPartitionListenerService getPartitionListenerService()
getPartitionListenerService in interface ClientEnginepublic boolean isClientAllowed(Client client)
isClientAllowed in interface ClientEngineclient - to check if allowed through current ClientSelectorpublic Operation getPreJoinOperation()
PreJoinAwareServicePostJoinAwareService.getPostJoinOperation()s, no partition locks, no key-based locks, no service level
locks, no database interaction are allowed. Additionally, a pre-join operation is executed while the cluster
lock is being held on the joining member, so it is important that the operation finishes quickly and does not
interact with other locks.
The Operation.getPartitionId() method should return a negative value.
This means that the operations should not implement PartitionAwareOperation.
Pre join operations should return response, which may also be a null response.
getPreJoinOperation in interface PreJoinAwareServicenull.public Map<ClientType,Integer> getConnectedClientStats()
ClientEnginegetConnectedClientStats in interface ClientEnginepublic Map<String,String> getClientStatistics()
ClientEnginegetClientStatistics in interface ClientEnginepublic Address memberAddressOf(Address clientAddress)
ClientEngineTargetNotMemberException when no member with the
provided client address can be located.memberAddressOf in interface ClientEngineclientAddress - the client address of the memberpublic Address clientAddressOf(Address memberAddress)
ClientEngineClientEngine.memberAddressOf(Address).clientAddressOf in interface ClientEnginememberAddress - the member address of the memberCopyright © 2021 Hazelcast, Inc.. All Rights Reserved.