Examples of ClientEngineImpl


Examples of com.hazelcast.client.ClientEngineImpl

            }
            throw ExceptionUtil.rethrow(e);
        }
        securityContext = config.getSecurityConfig().isEnabled() ? initializer.getSecurityContext() : null;
        nodeEngine = new NodeEngineImpl(this);
        clientEngine = new ClientEngineImpl(this);
        connectionManager = nodeContext.createConnectionManager(this, serverSocketChannel);
        partitionService = new InternalPartitionServiceImpl(this);
        clusterService = new ClusterServiceImpl(this);
        textCommandService = new TextCommandServiceImpl(this);
        initializer.printNodeInfo(this);
View Full Code Here

Examples of com.hazelcast.client.ClientEngineImpl

        this.sXid = sXid;
    }

    @Override
    public Object innerCall() throws Exception {
        ClientEngineImpl clientEngine = getService();
        ClientEndpoint endpoint = getEndpoint();
        TransactionManagerServiceImpl transactionManager =
                (TransactionManagerServiceImpl) clientEngine.getTransactionManagerService();
        TransactionContext context = transactionManager.newClientTransactionContext(options, endpoint.getUuid());
        if (sXid != null) {
            Transaction transaction = TransactionAccessor.getTransaction(context);
            transactionManager.addManagedTransaction(sXid, transaction);
        }
View Full Code Here

Examples of com.hazelcast.client.ClientEngineImpl

            }
            throw ExceptionUtil.rethrow(e);
        }
        securityContext = config.getSecurityConfig().isEnabled() ? initializer.getSecurityContext() : null;
        nodeEngine = new NodeEngineImpl(this);
        clientEngine = new ClientEngineImpl(this);
        connectionManager = nodeContext.createConnectionManager(this, serverSocketChannel);
        partitionService = new InternalPartitionServiceImpl(this);
        clusterService = new ClusterServiceImpl(this);
        textCommandService = new TextCommandServiceImpl(this);
        initializer.printNodeInfo(this);
View Full Code Here

Examples of com.hazelcast.client.impl.ClientEngineImpl

    }

    public static SimpleClient newClient(Node node) throws IOException {
        if (node.isActive()) {
            if (TestEnvironment.isMockNetwork()) {
                ClientEngineImpl engine = node.clientEngine;
                return new MockSimpleClient(engine, node.getSerializationService());
            } else {
                return new SocketSimpleClient(node);
            }
        }
View Full Code Here

Examples of com.hazelcast.client.impl.ClientEngineImpl

        this.sXid = sXid;
    }

    @Override
    public Object innerCall() throws Exception {
        ClientEngineImpl clientEngine = getService();
        ClientEndpoint endpoint = getEndpoint();
        TransactionManagerServiceImpl transactionManager =
                (TransactionManagerServiceImpl) clientEngine.getTransactionManagerService();
        TransactionContext context = transactionManager.newClientTransactionContext(options, endpoint.getUuid());
        if (sXid != null) {
            Transaction transaction = TransactionAccessor.getTransaction(context);
            transactionManager.addManagedTransaction(sXid, transaction);
        }
View Full Code Here

Examples of com.hazelcast.client.impl.ClientEngineImpl

        this.clientUuid = clientUuid;
    }

    @Override
    public void run() throws Exception {
        ClientEngineImpl service = getService();
        String memberUuid = getCallerUuid();
        ClientEngineImpl engine = getService();
        Set<ClientEndpoint> endpoints = engine.getEndpointManager().getEndpoints(clientUuid);
        for (ClientEndpoint endpoint : endpoints) {
            ClientPrincipal principal = new ClientPrincipal(clientUuid, memberUuid);
            endpoint.authenticated(principal);
        }
        service.addOwnershipMapping(clientUuid, memberUuid);
View Full Code Here

Examples of com.hazelcast.client.impl.ClientEngineImpl

    public void run() throws Exception {
        if (mappings == null) {
            return;
        }

        ClientEngineImpl engine = getService();
        for (Map.Entry<String, String> entry : mappings.entrySet()) {
            engine.addOwnershipMapping(entry.getKey(), entry.getValue());
        }
    }
View Full Code Here

Examples of com.hazelcast.client.impl.ClientEngineImpl

        this.clientUuid = clientUuid;
    }

    @Override
    public void run() throws Exception {
        ClientEngineImpl engine = getService();
        final ClientEndpointManager endpointManager = engine.getEndpointManager();
        Set<ClientEndpoint> endpoints = endpointManager.getEndpoints(clientUuid);
        for (ClientEndpoint endpoint : endpoints) {
            endpointManager.removeEndpoint(endpoint, true);
        }
        engine.removeOwnershipMapping(clientUuid);

        NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
        nodeEngine.onClientDisconnected(clientUuid);
        Collection<ClientAwareService> services = nodeEngine.getServices(ClientAwareService.class);
        for (ClientAwareService service : services) {
View Full Code Here

Examples of com.hazelcast.client.impl.ClientEngineImpl

            return handleUnauthenticated();
        }
    }

    private boolean authenticate() {
        ClientEngineImpl clientEngine = getService();
        Connection connection = endpoint.getConnection();
        ILogger logger = clientEngine.getLogger(getClass());
        boolean authenticated;
        if (credentials == null) {
            authenticated = false;
            logger.severe("Could not retrieve Credentials object!");
        } else if (clientEngine.getSecurityContext() != null) {
            authenticated = authenticate(clientEngine.getSecurityContext());
        } else if (credentials instanceof UsernamePasswordCredentials) {
            UsernamePasswordCredentials usernamePasswordCredentials = (UsernamePasswordCredentials) credentials;
            authenticated = authenticate(usernamePasswordCredentials);
        } else {
            authenticated = false;
View Full Code Here

Examples of com.hazelcast.client.impl.ClientEngineImpl

                + ", " + (authenticated ? "successfully authenticated" : "authentication failed"));
        return authenticated;
    }

    private boolean authenticate(UsernamePasswordCredentials credentials) {
        ClientEngineImpl clientEngine = getService();
        GroupConfig groupConfig = clientEngine.getConfig().getGroupConfig();
        String nodeGroupName = groupConfig.getName();
        String nodeGroupPassword = groupConfig.getPassword();
        boolean usernameMatch = nodeGroupName.equals(credentials.getUsername());
        boolean passwordMatch = nodeGroupPassword.equals(credentials.getPassword());
        return usernameMatch && passwordMatch;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.