Examples of SessionRequestMessage


Examples of com.tinkerpop.rexster.protocol.msg.SessionRequestMessage

        pk.write(msg.Username);
        pk.write(msg.Password);
    }

    protected SessionRequestMessage readMessageArray(final Unpacker un, final SessionRequestMessage msg) throws IOException {
        SessionRequestMessage message = super.readMessageArray(un, msg);
        message.Username = un.trySkipNil()?null:un.readString();
        message.Password = un.trySkipNil()?null:un.readString();
        return message;
    }
View Full Code Here

Examples of com.tinkerpop.rexster.protocol.msg.SessionRequestMessage

        this.rexProConnection = new RexProClientConnection(rexProHost, rexProPort);
    }

    public void open() {
        if (sessionKey == RexProMessage.EMPTY_SESSION) {
            SessionRequestMessage sessionRequestMessageToSend = new SessionRequestMessage();
            sessionRequestMessageToSend.Username = this.username;
            sessionRequestMessageToSend.Password = this.password;
            sessionRequestMessageToSend.setSessionAsUUID(SessionRequestMessage.EMPTY_SESSION);
            sessionRequestMessageToSend.setRequestAsUUID(UUID.randomUUID());

            try {
                sessionRequestMessageToSend.validateMetaData();
            } catch (RexProException e) {
                e.printStackTrace();
            }

            // if close() gets called then have to recreate the the connection here.  need to factor out this
View Full Code Here

Examples of com.tinkerpop.rexster.protocol.msg.SessionRequestMessage

    public void close() {

        try {
            if (sessionKey != RexProMessage.EMPTY_SESSION) {
                SessionRequestMessage sessionKillMessageToSend = new SessionRequestMessage();
                sessionKillMessageToSend.metaSetKillSession(true);
                sessionKillMessageToSend.setRequestAsUUID(UUID.randomUUID());

                // need to set the session here so that the server knows which one to delete.
                sessionKillMessageToSend.setSessionAsUUID(this.sessionKey);
                final RexProMessage rcvMessage = sendRequest(sessionKillMessageToSend, 3);

                // response message will have an EMPTY_SESSION
                if (rcvMessage instanceof SessionResponseMessage) {
                    this.sessionKey = rcvMessage.sessionAsUUID();
View Full Code Here

Examples of com.tinkerpop.rexster.protocol.msg.SessionRequestMessage

    @Test
    public void testSessionRequestAndResponse() throws Exception {
        final RexsterClient client = getClient();

        //create a session
        final SessionRequestMessage outMsg = new SessionRequestMessage();
        outMsg.setRequestAsUUID(UUID.randomUUID());

        RexProMessage inMsg = client.execute(outMsg);
        Assert.assertNotNull(inMsg.Session);
        Assert.assertTrue(inMsg instanceof SessionResponseMessage);

        UUID sessionKey = BitWorks.convertByteArrayToUUID(inMsg.Session);

        //kill said session
        final SessionRequestMessage deathMsg = new SessionRequestMessage();
        deathMsg.Session = BitWorks.convertUUIDToByteArray(sessionKey);
        deathMsg.setRequestAsUUID(UUID.randomUUID());
        deathMsg.metaSetKillSession(true);

        inMsg = client.execute(deathMsg);
        Assert.assertNotNull(inMsg.Session);
        Assert.assertTrue(inMsg instanceof SessionResponseMessage);
View Full Code Here

Examples of com.tinkerpop.rexster.protocol.msg.SessionRequestMessage

    public void testSessionGraphDefinition() throws Exception {
        final RexsterClient client = getClient();

        for (Map.Entry<String, Map<String,String>> entry : getAvailableGraphs(client).entrySet()) {
            //create a session
            final SessionRequestMessage outMsg = new SessionRequestMessage();
            outMsg.setRequestAsUUID(UUID.randomUUID());
            outMsg.metaSetGraphName(entry.getKey());
            outMsg.metaSetGraphObjName("graph");

            RexProMessage inMsg = client.execute(outMsg);
            Assert.assertNotNull(inMsg.Session);
            Assert.assertTrue(inMsg instanceof SessionResponseMessage);
View Full Code Here

Examples of com.tinkerpop.rexster.protocol.msg.SessionRequestMessage

    @Test
    public void testDefiningNonExistentGraphNameFails() throws Exception {
        final RexsterClient client = getClient();

        //create a session
        final SessionRequestMessage outMsg = new SessionRequestMessage();
        outMsg.setRequestAsUUID(UUID.randomUUID());
        outMsg.metaSetGraphName("undefined");

        RexProMessage inMsg = client.execute(outMsg);
        Assert.assertNotNull(inMsg.Session);
        Assert.assertTrue(inMsg instanceof ErrorResponseMessage);
        Assert.assertEquals(((ErrorResponseMessage) inMsg).metaGetFlag(), ErrorResponseMessage.GRAPH_CONFIG_ERROR);
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.