Package de.fhkn.in.uce.mediator.peerregistry

Examples of de.fhkn.in.uce.mediator.peerregistry.UserData


    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,
                    controlConnection.getOutputStream());
        } else {
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,
                    controlConnection.getOutputStream());
        } else {
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,
                    controlConnection.getOutputStream());
        } else {
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,
                    controlConnection.getOutputStream());
        } else {
View Full Code Here

    }

    @Override
    public void handleMessage(final Message registerMessage, final Socket controlConnection) throws Exception {
        this.checkForRequiredAttributes(registerMessage);
        final UserData newUser = this.createNewUserWithRequiredAttributes(registerMessage, controlConnection);
        newUser.addEndpoint(this.getPublicEndpointFromSocket(controlConnection));
        if (registerMessage.hasAttribute(XorMappedAddress.class)) {
            newUser.addEndpoint(this.createEndpointFromAttributes(registerMessage));
        }
        this.userList.addOrUpdateUser(newUser);
        logger.debug("User {} added or updated", newUser.getUserId()); //$NON-NLS-1$
        this.sendSuccessResponse(registerMessage, controlConnection);
    }
View Full Code Here

            throws Exception {
        final Username username = registerMessage.getAttribute(Username.class);
        final NATBehavior userNat = registerMessage.getAttribute(NATBehavior.class);
        final List<NATTraversalTechniqueAttribute> supportedTravTechs = this
                .createListOfTechniquesFromMessage(registerMessage);
        return new UserData(username.getUsernameAsString(), userNat, socketToUser, supportedTravTechs);
    }
View Full Code Here

    @Override
    public void handleMessage(final Message message, final Socket controlConnection) throws Exception {
        this.mediatorUtil.checkForAttribute(message, Username.class);
        final Username username = message.getAttribute(Username.class);
        final UserData user = this.userList.getUserDataByUserId(username.getUsernameAsString());
        final NATBehavior userNat = user.getUserNat();
        final Message response = message.buildSuccessResponse();
        response.addAttribute(userNat);
        response.writeTo(controlConnection.getOutputStream());
        logger.debug("response to {}:{} sent", message.getMessageClass().toString(), message.getMessageMethod()
                .toString());
View Full Code Here

    @Override
    public void handleMessage(final Message message, final Socket controlConnection) throws Exception {
        this.mediatorUtil.checkForAttribute(message, Username.class);
        final Username username = message.getAttribute(Username.class);
        final UserData user = this.userList.getUserDataByUserId(username.getUsernameAsString());
        final Message response = message.buildSuccessResponse();
        for (final NATTraversalTechniqueAttribute attr : user.getSupportedNatTraversalTechniques()) {
            response.addAttribute(attr);
        }
        response.writeTo(controlConnection.getOutputStream());
    }
View Full Code Here

TOP

Related Classes of de.fhkn.in.uce.mediator.peerregistry.UserData

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.