Package cn.com.zjtelecom.smgp.protocol

Examples of cn.com.zjtelecom.smgp.protocol.Tlv


    } else if (tag == TlvId.Mserviceid) {
      this.ProductID = value;
    } else {
      if (this.OtherTlvArray == null) {
        Tlv[] tmp = new Tlv[1];
        tmp[0] = new Tlv(tag, value);
        this.OtherTlvArray = tmp;
      } else {
        Tlv[] tmp = new Tlv[OtherTlvArray.length + 1];
        System
            .arraycopy(OtherTlvArray, 0, tmp, 0,
                OtherTlvArray.length);
        tmp[OtherTlvArray.length] = new Tlv(tag, value);
        this.OtherTlvArray = tmp;
      }
    }
  }
View Full Code Here


      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]);
View Full Code Here

  public synchronized Result SendBatch(SubmitBatch submit) {

    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]);
View Full Code Here

    } else if (tag == TlvId.Mserviceid) {
      this.ProductID = value;
    } else {
      if (this.OtherTlvArray == null) {
        Tlv[] tmp = new Tlv[1];
        tmp[0] = new Tlv(tag, value);
        this.OtherTlvArray = tmp;
      } else {
       
        int find=0;
        for (int i=0;i<OtherTlvArray.length;i++){
          if (OtherTlvArray[i].Tag == tag) {
            find=1;
            //System.out.println("�Ѿ�����tag:"+tag);
            OtherTlvArray[i]= new Tlv(tag, value);
          }
        }
        if (find==0) {
        Tlv[] tmp = new Tlv[OtherTlvArray.length + 1];
        System
            .arraycopy(OtherTlvArray, 0, tmp, 0,
                OtherTlvArray.length);
        tmp[OtherTlvArray.length] = new Tlv(tag, value);
        this.OtherTlvArray = tmp;
        }
      }
    }
  }
View Full Code Here

    // ����tlv
    int tlvlength = 0;
    Vector<Tlv> tlvV = new Vector<Tlv>();
    if (this.LinkID != null)
      tlvV.add(new Tlv(TlvId.LinkID, this.LinkID));
    if (this.TP_udhi != 0)
      tlvV.add(new Tlv(TlvId.TP_udhi, String.valueOf(this.TP_udhi)));
    if (this.OtherTlv != null) {
      for (int i = 0; i < this.OtherTlv.length; i++) {
        tlvV.add(this.OtherTlv[i]);
      }
    }
View Full Code Here

    if (submit.getMsgContent().length > 200) {
      return (new Result(4, "Message too Long"));
    }
    Vector<Tlv> tlv = new Vector<Tlv>();
    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.getTP_udhi()==1){
      tlv.add(new Tlv(TlvId.TP_udhi,String.valueOf(1)));
    }

    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]);
View Full Code Here

  public synchronized Result SendBatch(SubmitBatch submit) {

    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]);
View Full Code Here

TOP

Related Classes of cn.com.zjtelecom.smgp.protocol.Tlv

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.