protected AbstractMessageTask(ClientMessage clientMessage, Node node, Connection connection) { this.clientMessage = clientMessage; this.logger = node.getLogger(getClass()); this.node = node; this.nodeEngine = node.nodeEngine; this.serializationService = node.getSerializationService(); this.connection = connection; this.clientEngine = node.clientEngine; this.endpointManager = clientEngine.getEndpointManager(); this.endpoint = initEndpoint(); }
protected AbstractMessageTask(ClientMessage clientMessage, Node node, Connection connection) { this.clientMessage = clientMessage; this.logger = node.getLogger(getClass()); this.node = node; this.nodeEngine = node.nodeEngine; this.serializationService = node.getSerializationService(); this.connection = connection; this.clientEngine = node.clientEngine; this.endpointManager = clientEngine.getEndpointManager(); this.endpoint = initEndpoint(); }
private boolean doRun() { ClientEngineImpl engine = getService(); final ClientEndpointManagerImpl endpointManager = (ClientEndpointManagerImpl) engine.getEndpointManager(); if (!engine.removeOwnershipMapping(clientUuid, memberUuid)) { return false; } Set<ClientEndpoint> endpoints = endpointManager.getEndpoints(clientUuid); // This part cleans up listener and transactions for (ClientEndpoint endpoint : endpoints) { endpoint.getConnection().close("ClientDisconnectionOperation: Client disconnected from cluster", null); } NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine(); // This part cleans up locks conditions semaphore etc.. Collection<ClientAwareService> services = nodeEngine.getServices(ClientAwareService.class); for (ClientAwareService service : services) { service.clientDisconnected(clientUuid); } return true; }
private boolean doRun() { ClientEngineImpl engine = getService(); final ClientEndpointManagerImpl endpointManager = (ClientEndpointManagerImpl) engine.getEndpointManager(); if (!engine.removeOwnershipMapping(clientUuid, memberUuid)) { return false; } Set<ClientEndpoint> endpoints = endpointManager.getEndpoints(clientUuid); // This part cleans up listener and transactions for (ClientEndpoint endpoint : endpoints) { endpoint.getConnection().close("ClientDisconnectionOperation: Client disconnected from cluster", null); } NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine(); // This part cleans up locks conditions semaphore etc.. Collection<ClientAwareService> services = nodeEngine.getServices(ClientAwareService.class); for (ClientAwareService service : services) { service.clientDisconnected(clientUuid); } return true; }
private boolean doRun() throws Exception { ILogger logger = getLogger(); ClientEngineImpl engine = getService(); String memberUuid = getCallerUuid(); if (!engine.trySetLastAuthenticationCorrelationId(clientUuid, authCorrelationId)) { String message = "Server already processed a newer authentication from client with UUID " + clientUuid + ". Not applying requested ownership change to " + memberUuid; logger.info(message); throw new StubAuthenticationException(message); } Set<ClientEndpoint> endpoints = engine.getEndpointManager().getEndpoints(clientUuid); for (ClientEndpoint endpoint : endpoints) { ClientPrincipal principal = new ClientPrincipal(clientUuid, memberUuid); endpoint.authenticated(principal); } String previousMemberUuid = engine.addOwnershipMapping(clientUuid, memberUuid); if (logger.isFineEnabled()) { logger.fine("Client authenticated " + clientUuid + ", owner " + memberUuid); } return previousMemberUuid == null; }
private boolean doRun() throws Exception { ILogger logger = getLogger(); ClientEngineImpl engine = getService(); String memberUuid = getCallerUuid(); if (!engine.trySetLastAuthenticationCorrelationId(clientUuid, authCorrelationId)) { String message = "Server already processed a newer authentication from client with UUID " + clientUuid + ". Not applying requested ownership change to " + memberUuid; logger.info(message); throw new StubAuthenticationException(message); } Set<ClientEndpoint> endpoints = engine.getEndpointManager().getEndpoints(clientUuid); for (ClientEndpoint endpoint : endpoints) { ClientPrincipal principal = new ClientPrincipal(clientUuid, memberUuid); endpoint.authenticated(principal); } String previousMemberUuid = engine.addOwnershipMapping(clientUuid, memberUuid); if (logger.isFineEnabled()) { logger.fine("Client authenticated " + clientUuid + ", owner " + memberUuid); } return previousMemberUuid == null; }