Package com.hazelcast.client.impl.client

Examples of com.hazelcast.client.impl.client.AuthenticationRequest


    public void auth() throws IOException {
        //we need to call this so that the endpoint is created for the connection. Normally this is done from
        //the ConnectionManager.
        clientEngine.getConnectionListener().connectionAdded(connection);
        AuthenticationRequest auth = new AuthenticationRequest(new UsernamePasswordCredentials("dev", "dev-pass"));
        auth.setOwnerConnection(true);
        send(auth);
        receive();
    }
View Full Code Here


        in = serializationService.createObjectDataInputStream(new BufferedInputStream(socket.getInputStream()));
        out = serializationService.createObjectDataOutputStream(new BufferedOutputStream(outputStream));
    }

    public void auth() throws IOException {
        AuthenticationRequest auth = new AuthenticationRequest(new UsernamePasswordCredentials("dev", "dev-pass"));
        send(auth);
        receive();
    }
View Full Code Here

    public void testPacket_writeAndRead() {
        SerializationService ss = createSerializationService(10);

        UsernamePasswordCredentials credentials = new UsernamePasswordCredentials("test", "pass");
        ClientPrincipal principal = new ClientPrincipal("uuid", "uuid2");
        Data data = ss.toData(new AuthenticationRequest(credentials, principal));

        Packet packet = new Packet(data, ss.getPortableContext());
        ByteBuffer buffer = ByteBuffer.allocate(1024);
        assertTrue(packet.writeTo(buffer));

        SerializationService ss2 = createSerializationService(1);

        buffer.flip();
        packet = new Packet(ss2.getPortableContext());
        assertTrue(packet.readFrom(buffer));

        AuthenticationRequest request = ss2.toObject(packet.getData());
    }
View Full Code Here

            public void entryAdded(EntryEvent event) {
                atomicInteger.incrementAndGet();
                countDownLatch.countDown();
            }
        };
        AuthenticationRequest key = new AuthenticationRequest(new UsernamePasswordCredentials("a", "b"));
        tradeMap.addEntryListener(listener, key, true);
        AuthenticationRequest key2 = new AuthenticationRequest(new UsernamePasswordCredentials("a", "c"));
        tradeMap.put(key2, 1);


        assertFalse(countDownLatch.await(5, TimeUnit.SECONDS));
        assertEquals(0, atomicInteger.get());
View Full Code Here

    }

    private Object authenticate(ClientConnection connection, Credentials credentials, ClientPrincipal principal
            , boolean firstConnection) throws IOException {
        final SerializationService ss = getSerializationService();
        AuthenticationRequest auth = new AuthenticationRequest(credentials, principal);
        connection.init();
        auth.setOwnerConnection(firstConnection);
        //contains remoteAddress and principal
        SerializableCollection collectionWrapper;
        try {
            collectionWrapper = (SerializableCollection) sendAndReceive(auth, connection);
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.hazelcast.client.impl.client.AuthenticationRequest

Copyright © 2018 www.massapicom. 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.