Package net.solosky.maplefetion.bean

Examples of net.solosky.maplefetion.bean.ScheduleSMS


    ActionEventFuture future = new ActionEventFuture();
    ServerDialog dialog = this.context.getDialogFactory().getServerDialog();
   
    //迭代所有的定时短信列表,并在每20个发起一次获取定时短信详细内容的请求
    while(it.hasNext()){
      ScheduleSMS sc = it.next();
      readyList.add(sc);
      if(readyList.size()==20){
        future.clear();
        dialog.getScheduleSMSInfo(readyList, future);
        ActionEvent event = future.waitActionEventWithoutException();
View Full Code Here


     
      String scheduleSMSTmpl = "<schedule-sms id=\"{id}\" />";
      StringBuffer buffer = new StringBuffer();
      Iterator<ScheduleSMS> it = scheduleSMSList.iterator();
      while(it.hasNext()){
        ScheduleSMS s = it.next();
        buffer.append(scheduleSMSTmpl.replace("{id}", Long.toString(s.getId())));
      }
      body = body.replace("{scheduleSMSList}", buffer.toString());
     
      req.setBody(new SipcBody(body));
      return req;
View Full Code Here

     
      String scheduleSMSTmpl = "<schedule-sms id=\"{id}\" />";
      StringBuffer buffer = new StringBuffer();
      Iterator<ScheduleSMS> it = scheduleSMSList.iterator();
      while(it.hasNext()){
        ScheduleSMS s = it.next();
        buffer.append(scheduleSMSTmpl.replace("{id}", Long.toString(s.getId())));
      }
      body = body.replace("{scheduleSMSList}", buffer.toString());
     
      req.setBody(new SipcBody(body));
      return req;
View Full Code Here

  @Override
  public synchronized ScheduleSMS getScheduleSMS(int scId)
  {
    Iterator<ScheduleSMS> it = this.scheduleSMSList.iterator();
    while(it.hasNext()){
      ScheduleSMS sc = it.next();
      if(sc.getId()==scId){
        return sc;
      }
    }
    return null;
  }
View Full Code Here

    calMin.add(Calendar.MINUTE, 11);
    Calendar calMax = Calendar.getInstance();
    calMax.add(Calendar.YEAR, 1);
    //判断是否在有效的范围内,如果不在这个范围内则返回发送时间错误
    if( sendDate.after(calMin.getTime()) && sendDate.before(calMax.getTime())){
      ScheduleSMS sc = new ScheduleSMS(-1, message, sendDate,  receiverList);
      this.getServerDialog().createScheduleSMS(sc, listener);
    }else{
      if(listener!=nulllistener.fireEevent(new FailureEvent(FailureType.INVALID_SEND_DATE));
    }
  }
View Full Code Here

    this.ensureOnline();
    synchronized (this.store) {
      Iterator <ScheduleSMS> it = this.store.getScheduleSMSList().iterator();
      Date nowDate = new Date();
      while(it.hasNext()){
        ScheduleSMS sc = it.next();
        if(nowDate.after(sc.getSendDate())){    //如果当前时间大于定时短信发送时间,删除这个定时短信
          it.remove();
        }
      }
    }
  }
View Full Code Here

    synchronized (store) {
      while(it.hasNext()){
        Element e = (Element) it.next();
        //这里的 定时短信只有ID,如果需要定时短信的详细信息还需要发出另外的请求
        //真搞不懂为什么不把定时短信的详细直接返回,非得要发另外一个请求,很无语。。
        ScheduleSMS sc = new ScheduleSMS(Integer.parseInt(e.getAttributeValue("id")), null, null, null);
        store.addScheduleSMS(sc);
      }
        }
   
    return super.doActionOK(response);
View Full Code Here

    SimpleDateFormat df = new SimpleDateFormat("yyyy-M-d H:m:s");
    df.setTimeZone(TimeZone.getTimeZone("GMT 0"));
    while(it.hasNext()){
      Element e = (Element) it.next();
      int scId = Integer.parseInt(e.getAttributeValue("id"));
      ScheduleSMS sc = store.getScheduleSMS(scId);
      if(sc!=null){
        try {
          BeanHelper.setValue(sc, "sendDate", df.parse(e.getAttributeValue("send-time")))//发送时间
        } catch (ParseException e1) {
          throw new net.solosky.maplefetion.util.ParseException("Parse scheduleSMS send-time failed. "+e.getAttributeValue("sendTime"));
View Full Code Here

    Iterator it = delScList.iterator();
    FetionStore store = this.context.getFetionStore();
    while(it.hasNext()){
      Element e = (Element) it.next();
      int scId = Integer.parseInt(e.getAttributeValue("id"));
      ScheduleSMS sc = store.getScheduleSMS(scId);
      if(sc!=null){
        store.deleteScheduleSMS(sc);
      }
    }
   
View Full Code Here

TOP

Related Classes of net.solosky.maplefetion.bean.ScheduleSMS

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.