Examples of RegistrationException


Examples of net.solosky.maplefetion.client.RegistrationException

      Element event = XMLHelper.find(root, "/events/event");
      String eventType = event.getAttributeValue("type");
     
      //用户在其他地方登陆
      if(eventType!=null && eventType.equals("deregistered")) {
        this.context.handleException(new RegistrationException(RegistrationException.DEREGISTERED));
      }else if(eventType.equals("disconnect")){
        this.context.handleException(new RegistrationException(RegistrationException.DISCONNECTED));
      }else{
        logger.warn("Unknown registration event type:"+eventType);
      }
    }
View Full Code Here

Examples of net.solosky.maplefetion.client.RegistrationException

      //根据不同的异常类型,来设置客户端的状态
      if(exception instanceof TransferException) {        //网络错误
        logger.fatal("Connection error. Please try to login again after several time.");
        this.state = ClientState.CONNECTION_ERROR;
      }else if(exception instanceof RegistrationException) {  //注册异常
        RegistrationException re = (RegistrationException) exception;
        if(re.getRegistrationType()==RegistrationException.DEREGISTERED) {
          logger.fatal("You have logined by other client.");
          this.state = ClientState.OTHER_LOGIN;    //用户其他地方登陆
        }else if(re.getRegistrationType()==RegistrationException.DISCONNECTED) {
          logger.fatal("Server has closed connection. Please try to login again after several time.");
          this.state = ClientState.DISCONNECTED;    //服务器关闭了连接
        }else {
          logger.fatal("Unknown registration exception", exception);
        }
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.RegistrationException

        throws RegistrationException, CreateException, RemoteException
    {
        IPersonHome home;

        if (password == null || password.trim().length() == 0)
            throw new RegistrationException("Must specify a password.");

        validateUniquePerson(firstName, lastName, email);

        home = getPersonHome();
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.RegistrationException

            statement = assembly.createStatement(connection);
            set = statement.executeQuery();

            if (set.next())
                throw new RegistrationException("Email address is already in use by another user.");

            close(null, statement, set);

            assembly = new StatementAssembly();
            assembly.newLine("SELECT PERSON_ID");
            assembly.newLine("FROM PERSON");
            assembly.newLine("WHERE ");

            assembly.add("LOWER(FIRST_NAME) = ");
            assembly.addParameter(trimmedFirstName);
            assembly.addSep(" AND ");
            assembly.add("LOWER(LAST_NAME) = ");
            assembly.addParameter(trimmedLastName);

            statement = assembly.createStatement(connection);
            set = statement.executeQuery();

            if (set.next())
                throw new RegistrationException("Name provided is already in use by another user.");

        }
        catch (SQLException e)
        {
            throw new RegistrationException("Could not access database: " + e.getMessage(), e);
        }
        finally
        {
            close(connection, statement, set);
        }
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.RegistrationException

        throws RegistrationException, CreateException, RemoteException
    {
        IPersonHome home;

        if (password == null || password.trim().length() == 0)
            throw new RegistrationException("Must specify a password.");

        validateUniquePerson(firstName, lastName, email);

        home = getPersonHome();
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.RegistrationException

            statement = assembly.createStatement(connection);
            set = statement.executeQuery();

            if (set.next())
                throw new RegistrationException("Email address is already in use by another user.");

            close(null, statement, set);

            assembly = new StatementAssembly();
            assembly.newLine("SELECT PERSON_ID");
            assembly.newLine("FROM PERSON");
            assembly.newLine("WHERE ");

            assembly.add("LOWER(FIRST_NAME) = ");
            assembly.addParameter(trimmedFirstName);
            assembly.addSep(" AND ");
            assembly.add("LOWER(LAST_NAME) = ");
            assembly.addParameter(trimmedLastName);

            statement = assembly.createStatement(connection);
            set = statement.executeQuery();

            if (set.next())
                throw new RegistrationException("Name provided is already in use by another user.");

        }
        catch (SQLException e)
        {
            throw new RegistrationException("Could not access database: " + e.getMessage(), e);
        }
        finally
        {
            close(connection, statement, set);
        }
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.RegistrationException

        throws RegistrationException, CreateException, RemoteException
    {
        IPersonHome home;

        if (password == null || password.trim().length() == 0)
            throw new RegistrationException("Must specify a password.");

        validateUniquePerson(firstName, lastName, email);

        home = getPersonHome();
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.RegistrationException

            statement = assembly.createStatement(connection);
            set = statement.executeQuery();

            if (set.next())
                throw new RegistrationException("Email address is already in use by another user.");

            close(null, statement, set);

            assembly = new StatementAssembly();
            assembly.newLine("SELECT PERSON_ID");
            assembly.newLine("FROM PERSON");
            assembly.newLine("WHERE ");

            assembly.add("LOWER(FIRST_NAME) = ");
            assembly.addParameter(trimmedFirstName);
            assembly.addSep(" AND ");
            assembly.add("LOWER(LAST_NAME) = ");
            assembly.addParameter(trimmedLastName);

            statement = assembly.createStatement(connection);
            set = statement.executeQuery();

            if (set.next())
                throw new RegistrationException("Name provided is already in use by another user.");

        }
        catch (SQLException e)
        {
            throw new RegistrationException("Could not access database: " + e.getMessage(), e);
        }
        finally
        {
            close(connection, statement, set);
        }
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.RegistrationException

            throws RegistrationException, CreateException, RemoteException
    {
        IPersonHome home;

        if (password == null || password.trim().length() == 0)
            throw new RegistrationException("Must specify a password.");

        validateUniquePerson(firstName, lastName, email);

        home = getPersonHome();
View Full Code Here

Examples of org.apache.tapestry.vlib.ejb.RegistrationException

            statement = assembly.createStatement(connection);
            set = statement.executeQuery();

            if (set.next())
                throw new RegistrationException("Email address is already in use by another user.");

            close(null, statement, set);

            assembly = new StatementAssembly();
            assembly.newLine("SELECT PERSON_ID");
            assembly.newLine("FROM PERSON");
            assembly.newLine("WHERE ");

            assembly.add("LOWER(FIRST_NAME) = ");
            assembly.addParameter(trimmedFirstName);
            assembly.addSep(" AND ");
            assembly.add("LOWER(LAST_NAME) = ");
            assembly.addParameter(trimmedLastName);

            statement = assembly.createStatement(connection);
            set = statement.executeQuery();

            if (set.next())
                throw new RegistrationException("Name provided is already in use by another user.");

        }
        catch (SQLException e)
        {
            throw new RegistrationException("Could not access database: " + e.getMessage(), e);
        }
        finally
        {
            close(connection, statement, set);
        }
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.