Package com.google.code.lightssh.common

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


    }else{
      type = schedulerTypeManager.get(jobType);
    }
   
    if( type == null )
      throw new ApplicationException("工作任务类型["+jobType+"]不存在!");
   
    List<JobQueue> queues = new ArrayList<JobQueue>();
    for(String refId:refIds ){
      JobQueue exists = getDao().get(jobType,refId);
      if( exists != null ){
View Full Code Here


   * 更新明细状态
   */
  public void updateDetailStatus(String detailId,Status status ){
    PlanDetail detail = getDetail(detailId);
    if( detail == null )
      throw new ApplicationException("执行计划明细["+detailId+"]对应数据不存在!");
   
    detail.setStatus(status);
   
    this.planDetailDao.update(detail);
  }
View Full Code Here

   * 更新明细状态
   */
  public void updateDetailStatus(String detailId,boolean success,String errMsg){
    PlanDetail detail = getDetailWithLock(detailId);
    if( detail == null )
      throw new ApplicationException("执行计划明细["+detailId+"]对应数据不存在!");
   
    PlanDetail.Status oldStatus = detail.getStatus();
    if( PlanDetail.Status.WAITING_FOR_REPLY.equals(detail.getStatus())
        || PlanDetail.Status.NEW.equals(detail.getStatus())
        || PlanDetail.Status.FAILURE.equals(detail.getStatus())
View Full Code Here

  /**
   * 保存执行计划
   */
  public void save( Plan plan,List<PlanDetail> details,boolean putAllInQueue ){
    if( plan == null || details == null )
      throw new ApplicationException("参数为空!");
   
    plan.setId( sequenceManager.nextSequenceNumber(plan)
        .replaceFirst(Plan.SEQUENCE_KEY,"") );
    dao.create(plan);
   
View Full Code Here

   * 明细入任务队列
   */
  public void detailInQueue(PlanDetail pd){
    PlanDetail detail = this.getDetail( pd.getId() );
    if( detail == null )
      throw new ApplicationException("明细数据["+pd.getId()+"]不存在!");
   
    if( detail.getPlan() == null || detail.getPlan().getType() == null )
      throw new ApplicationException("明细数据["+pd.getId()+"]不完整!");
   
    jobQueueManager.jobInQueue(
        detail.getPlan().getType().getId(),detail.getId(),1,detail.getPlan().getPlanFireTime());
  }
View Full Code Here

   */
  public AuthorizedTicket authTicket(String url,String licensor,String token
      ,AuthorizedTicket.Scope scope,String sessinid
      ,String grantor,Long maxCount,Calendar validTime){
    if( StringUtils.isEmpty(url) )
      throw new ApplicationException("授权URL为空!");
   
    if( StringUtils.isEmpty(licensor) || StringUtils.isEmpty(token)
        || StringUtils.isEmpty(grantor) || StringUtils.isEmpty(sessinid) )
      throw new ApplicationException("授权参数错误!");
   
    if( scope == null )
      scope = AuthorizedTicket.Scope.ONCE;
   
    AuthorizedTicket ticket = new AuthorizedTicket();
View Full Code Here

    return (MessageDao)this.dao;
  }
 
  public void save( Message t ){
    if( t == null )
      throw new ApplicationException("参数为空!");
   
    Catalog catalog = catalogManager.getDefaultInfo();
    if( catalog == null )
      throw new ApplicationException("默认信息分类未初始化!");
   
    ifReceiveType.ALL.equals(t.getRecType()) ){
      t.setRecValue( ReceiveType.ALL.name() );
      t.setForward( false ); //所有人接收的消息不能转发
    }else{
View Full Code Here

      count = getDao().update("id",msgId,"status"
          ,Message.Status.PUBLISH,Message.Status.DRAFT);
    }
   
    if( count <= 0 )
      throw new ApplicationException("消息更新或删除不成功!");
   
    log.debug("消息[{}][{}],删除发布条数[{}]!",new Object[]{
        flag?"删除":"撤消",count>0?"成功":"失败",pCount});
   
    return count > 0;
View Full Code Here

  @Resource(name="publishDao")
  private PublishDao publishDao;
 
  public void save( Message t ){
    if( t == null )
      throw new ApplicationException("参数为空!");
   
    if( t.isInsert() )
      this.create(t);
    else
      this.update(t);
View Full Code Here

        save(root);
        log.info("成功初始化系统管理员[{}]!",ROOT_LOGIN_NAME);
      }catch( Exception e ){
        String msg = "初始化系统账户异常:"+e.getMessage();
        log.error( msg );
        throw new ApplicationException( msg );
      }
    }
  }
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.