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 ClientEngine
public void accept(ClientMessage clientMessage)
Consumer
accept
in interface Consumer<ClientMessage>
clientMessage
- the input argumentpublic IPartitionService getPartitionService()
getPartitionService
in interface ClientEngine
public ClusterService getClusterService()
getClusterService
in interface ClientEngine
public EventService getEventService()
getEventService
in interface ClientEngine
public ProxyService getProxyService()
getProxyService
in interface ClientEngine
public Address getThisAddress()
getThisAddress
in interface ClientEngine
Node.getThisAddress()
public String getThisUuid()
getThisUuid
in interface ClientEngine
public ILogger getLogger(Class clazz)
getLogger
in interface ClientEngine
public ClientEndpointManager getEndpointManager()
getEndpointManager
in interface ClientEngine
public ClientExceptions getClientExceptions()
getClientExceptions
in interface ClientEngine
public SecurityContext getSecurityContext()
getSecurityContext
in interface ClientEngine
public boolean bind(ClientEndpoint endpoint)
ClientEngine
ClientEngine.applySelector(com.hazelcast.client.impl.ClientSelector)
bind
in interface ClientEngine
endpoint
- to be registered to client enginepublic void applySelector(ClientSelector newSelector)
ClientEngine
applySelector
in interface ClientEngine
newSelector
- to select a client or group of clients to act uponpublic void dispatchEvent(ClientEvent event, ClientListener listener)
EventPublishingService
dispatchEvent
in interface EventPublishingService<ClientEvent,ClientListener>
event
- the published eventlistener
- the listener registered for this eventpublic void memberAdded(MembershipServiceEvent event)
MembershipAwareService
memberAdded
in interface MembershipAwareService
event
- the event for a new member added to the clusterpublic void memberRemoved(MembershipServiceEvent event)
MembershipAwareService
memberRemoved
in interface MembershipAwareService
event
- the event for an existing member leaving the clusterpublic void memberAttributeChanged(MemberAttributeServiceEvent event)
MembershipAwareService
memberAttributeChanged
in interface MembershipAwareService
event
- the event for a member attribute being changedpublic Collection<Client> getClients()
getClients
in interface ClientEngine
public void init(NodeEngine nodeEngine, Properties properties)
ManagedService
init
in interface ManagedService
nodeEngine
- the NodeEngine that this service belongs toproperties
- the Properties (can be used to pass settings to the service)public void reset()
ManagedService
TODO: what is the purpose of reset
reset
in interface ManagedService
public void shutdown(boolean terminate)
ManagedService
TODO: what is the purpose of the terminate variable
shutdown
in interface ManagedService
terminate
- true
to shut down this servicepublic boolean trySetLastAuthenticationCorrelationId(String clientUuid, long newCorrelationId)
public String getOwnerUuid(String clientUuid)
getOwnerUuid
in interface ClientEngine
public TransactionManagerService getTransactionManagerService()
getTransactionManagerService
in interface ClientEngine
public ClientPartitionListenerService getPartitionListenerService()
getPartitionListenerService
in interface ClientEngine
public boolean isClientAllowed(Client client)
isClientAllowed
in interface ClientEngine
client
- to check if allowed through current ClientSelectorpublic Operation getPreJoinOperation()
PreJoinAwareService
PostJoinAwareService.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 PreJoinAwareService
null
.public Map<ClientType,Integer> getConnectedClientStats()
ClientEngine
getConnectedClientStats
in interface ClientEngine
public Map<String,String> getClientStatistics()
ClientEngine
getClientStatistics
in interface ClientEngine
public Address memberAddressOf(Address clientAddress)
ClientEngine
TargetNotMemberException
when no member with the
provided client address can be located.memberAddressOf
in interface ClientEngine
clientAddress
- the client address of the memberpublic Address clientAddressOf(Address memberAddress)
ClientEngine
ClientEngine.memberAddressOf(Address)
.clientAddressOf
in interface ClientEngine
memberAddress
- the member address of the memberCopyright © 2020 Hazelcast, Inc.. All Rights Reserved.