Examples of LoginFailedException


Examples of com.art.anette.exceptions.LoginFailedException

            if (t instanceof LoginFailedException) {
                throw (LoginFailedException) t;
            } else if (t instanceof DBDirtyException) {
                throw (DBDirtyException) t;
            } else {
                throw new LoginFailedException("Login response undefined!");
            }
        } else if (response instanceof DataResponse) {
            DataResponse dataResponse = (DataResponse) response;
            if (dataResponse.getObjects().size() != 1) {
                fireEvent(NetworkEvent.NEType.loginError);
                throw new LoginFailedException("Login response undefined!");
            }
            Object obj = dataResponse.getObjects().get(0);
            if (!(obj instanceof Employee)) {
                fireEvent(NetworkEvent.NEType.loginError);
                throw new LoginFailedException("Login response undefined!");
            }
            Employee employee = (Employee) obj;

            {
                final List<ClientLogRecord> list = SerializingReportHandler.getInstance().read();
                for (ClientLogRecord clientLogRecord : list) {
                    final Response o1 = synchroneousRequest(clientLogRecord);
                    if (!(o1 instanceof VoidResponse)) {
                        fireEvent(NetworkEvent.NEType.loginError);
                        throw new LoginFailedException("Problem sending exception to the server.");
                    }
                }
                SerializingReportHandler.getInstance().clear();
                if (!list.isEmpty()) {
                    logger.info(String.format("Sent %d exceptions to the server.", list.size()));
                }
            }
            setStreams();

            fireEvent(NetworkEvent.NEType.loggedIn, employee.getEmail());
            return employee;

        } else {
            fireEvent(NetworkEvent.NEType.loginError);
            throw new LoginFailedException("Login response undefined!");
        }
    }
View Full Code Here

Examples of com.art.anette.exceptions.LoginFailedException

                Employee e = new Employee(null, rs);
                rs.close();
                return e;
            } else {
                rs.close();
                throw new LoginFailedException("Incorrect login or password!");
            }

        } catch (SQLException ex) {
            logger.severe(null, ex);
            //noinspection ThrowInsideCatchBlockWhichIgnoresCaughtException
            throw new LoginFailedException("Error while checking logindata!");
        }
    }
View Full Code Here

Examples of com.art.anette.exceptions.LoginFailedException

                " tries to login; client version " + loginRequest.clientVersion);
        try {
            employee = LowLevelLogic.getInstance().login(loginRequest);
            if (employee.isDisabled()) {
                logger.info("User " + employee.getName() + " tried to login but is disabled");
                throw new LoginFailedException("Your account is disabled");
            }
            if (SDBCPool.getInstance().isOnline(employee.getId())) {
                ClientThread other = NetworkControl.getInstance().findClientByEmployee(employee);
                logger.info("There is another connection from " + other.socket.getInetAddress().getHostName());
                boolean alive = other.ping();
                if (alive) {
                    throw new LoginFailedException("Already logged in!");
                } else {
                    logger.info("The other connection is dead so let's continue.");
                }
                if (SDBCPool.getInstance().isOnline(employee.getId())) {
                    logger.severe("The other connection is still in the books.");
                    throw new LoginFailedException("Already logged in!");
                }
            }
            logger.info(loginRequest.email + " logged in.");
            sdbc = new ServerDBControl(employee, this, id);
        } catch (LoginFailedException lfe) {
View Full Code Here

Examples of com.heroku.api.exception.LoginFailedException

    @Override
    public LoginVerification getResponse(byte[] in, int code) {
        if (code == 200) {
            return Json.parse(in, this.getClass());
        } else if (code == 404) {
            throw new LoginFailedException("Invalid username and password combination.", code, in);
        } else {
            throw new RequestFailedException("Unknown error occurred while connecting to Heroku.", code, in);
        }
    }
View Full Code Here

Examples of org.subethamail.smtp.auth.LoginFailedException

  {
    public void login(String username, String password) throws LoginFailedException
    {
      if (!username.equals(REQUIRED_USERNAME) || !password.equals(REQUIRED_PASSWORD))
      {
        throw new LoginFailedException();
      }
    }
View Full Code Here

Examples of org.subethamail.smtp.auth.LoginFailedException

            UsernamePasswordValidator validator = new UsernamePasswordValidator() {

                public void login(String username, String password) throws LoginFailedException {
                    boolean loginOk = doLogin(username, password);
                    if (!loginOk) {
                        throw new LoginFailedException("authentication failed");
                    }

                }
            };
            ret.addPlugin(new PlainAuthenticationHandler(validator));
View Full Code Here

Examples of org.subethamail.smtp.auth.LoginFailedException

        case VALID:
            logger.debug("{} logged in", username);
            return;
        case PASSWORD_DOES_NOT_MATCH:
            logger.debug("Password doesn't match for username {}", username);
            throw new LoginFailedException(
                    "Password doesn't match for username " + username);
        case USERNAME_NOT_EXISTS:
            logger.debug("Username {} doesn't exist", username);
            throw new LoginFailedException("Username " + username
                    + " doesn't exist");
        case INVALID:
            logger.debug("User {} - password pair is not valid", username);
            throw new LoginFailedException("No user with name " + username
                    + " and supplied password was found");
        }
    }
View Full Code Here

Examples of org.subethamail.smtp.auth.LoginFailedException

      PluginAuthenticationHandler ret = new PluginAuthenticationHandler();
      UsernamePasswordValidator validator = new UsernamePasswordValidator() {
        public void login(String username, String password)
                throws LoginFailedException {
          if (!username.equals(password)) {
            throw new LoginFailedException("username=" + username + ", password=" + password);
          }
        }
      };
      ret.addPlugin(new PlainAuthenticationHandler(validator));
      ret.addPlugin(new LoginAuthenticationHandler(validator));
View Full Code Here

Examples of org.subethamail.smtp.auth.LoginFailedException

      protected SMTPServer createServer(MessageHandlerFactory mhf) {
        SMTPServer smtpServer = super.createServer(mhf);
        smtpServer.setAuthenticationHandlerFactory(new LoginAuthenticationHandlerFactory(new UsernamePasswordValidator() {
          public void login(String username, String password) throws LoginFailedException {
            done.set(true);
            throw new LoginFailedException();
          }
        }));
        return smtpServer;
      }
      @Override
View Full Code Here

Examples of org.subethamail.smtp.auth.LoginFailedException

  {
    public void login(String username, String password) throws LoginFailedException
    {
      if (!username.equals(REQUIRED_USERNAME) || !password.equals(REQUIRED_PASSWORD))
      {
        throw new LoginFailedException();
      }
    }
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.