private boolean shouldSendEvent() { if (!endpoint.isAlive()) { return false; } ClusterService clusterService = clientEngine.getClusterService(); boolean currentMemberIsMaster = clusterService.getMasterAddress().equals(clientEngine.getThisAddress()); if (parameters.localOnly && !currentMemberIsMaster) { //if client registered localOnly, only master is allowed to send request return false; } return true; } }
private boolean shouldSendEvent() { if (!endpoint.isAlive()) { return false; } ClusterService clusterService = clientEngine.getClusterService(); boolean currentMemberIsMaster = clusterService.getMasterAddress().equals(clientEngine.getThisAddress()); if (parameters.localOnly && !currentMemberIsMaster) { //if client registered localOnly, only master is allowed to send request return false; } return true; } }
private ClientMessage prepareAuthenticatedClientMessage() { Connection connection = endpoint.getConnection(); ILogger logger = clientEngine.getLogger(getClass()); endpoint.authenticated(principal, credentials, isOwnerConnection(), clientVersion, clientMessage.getCorrelationId()); setConnectionType(); logger.info("Received auth from " + connection + ", successfully authenticated" + ", principal: " + principal + ", owner connection: " + isOwnerConnection() + ", client version: " + clientVersion); if (endpointManager.registerEndpoint(endpoint)) { clientEngine.bind(endpoint); } final Address thisAddress = clientEngine.getThisAddress(); byte status = AuthenticationStatus.AUTHENTICATED.getId(); return encodeAuth(status, thisAddress, principal.getUuid(), principal.getOwnerUuid(), serializationService.getVersion(), Collections.<Member>emptyList()); }
private ClientMessage prepareAuthenticatedClientMessage() { Connection connection = endpoint.getConnection(); endpoint.authenticated(principal, credentials, isOwnerConnection(), clientVersion, clientMessage.getCorrelationId(), clientName, attributes); setConnectionType(); logger.info("Received auth from " + connection + ", successfully authenticated" + ", principal: " + principal + ", owner connection: " + isOwnerConnection() + ", client version: " + clientVersion); if (endpointManager.registerEndpoint(endpoint)) { clientEngine.bind(endpoint); } final Address thisAddress = clientEngine.getThisAddress(); byte status = AUTHENTICATED.getId(); return encodeAuth(status, thisAddress, principal.getUuid(), principal.getOwnerUuid(), serializationService.getVersion(), Collections.<Member>emptyList()); }