Examples of LoginFailureException


Examples of ar.com.AmberSoft.iEvenTask.shared.exceptions.LoginFailureException

     
      map.put(ParamsConst.USER, user);
     
    } catch (Exception e) {
      logger.error(Tools.getStackTrace(e));
      throw new LoginFailureException();
    }

    return map; 
  }
View Full Code Here

Examples of com.sun.sgs.protocol.LoginFailureException

  } catch (Exception e) {
      logger.logThrow(
          Level.WARNING, e,
    "getting node assignment for identity:{0} throws", identity);
      sendLoginFailureAndDisconnect(
    new LoginFailureException(LOGIN_REFUSED_REASON, e));
      return;
  }

  long assignedNodeId = node.getId();
  if (assignedNodeId == sessionService.getLocalNodeId()) {
      /*
       * Handle this login request locally: Validate that the
       * user is allowed to log in, store the client session in
       * the data store (which assigns it an ID--the ID of the
       * reference to the client session object), inform the
       * session service that this handler is available (by
       * invoking "addHandler"), and schedule a task to perform
       * client login (call the AppListener.loggedIn method).
       */
      if (!sessionService.validateUserLogin(
        identity, ClientSessionHandler.this))
      {
    // This login request is not allowed to proceed.
    sendLoginFailureAndDisconnect(
        new LoginFailureException(
      LOGIN_REFUSED_REASON, FailureReason.DUPLICATE_LOGIN));
    return;
      }
      taskQueue = sessionService.createTaskQueue();
      CreateClientSessionTask createTask =
    new CreateClientSessionTask();
      try {
    sessionService.runTransactionalTask(createTask, identity);
      } catch (Exception e) {
    logger.logThrow(
        Level.WARNING, e,
        "Storing ClientSession for identity:{0} throws", identity);
    sendLoginFailureAndDisconnect(
        new LoginFailureException(LOGIN_REFUSED_REASON, e));
    return;
      }
      sessionService.addHandler(
    sessionRefId, ClientSessionHandler.this);
      scheduleTask(new LoginTask());
     
  } else {
      /*
       * Redirect login to assigned (non-local) node.
       */
      if (logger.isLoggable(Level.FINE)) {
    logger.log(
        Level.FINE,
        "redirecting login for identity:{0} " +
        "from nodeId:{1} to node:{2}",
        identity, sessionService.getLocalNodeId(), node);
      }
     
      scheduleNonTransactionalTask(
          new AbstractKernelRunnable("SendLoginRedirectMessage") {
        public void run() {
      try {
                            try {
                                loginRedirect(node);
                            } catch (Exception ex) {
                                loginFailure(
                                    new LoginFailureException("Redirect failed",
                                                              ex));
                            }
                        } finally {
                            handleDisconnect(false, false);
                        }
View Full Code Here

Examples of com.sun.sgs.protocol.LoginFailureException

          // the time of notification.
          identity.notifyLoggedIn();
      } });
   
      } else {
    LoginFailureException loginFailureEx;
    if (ex == null) {
        logger.log(
            Level.WARNING,
      "AppListener.loggedIn returned non-serializable " +
      "ClientSessionListener:{0}", returnedListener);
        loginFailureEx = new LoginFailureException(
      LOGIN_REFUSED_REASON, FailureReason.REJECTED_LOGIN);
    } else if (!isRetryableException(ex)) {
        logger.logThrow(
      Level.WARNING, ex,
      "Invoking loggedIn on AppListener:{0} with " +
      "session: {1} throws",
      appListener, ClientSessionHandler.this);
        loginFailureEx =
      new LoginFailureException(LOGIN_REFUSED_REASON, ex);
    } else {
        throw ex;
    }
    sessionService.addLoginResult(
        sessionImpl, false, loginFailureEx);
View Full Code Here

Examples of com.sun.sgs.protocol.LoginFailureException

      logger.log(Level.WARNING,
           "getting node assignment for identity:{0} failed",
                       identity);
      notifySetupFailureAndDisconnect(
    loggingIn ?
    new LoginFailureException(
        LOGIN_REFUSED_REASON,
        LoginFailureException.FailureReason.SERVER_UNAVAILABLE) :
    new RelocateFailureException(
        RELOCATE_REFUSED_REASON,
        RelocateFailureException.FailureReason.SERVER_UNAVAILABLE));
      return;
        }

  if (logger.isLoggable(Level.FINE)) {
            logger.log(Level.FINE, "identity:{0} assigned to node:{1}",
           identity, assignedNodeId);
  }

  if (assignedNodeId == sessionService.getLocalNodeId()) {
      /*
       * Handle this login (or relocation) request locally.  First,
       * validate that the user is allowed to log in (or relocate).
       */
      if (!sessionService.validateUserLogin(
        identity, ClientSessionHandler.this, loggingIn))
      {
    // This client session is not allowed to proceed.
    if (logger.isLoggable(Level.FINE)) {
        logger.log(
      Level.FINE,
      "{0} rejected to node:{1} identity:{2}",
      (loggingIn ? "User login" : "Session relocation"),
      sessionService.getLocalNodeId(), identity);
    }
    notifySetupFailureAndDisconnect(
        loggingIn ?
        new LoginFailureException(
      LOGIN_REFUSED_REASON,
      LoginFailureException.FailureReason.DUPLICATE_LOGIN) :
        new RelocateFailureException(
       RELOCATE_REFUSED_REASON,
      RelocateFailureException.
          FailureReason.DUPLICATE_LOGIN));
    return;
      }
      taskQueue = sessionService.createTaskQueue();
      /*
       * If logging in, store the client session in the data store.
       */
      if (loggingIn) {
    CreateClientSessionTask createTask =
        new CreateClientSessionTask();
    try {
        sessionService.runTransactionalTask(createTask, identity);
    } catch (Exception e) {
        logger.logThrow(
            Level.WARNING, e,
      "Storing ClientSession for identity:{0} throws",
      identity);
        notifySetupFailureAndDisconnect(
      new LoginFailureException(LOGIN_REFUSED_REASON, e));
        return;
    }
    sessionRefId = createTask.getId();
      }

      /*
       * Inform the session service that this handler is available.  If
       * logging in, schedule a task to perform client login (which calls
       * the AppListener.loggedIn method), otherwise set the "relocating"
       * flag in the client session's state to false to indicate that
       * relocation is complete.
       */
      sessionService.addHandler(
    sessionRefId, ClientSessionHandler.this,
    loggingIn ? null : identity);
      if (loggingIn) {
    scheduleTask(new LoginTask());
      } else {
    try {
        sessionService.runTransactionalTask(
       new AbstractKernelRunnable("SetSessionRelocated") {
          public void run() {
        ClientSessionImpl sessionImpl =
            ClientSessionImpl.getSession(
                 dataService, sessionRefId);
        sessionImpl.relocationComplete();
          } }, identity);
        setupSuccess();
    } catch (Exception e) {
        logger.logThrow(
            Level.WARNING, e,
      "Relocating ClientSession for identity:{0} " +
      "to local node:{1} throws",
      identity, sessionService.getLocalNodeId());
        notifySetupFailureAndDisconnect(
      new RelocateFailureException(
          RELOCATE_REFUSED_REASON, e));
        return;
    }
      }
     
  } else {
      /*
       * Redirect login to assigned (non-local) node.
       */
      if (logger.isLoggable(Level.FINE)) {
    logger.log(
        Level.FINE,
        "redirecting login for identity:{0} " +
        "from nodeId:{1} to node:{2}",
        identity, sessionService.getLocalNodeId(), assignedNodeId);
      }

      final long nodeId = assignedNodeId;
      scheduleNonTransactionalTask(
          new AbstractKernelRunnable("SendLoginRedirectMessage") {
        public void run() {
      try {
                            try {
                                loginRedirect(nodeId);
                            } catch (Exception ex) {
                                setupFailure(
                                    new LoginFailureException("Redirect failed",
                                                              ex));
                            }
                        } finally {
                            handleDisconnect(false, false);
                        }
View Full Code Here

Examples of com.sun.sgs.protocol.LoginFailureException

          // the time of notification.
          identity.notifyLoggedIn();
      } });
   
      } else {
    LoginFailureException loginFailureEx;
    if (ex == null) {
        logger.log(
            Level.WARNING,
      "AppListener.loggedIn returned non-serializable " +
      "ClientSessionListener:{0}", returnedListener);
        loginFailureEx = new LoginFailureException(
      LOGIN_REFUSED_REASON,
      LoginFailureException.FailureReason.REJECTED_LOGIN);
    } else if (!isRetryableException(ex)) {
        logger.logThrow(
      Level.WARNING, ex,
      "Invoking loggedIn on AppListener:{0} with " +
      "session: {1} throws",
      appListener, ClientSessionHandler.this);
        loginFailureEx =
      new LoginFailureException(LOGIN_REFUSED_REASON, ex);
    } else {
        throw ex;
    }
    sessionService.checkContext().
        addCommitAction(
View Full Code Here

Examples of com.sun.sgs.protocol.LoginFailureException

      logger.log(Level.WARNING,
           "getting node assignment for identity:{0} failed",
                       identity);
      notifySetupFailureAndDisconnect(
    loggingIn ?
    new LoginFailureException(
        LOGIN_REFUSED_REASON,
        LoginFailureException.FailureReason.SERVER_UNAVAILABLE) :
    new RelocateFailureException(
        RELOCATE_REFUSED_REASON,
        RelocateFailureException.FailureReason.SERVER_UNAVAILABLE));
      return;
        }

  if (logger.isLoggable(Level.FINE)) {
            logger.log(Level.FINE, "identity:{0} assigned to node:{1}",
           identity, assignedNodeId);
  }

  if (assignedNodeId == sessionService.getLocalNodeId()) {
      /*
       * Handle this login (or relocation) request locally.  First,
       * validate that the user is allowed to log in (or relocate).
       */
      if (!sessionService.validateUserLogin(
        identity, ClientSessionHandler.this, loggingIn))
      {
    // This client session is not allowed to proceed.
    if (logger.isLoggable(Level.FINE)) {
        logger.log(
      Level.FINE,
      "{0} rejected to node:{1} identity:{2}",
      (loggingIn ? "User login" : "Session relocation"),
      sessionService.getLocalNodeId(), identity);
    }
    notifySetupFailureAndDisconnect(
        loggingIn ?
        new LoginFailureException(
      LOGIN_REFUSED_REASON,
      LoginFailureException.FailureReason.DUPLICATE_LOGIN) :
        new RelocateFailureException(
       RELOCATE_REFUSED_REASON,
      RelocateFailureException.
          FailureReason.DUPLICATE_LOGIN));
    return;
      }
      taskQueue = sessionService.createTaskQueue();
      /*
       * If logging in, store the client session in the data store.
       */
      if (loggingIn) {
    CreateClientSessionTask createTask =
        new CreateClientSessionTask();
    try {
        sessionService.runTransactionalTask(createTask, identity);
    } catch (Exception e) {
        logger.logThrow(
            Level.WARNING, e,
      "Storing ClientSession for identity:{0} throws",
      identity);
        notifySetupFailureAndDisconnect(
      new LoginFailureException(LOGIN_REFUSED_REASON, e));
        return;
    }
    sessionRefId = createTask.getId();
      }

      /*
       * Inform the session service that this handler is available.  If
       * logging in, schedule a task to perform client login (which calls
       * the AppListener.loggedIn method), otherwise set the "relocating"
       * flag in the client session's state to false to indicate that
       * relocation is complete.
       */
      sessionService.addHandler(
    sessionRefId, ClientSessionHandler.this,
    loggingIn ? null : identity);
      if (loggingIn) {
    scheduleTask(new LoginTask());
      } else {
    try {
        sessionService.runTransactionalTask(
       new AbstractKernelRunnable("SetSessionRelocated") {
          public void run() {
        ClientSessionImpl sessionImpl =
            ClientSessionImpl.getSession(
                 dataService, sessionRefId);
        sessionImpl.relocationComplete();
          } }, identity);
        setupSuccess();
    } catch (Exception e) {
        logger.logThrow(
            Level.WARNING, e,
      "Relocating ClientSession for identity:{0} " +
      "to local node:{1} throws",
      identity, sessionService.getLocalNodeId());
        notifySetupFailureAndDisconnect(
      new RelocateFailureException(
          RELOCATE_REFUSED_REASON, e));
        return;
    }
      }
     
  } else {
      /*
       * Redirect login to assigned (non-local) node.
       */
      if (logger.isLoggable(Level.FINE)) {
    logger.log(
        Level.FINE,
        "redirecting login for identity:{0} " +
        "from nodeId:{1} to node:{2}",
        identity, sessionService.getLocalNodeId(), assignedNodeId);
      }

      final long nodeId = assignedNodeId;
      scheduleNonTransactionalTask(
          new AbstractKernelRunnable("SendLoginRedirectMessage") {
        public void run() {
      try {
                            try {
                                loginRedirect(nodeId);
                            } catch (Exception ex) {
                                setupFailure(
                                    new LoginFailureException("Redirect failed",
                                                              ex));
                            }
                        } finally {
                            handleDisconnect(false, false);
                        }
View Full Code Here

Examples of com.sun.sgs.protocol.LoginFailureException

          // the time of notification.
          identity.notifyLoggedIn();
      } });
   
      } else {
    LoginFailureException loginFailureEx;
    if (ex == null) {
        logger.log(
            Level.WARNING,
      "AppListener.loggedIn returned non-serializable " +
      "ClientSessionListener:{0}", returnedListener);
        loginFailureEx = new LoginFailureException(
      LOGIN_REFUSED_REASON,
      LoginFailureException.FailureReason.REJECTED_LOGIN);
    } else if (!isRetryableException(ex)) {
        logger.logThrow(
      Level.WARNING, ex,
      "Invoking loggedIn on AppListener:{0} with " +
      "session: {1} throws",
      appListener, ClientSessionHandler.this);
        loginFailureEx =
      new LoginFailureException(LOGIN_REFUSED_REASON, ex);
    } else {
        throw ex;
    }
    sessionService.checkContext().
        addCommitAction(
View Full Code Here

Examples of org.jdesktop.wonderland.client.comms.LoginFailureException

                        AuthenticationManager.login(getAuthInfo(), username,
                                                    credentials);
                setAuthService(as);
                loginComplete(username, as.getAuthenticationToken());
            } catch (AuthenticationException ae) {
                throw new LoginFailureException(ae);
            }
        }
View Full Code Here

Examples of org.jdesktop.wonderland.client.comms.LoginFailureException

        // wait for the login to complete
        try {
            boolean result = control.waitForLogin();
            if (!result) {
                throw new LoginFailureException("Login cancelled");
            }
        } catch (InterruptedException ie) {
            throw new LoginFailureException(ie);
        }
    }
View Full Code Here

Examples of org.jdesktop.wonderland.client.comms.LoginFailureException

            } catch (ConnectionFailureException afe) {
                // a client failed to connect -- logout
                logout();

                // throw a login exception
                throw new LoginFailureException("Failed to attach client" , afe);
            }
        }
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.