Package de.fhkn.in.uce.mediator.connectionhandling

Examples of de.fhkn.in.uce.mediator.connectionhandling.ConnectionRequest


        }
    }

    private void handleConnectionRequest(final Message message, final Socket controlConnection) throws Exception {
        this.mediatorUtil.checkForAttribute(message, Username.class);
        this.connectionRequests.putConnectionRequest(new ConnectionRequest(controlConnection, message));
        final Username username = message.getAttribute(Username.class);
        final UserData user = this.userList.getUserDataByUserId(username.getUsernameAsString());
        if (user == null) {
            final String errorMessage = "User " + username.getUsernameAsString() + " not exists"; //$NON-NLS-1$ //$NON-NLS-2$
            this.sendFailureResponse(message, errorMessage, STUNErrorCode.BAD_REQUEST,
View Full Code Here


        }
    }

    private void handleConnectionRequestResponse(final Message message, final Socket controlConnection)
            throws Exception {
        final ConnectionRequest connReq = this.connectionRequests.getConnectionRequest(new String(message.getHeader()
                .getTransactionId()));
        final Message successResponse = connReq.getConnectionRequestMessage().buildSuccessResponse();
        final XorMappedAddress endpointAtRelay = message.getAttribute(XorMappedAddress.class);
        successResponse.addAttribute(endpointAtRelay);
        successResponse.writeTo(connReq.getControlConnection().getOutputStream());
    }
View Full Code Here

        }
    }

    private void handleConnectionRequest(final Message message, final Socket controlConnection) throws Exception {
        this.mediatorUtil.checkForAttribute(message, Username.class);
        this.connectionRequests.putConnectionRequest(new ConnectionRequest(controlConnection, message));
        final String username = message.getAttribute(Username.class).getUsernameAsString();
        final UserData userData = this.userList.getUserDataByUserId(username);
        if (userData == null) {
            final String errorMessage = "User " + username + " not exists"; //$NON-NLS-1$ //$NON-NLS-2$
            this.sendFailureResponse(message, errorMessage, STUNErrorCode.BAD_REQUEST,
View Full Code Here

    }

    private void handleConnectionRequestResponse(final Message message, final Socket controlConnection)
            throws Exception {
        logger.debug("Handling connection request response"); //$NON-NLS-1$
        final ConnectionRequest connReq = this.connectionRequests.getConnectionRequest(new String(message.getHeader()
                .getTransactionId()));
        if (null == connReq) {
            logger.debug("Connection request is NOT in list"); //$NON-NLS-1$
        }
        logger.debug(
                "Got connection request from list with transactionId={}", String.valueOf(connReq.getConnectionRequestMessage().getHeader().getTransactionId())); //$NON-NLS-1$
        final Message successResponse = connReq.getConnectionRequestMessage().buildSuccessResponse();
        final InetSocketAddress targetEndpoint = new InetSocketAddress(controlConnection.getInetAddress(),
                controlConnection.getPort());
        logger.debug("Sending connection request response with {} to source", targetEndpoint.toString()); //$NON-NLS-1$
        successResponse.addAttribute(new XorMappedAddress(targetEndpoint));
        successResponse.addAttribute(new EndpointClass(EndpointCategory.PUBLIC));
        successResponse.writeTo(connReq.getControlConnection().getOutputStream());
    }
View Full Code Here

    }

    private void handleConnectionRequest(final Message message, final Socket controlConnection) throws Exception {
        this.mediatorUtil.checkForAttribute(message, Username.class);
        this.mediatorUtil.checkForAttribute(message, XorMappedAddress.class);
        this.connectionRequests.putConnectionRequest(new ConnectionRequest(controlConnection, message));
        final Username username = message.getAttribute(Username.class);
        final UserData user = this.userList.getUserDataByUserId(username.getUsernameAsString());
        if (user == null) {
            final String errorMessage = "User " + username.getUsernameAsString() + " not exists"; //$NON-NLS-1$ //$NON-NLS-2$
            this.sendFailureResponse(message, errorMessage, STUNErrorCode.BAD_REQUEST,
View Full Code Here

        }
    }

    private void handleConnectionRequestResponse(final Message message, final Socket controlConnection)
            throws Exception {
        final ConnectionRequest connReq = this.connectionRequests.getConnectionRequest(new String(message.getHeader()
                .getTransactionId()));
        final Message successResponse = connReq.getConnectionRequestMessage().buildSuccessResponse();
        // public endpoint
        successResponse.addAttribute(this.createXorMappedAddressFromSocket(controlConnection, successResponse
                .getHeader().getTransactionId()));
        // private endpoint
        successResponse.addAttribute(message.getAttribute(XorMappedAddress.class));
        logger.debug("Sending connection request response to {}", connReq.getControlConnection().toString()); //$NON-NLS-1$
        successResponse.writeTo(connReq.getControlConnection().getOutputStream());
    }
View Full Code Here

        }
    }

    private void handleConnectionRequest(final Message message, final Socket controlConnection) throws Exception {
        this.mediatorUtil.checkForAttribute(message, Username.class);
        this.connectionRequests.putConnectionRequest(new ConnectionRequest(controlConnection, message));
        final Username username = message.getAttribute(Username.class);
        final UserData user = this.userList.getUserDataByUserId(username.getUsernameAsString());
        if (user == null) {
            final String errorMessage = "User " + username.getUsernameAsString() + " not exists"; //$NON-NLS-1$ //$NON-NLS-2$
            this.sendFailureResponse(message, errorMessage, STUNErrorCode.BAD_REQUEST,
View Full Code Here

        }
    }

    private void handleConnectionRequestResponse(final Message message, final Socket controlConnection)
            throws Exception {
        final ConnectionRequest connReq = this.connectionRequests.getConnectionRequest(new String(message.getHeader()
                .getTransactionId()));
        final Message successResponse = connReq.getConnectionRequestMessage().buildSuccessResponse();
        successResponse.writeTo(connReq.getControlConnection().getOutputStream());
    }
View Full Code Here

TOP

Related Classes of de.fhkn.in.uce.mediator.connectionhandling.ConnectionRequest

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.