Examples of LoginAction


Examples of org.asteriskjava.manager.action.LoginAction

    {
        ChallengeAction challengeAction;
        ManagerResponse challengeResponse;
        String challenge;
        String key;
        LoginAction loginAction;
        ManagerResponse loginResponse;

        if (socket == null)
        {
            connect();
        }

        synchronized (protocolIdentifier)
        {
            if (protocolIdentifier.value == null)
            {
                try
                {
                    protocolIdentifier.wait(timeout);
                }
                catch (InterruptedException e) // NOPMD
                {
                    Thread.currentThread().interrupt();
                }
            }

            if (protocolIdentifier.value == null)
            {
                disconnect();
                if (reader != null && reader.getTerminationException() != null)
                {
                    throw reader.getTerminationException();
                }
                else
                {
                    throw new TimeoutException("Timeout waiting for protocol identifier");
                }
            }
        }

        challengeAction = new ChallengeAction("MD5");
        try
        {
            challengeResponse = sendAction(challengeAction);
        }
        catch (Exception e)
        {
            disconnect();
            throw new AuthenticationFailedException("Unable to send challenge action", e);
        }

        if (challengeResponse instanceof ChallengeResponse)
        {
            challenge = ((ChallengeResponse) challengeResponse).getChallenge();
        }
        else
        {
            disconnect();
            throw new AuthenticationFailedException("Unable to get challenge from Asterisk. ChallengeAction returned: "
                    + challengeResponse.getMessage());
        }

        try
        {
            MessageDigest md;

            md = MessageDigest.getInstance("MD5");
            if (challenge != null)
            {
                md.update(challenge.getBytes());
            }
            if (password != null)
            {
                md.update(password.getBytes());
            }
            key = ManagerUtil.toHexString(md.digest());
        }
        catch (NoSuchAlgorithmException ex)
        {
            disconnect();
            throw new AuthenticationFailedException("Unable to create login key using MD5 Message Digest", ex);
        }

        loginAction = new LoginAction(username, "MD5", key, eventMask);
        try
        {
            loginResponse = sendAction(loginAction);
        }
        catch (Exception e)
View Full Code Here

Examples of org.asteriskjava.manager.action.LoginAction

    {
        ChallengeAction challengeAction;
        ManagerResponse challengeResponse;
        String challenge;
        String key;
        LoginAction loginAction;
        ManagerResponse loginResponse;

        if (socket == null)
        {
            connect();
        }

        synchronized (protocolIdentifier)
        {
            if (protocolIdentifier.value == null)
            {
                try
                {
                    protocolIdentifier.wait(timeout);
                }
                catch (InterruptedException e) // NOPMD
                {
                    Thread.currentThread().interrupt();
                }
            }

            if (protocolIdentifier.value == null)
            {
                disconnect();
                if (reader != null && reader.getTerminationException() != null)
                {
                    throw reader.getTerminationException();
                }
                else
                {
                    throw new TimeoutException("Timeout waiting for protocol identifier");
                }
            }
        }

        challengeAction = new ChallengeAction("MD5");
        try
        {
            challengeResponse = sendAction(challengeAction);
        }
        catch (Exception e)
        {
            disconnect();
            throw new AuthenticationFailedException("Unable to send challenge action", e);
        }

        if (challengeResponse instanceof ChallengeResponse)
        {
            challenge = ((ChallengeResponse) challengeResponse).getChallenge();
        }
        else
        {
            disconnect();
            throw new AuthenticationFailedException("Unable to get challenge from Asterisk. ChallengeAction returned: "
                    + challengeResponse.getMessage());
        }

        try
        {
            MessageDigest md;

            md = MessageDigest.getInstance("MD5");
            if (challenge != null)
            {
                md.update(challenge.getBytes());
            }
            if (password != null)
            {
                md.update(password.getBytes());
            }
            key = ManagerUtil.toHexString(md.digest());
        }
        catch (NoSuchAlgorithmException ex)
        {
            disconnect();
            throw new AuthenticationFailedException("Unable to create login key using MD5 Message Digest", ex);
        }

        loginAction = new LoginAction(username, "MD5", key, eventMask);
        try
        {
            loginResponse = sendAction(loginAction);
        }
        catch (Exception e)
View Full Code Here

Examples of org.cspoker.common.api.shared.socket.LoginAction

      throws RemoteException, LoginException {
    XmlActionSerializer serializer = createXmlActionSerializer(username,password);
    XmlServerListenerTree listenerTree = new XmlServerListenerTree();
    CallSynchronizer callSynchronizer = new CallSynchronizer(listenerTree,serializer);
    try {
      callSynchronizer.perform(new LoginAction(new EventId(), username, password));
    } catch (IllegalActionException exception) {
      throw new LoginException(exception.getMessage());
    }
    return new XmlRemoteServerContext(callSynchronizer,listenerTree);
  }
View Full Code Here

Examples of org.xadoop.servlet.actions.LoginAction

    // upload path
    context.setAttribute(XadoopConstants.CTX_PATHUPLOADDIR, pathUploadDir);

    // action map
    HashMap<String, AbstractAction> actionMap = new HashMap<String, AbstractAction>();
    actionMap.put(LoginAction.ACTIONNAME, new LoginAction());
    actionMap.put(LogoutAction.ACTIONNAME, new LogoutAction());
    actionMap.put(XQueryMRAction.ACTIONNAME, new XQueryMRAction());
    context.setAttribute(XadoopConstants.CTX_ACTIONMAP, actionMap);

    // page map
View Full Code Here

Examples of voxo.client.actions.LoginAction

    MainView view = (MainView) j;
    String username = view.getUsernameField().getText();
    char[] pwdArray = view.getPasswordField().getPassword();
    String pwd = new String(pwdArray);
    // this.p = new LoginPacket();
    new LoginAction(c, new LoginPacket(username, pwd));
  }
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.