Package com.google.code.lightssh.common

Examples of com.google.code.lightssh.common.ApplicationException


  }

  @Override
  public void saveNode(Tree tree,Node node) {
    if( node == null || tree == null )
      throw new ApplicationException("树和结点都不能为空!");
   
    Tree db_tree = this.get(tree);
    if( db_tree == null )
      throw new ApplicationException("树已不存在!");
   
    if(node.getParent()==null ||
        StringUtil.clean(node.getParent().getIdentity())==null ){
      node.setParent( db_tree.getRoot() );
    }else{
      Node parent = nodeDao.read(node.getParent());
      if( parent == null )
        throw new ApplicationException("父结点(id="
            +node.getParent().getIdentity()+")已不存在!");
    }
   
    if( node.isInsert() )
      nodeDao.create(node);
View Full Code Here


   
    return super.query(page, hql.toString(), params.toArray( ) );
  }
 
  public void updateRole( final LoginAccount account ){
    throw new ApplicationException("DAO未实现!");
  }
View Full Code Here

  /**
   * 审核
   */
  public void audit(LoginAccountAudit audit,LoginAccountChange change ){
    if( audit == null )
      throw new ApplicationException("参数为空!");
   
    if( change == null || StringUtils.isEmpty(change.getId()) )
      throw new ApplicationException("登录帐户变更信息为空!");
   
    LoginAccountChange dbChange = this.loginAccountChangeManager.get(change);
    if( dbChange == null )
      throw new ApplicationException("登录帐户变更信息["+change.getId()+"]不存在!");
   
    LoginAccount dbAcc = loginAccountManager.get(change.getLoginAccount());
    LoginAccount newAcc = null;
    byte[] newObject = dbChange.getNewObject();
    if( newObject != null )
      newAcc = (LoginAccount)IoSerialUtil.deserialize(newObject);
    if( newObject == null || newAcc == null )
      throw new ApplicationException("数据异常,变更登录帐户信息为空!");
   
    boolean passed = AuditResult.LAST_AUDIT_PASSED.equals(audit.getResult());
    if( passed && EntityChange.Type.DELETE.equals(dbChange.getType()) ){//删除
      dbAcc.setStatus( AuditStatus.DELETE );
    }else if( passed && AuditStatus.EFFECTIVE.equals(newAcc.getStatus())){
View Full Code Here

  }

  public void log(Access access, Persistence<?> originalModel,
      Persistence<?> newModel) {
    if( access == null )
      throw new ApplicationException("access is null!");
   
    if( originalModel != null && newModel != null ){
      access.setType( AccessType.UPDATE );
    }else if( originalModel == null && newModel == null ){
      throw new ApplicationException("original model and new model is null!");
    }else if( originalModel == null ){
      access.setType( AccessType.CREATE );
    }else{
      access.setType( AccessType.DELETE );
    }
View Full Code Here

  }

  @Override
  public void save(Role role,Collection<Navigation> colls,LoginAccount user) {
    if( role == null )
      throw new ApplicationException("参数为空!");
   
    Role db_role = get(role);
    Role originalRole = null,newRole = role;
    if( db_role == null ){
      db_role = role;
View Full Code Here

  }
 
  public void remove(Role role,LoginAccount operator,String remark) {
    Role dbRole = dao.read(role.getId());
    if( dbRole == null )
      throw new ApplicationException("角色不存在!");
   
    if( remark == null )
      remark = "删除角色";
    Role newRole = dbRole.clone();
    newRole.setStatus(AuditStatus.DELETE);
View Full Code Here

  /**
   * 审核
   */
  public void audit(RoleAudit ra,RoleChange roleChange ){
    if( ra == null )
      throw new ApplicationException("参数为空!");
   
    if( roleChange == null || StringUtils.isEmpty(roleChange.getId()) )
      throw new ApplicationException("角色变更信息为空!");
   
    RoleChange rc = this.roleChangeManager.get(roleChange);
    if( rc == null )
      throw new ApplicationException("角色变更信息["+roleChange.getId()+"]不存在!");
   
    Role db_role = roleManager.get(roleChange.getRole());
    Role newRole = null;
    byte[] newObject = rc.getNewObject();
    if( newObject != null )
      newRole = (Role)IoSerialUtil.deserialize(newObject);
    if( newObject == null || newRole == null )
      throw new ApplicationException("数据异常,变更角色信息为空!");
   
    boolean passed = AuditResult.LAST_AUDIT_PASSED.equals(ra.getResult());
    if( passed && EntityChange.Type.DELETE.equals(rc.getType()) ){//删除
      db_role.setStatus( AuditStatus.DELETE );
    }else if( passed && AuditStatus.EFFECTIVE.equals(newRole.getStatus())){
View Full Code Here

    return exists == null || exists.getIdentity().equals(param.getIdentity() );
  }
 
  public void save( Subscription t ){
    if(t == null )
      throw new ApplicationException("参数为空!");
   
    if( ReceiveType.ALL.equals(t.getRecType()) )
      t.setRecValue( ReceiveType.ALL.name() );
   
    Subscription db = dao.read(t);
View Full Code Here

  }
 
  public RoleChange save(LoginAccount user,EntityChange.Type type
      ,Role originalRole,Role newRole,String remark){
    if( originalRole == null && newRole == null )
      throw new ApplicationException("原始角色或新角色为空!");
   
    RoleChange rc = new RoleChange();
    rc.setStatus(EntityChange.Status.NEW);
    rc.setOperator(user);
    rc.setType(type);
View Full Code Here

   
    try{
      results = doBusiness(items);//业务处理

      if( results == null )
        throw new ApplicationException("返回结果为空!");
      //Map<String,JobQueue> map = new HashMap<String,JobQueue>();
     
      for(Result result:results ){
        JobQueue item = (JobQueue)result.getObject();
        if( item == null ){//TODO
          throw new ApplicationException("返回结果Result[key="
              +result.getKey()+"]关联Object为空!");
        }
       
        if( !result.isSuccess() && item != null ){
          item.incFailureCount();
View Full Code Here

TOP

Related Classes of com.google.code.lightssh.common.ApplicationException

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.