Package com.google.code.lightssh.common

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


  }
 
  public LoginAccountChange save(LoginAccount user,EntityChange.Type type
      ,LoginAccount originalAcc,LoginAccount newAcc,String remark){
    if( originalAcc == null && newAcc == null )
      throw new ApplicationException("原始登录帐户或新登录帐户为空!");
   
    LoginAccountChange ec = new LoginAccountChange();
    ec.setStatus(EntityChange.Status.NEW);
    ec.setOperator(user);
    ec.setType(type);
View Full Code Here


   */
  public void save( String procInstId,String taskInstId
      ,ExecutionType type,String operator,String message,Calendar time ){
   
    if( StringUtils.isEmpty(procInstId) )
      throw new ApplicationException("流程实例Id不能为空!");
   
    if( StringUtils.isEmpty(taskInstId) )
      throw new ApplicationException("流程任务Id不能为空!");
   
    if( type == null )
      throw new ApplicationException("流程操作类型不能为空!");
   
    if( StringUtils.isEmpty(operator) )
      throw new ApplicationException("操作员不能为空!");
   
    TaskLog log = new TaskLog();
    log.setActProcInstId(procInstId);
    log.setActTaskInstId(taskInstId);
    log.setType(type);
View Full Code Here

    Map<String,JobQueue> mapQueue = new HashMap<String,JobQueue>();
    String planId = null;
    for( JobQueue item:items ){
      PlanDetail detail = planManager.getDetail(item.getRefId());
      if( detail == null )
        throw new ApplicationException("任务队列["
            +getJobTypeKey()+"]关联["+item.getRefId()+"]业务数据不存在!");
     
      planId = detail.getPlan()==null?null:detail.getPlan().getId();
      details.add( detail );
      mapQueue.put(item.getRefId(), item);
View Full Code Here

    this.dao = dao;
  }
 
  public Sequence nextSequence(String key,int step ){
    if( key == null )
      throw new ApplicationException("获取序列的参数KEY为空!");
   
    boolean inserted = false;
    Sequence seq = dao.read( key );
    if( seq == null ){
      seq = new Sequence( key );
View Full Code Here

  }

  @Override
  public Sequence nextSequence(Sequenceable sa) {
    if( sa == null )
      throw new ApplicationException("获取序列的参数为空!");
   
    return nextSequence( sa.getSequenceKey(),sa.getSequenceStep() );
  }
View Full Code Here

  }
 
  public String nextSerialNumber(Sequenceable sa) {
    Sequence seq = nextSequence( sa );
    if( seq == null )
      throw new ApplicationException("获取得的序列为空!");
   
    return seq.getFormatLastNumber( sa.getSequenceLength() );
  }
View Full Code Here

   
    MessageDigest digest = null;
    try{
      digest = MessageDigest.getInstance( algorithm );
    }catch( NoSuchAlgorithmException e ){
      throw new ApplicationException( e );
    }
   
    return Hex.encodeHexString( digest.digest( val.getBytes() ));
  }
View Full Code Here

   
    MessageDigest digest = null;
    try{
      digest = MessageDigest.getInstance( algorithm );
    }catch( NoSuchAlgorithmException e ){
      throw new ApplicationException( e );
    }
   
    return Base64.encodeBase64String( digest.digest( val.getBytes() ));
  }
View Full Code Here

  /**
   * 保存人事信息
   */
  public void save(Employee t){
    if( t.getPerson() == null || t.getPerson().getId() == null )
      throw new ApplicationException("人员信息为空!");
   
    Person p = partyManager.getPerson( t.getPerson() );
    if( p == null )
      throw new ApplicationException("人员信息["+t.getPerson().getId()+"]不存在!");
   
    if( t.getOrganization() == null || StringUtils.isEmpty(t.getOrganization().getId()))
      throw new ApplicationException("部门信息为空!");
   
    Organization org = partyManager.getOrganization(t.getOrganization().getId());
    if( org == null )
      throw new ApplicationException("部门信息["+t.getOrganization().getId()+"]不存在!");
   
    Employee db_e = get(p);
    if( db_e == null ){
      db_e = t;
      dao.create(db_e);
View Full Code Here

  }
 
  public boolean isUniqueProperty(T t){
    String[] properties = getUniqueProperty(t);
    if( properties == null )
      throw new ApplicationException("未通过JPA Annotation定义实体("
          +t.getClass().getName()+")唯一属性!");
   
    for( String item:properties)
      if( !isUniqueProperty(item, t) )
        return false;
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.