Package cn.com.zjtelecom.smgp.Exception

Examples of cn.com.zjtelecom.smgp.Exception.SubmitException


    this.LongLastSubmit = getTimeStamp();
    if (this.LoginResult.ErrorCode == 0) {
      return this.pconnect.Send(submit);
     
    } else {
      throw new SubmitException(this.LoginResult);
    }
  }
View Full Code Here


  public  Integer[] SendLong(Submit submit) throws SubmitException {
    if (this.LoginResult.ErrorCode == 0) {
      return this.pconnect.SendLong(submit);
    } else {
      throw new SubmitException(this.LoginResult);
    }
  }
View Full Code Here

  public synchronized int Send(Submit submit) throws SubmitException {

    if (submit.getMsgContent().length > 200) {

      throw new SubmitException((new Result(4, "Message too Long")));
    }

    Vector tlv = new Vector();
    if (this.SPID != null && !this.SPID.equals("")) {
      tlv.add(new Tlv(TlvId.MsgSrc, this.SPID));
    }
    if (submit.getProductID() != null && !submit.getProductID().equals("")) {
      tlv.add(new Tlv(TlvId.Mserviceid, submit.getProductID()));
    }

    if (submit.getLinkID() != null && !submit.getLinkID().equals("")) {
      tlv.add(new Tlv(TlvId.LinkID, submit.getLinkID()));
    }

    if (submit.getOtherTlvArray() != null) {
      for (int i = 0; i < submit.getOtherTlvArray().length; i++) {
        tlv.add(submit.getOtherTlvArray()[i]);
      }
    }
    Tlv[] tlvarray = new Tlv[tlv.size()];
    // System.out.println("tlvlen:"+tlv.size());
    for (int i = 0; i < tlv.size(); i++) {
      // System.out.println(((Tlv)tlv.get(i)).Value);
      tlvarray[i] = (Tlv) tlv.get(i);
    }

    String[] desttermidarray = new String[1];
    desttermidarray[0] = submit.getDestTermid();
    if (SequenceId++ == 0x7FFFFF) {
      SequenceId = 0;
    }

    int tmpseq = SequenceId;
    SubmitMessage sm = new SubmitMessage(submit.getMsgType(), submit
        .getNeedReport(), submit.getPriority(), submit.getServiceID(),
        submit.getFeetype(), submit.getFeeCode(), submit.getFixedFee(),
        submit.getMsgFormat(), submit.getValidTime(), submit
            .getAtTime(), submit.getSrcTermid(), submit
            .getChargeTermid(), desttermidarray, submit
            .getMsgLength(), submit.getMsgContent(), submit
            .getReserve(), tlvarray, tmpseq);
    try {
      // System.out.println(Hex.rhex(sm.getBuf()));
      SendBuf(sm.getBuf());
      // out.write(sm.getBuf());
      if (this.DisplayMode >= 2) {
        DisplayPackage(sm.getBuf(), 1);
      }
    } catch (IOException e) {
      // TODO Auto-generated catch block
      // e.printStackTrace();
      throw new SubmitException(new Result(-1, "Socket Error!"));

    }

    tmpSubmitResp.put(tmpseq, new SubmitResp(submit));
View Full Code Here

TOP

Related Classes of cn.com.zjtelecom.smgp.Exception.SubmitException

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.