Package org.sdnplatform.sync.thrift

Examples of org.sdnplatform.sync.thrift.HelloMessage


    @Override
    public void channelConnected(ChannelHandlerContext ctx,
                                 ChannelStateEvent e) throws Exception {
        channelState = ChannelState.CONNECTED;

        HelloMessage m = new HelloMessage();
        if (getLocalNodeId() != null)
            m.setNodeId(getLocalNodeId());
        AsyncMessageHeader header = new AsyncMessageHeader();
        header.setTransactionId(getTransactionId());
        m.setHeader(header);
        switch (getAuthScheme()) {
            case NO_AUTH:
                channelState = ChannelState.AUTHENTICATED;
                m.setAuthScheme(org.sdnplatform.sync.thrift.
                                AuthScheme.NO_AUTH);
                break;
            case CHALLENGE_RESPONSE:
                AuthChallengeResponse cr = new AuthChallengeResponse();
                cr.setChallenge(generateChallenge());
                m.setAuthScheme(org.sdnplatform.sync.thrift.
                                AuthScheme.CHALLENGE_RESPONSE);
                m.setAuthChallengeResponse(cr);
                break;
        }
        SyncMessage bsm = new SyncMessage(MessageType.HELLO);
        bsm.setHello(m);
        ctx.getChannel().write(bsm);
View Full Code Here


            authenticateResponse(currentChallenge, cr.getResponse());
            currentChallenge = null;
            channelState = ChannelState.AUTHENTICATED;
            handleHello(request, channel);
        } else if (cr.isSetChallenge()) {
            HelloMessage m = new HelloMessage();
            if (getLocalNodeId() != null)
                m.setNodeId(getLocalNodeId());
            AsyncMessageHeader header = new AsyncMessageHeader();
            header.setTransactionId(getTransactionId());
            m.setHeader(header);
            SyncMessage bsm = new SyncMessage(MessageType.HELLO);
            bsm.setHello(m);

            AuthChallengeResponse reply = new AuthChallengeResponse();
            reply.setResponse(generateResponse(cr.getChallenge()));
            m.setAuthChallengeResponse(reply);
            channel.write(bsm);
        } else {
            throw new AuthException("No authentication data in " +
                    "handshake message");
        }
View Full Code Here

TOP

Related Classes of org.sdnplatform.sync.thrift.HelloMessage

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.