Package cn.com.zjtelecom.smgp.bean

Examples of cn.com.zjtelecom.smgp.bean.Submit


    // ��ʼ��client
    Client client = new Client(host, port, 2, account, passwd, spid, 0);

    // ����submit
    Submit submit = new Submit();
    submit.setSrcTermid(spnum);
    submit.setDestTermid(destnum);
    submit.setMsgContent(content.getBytes("iso-10646-ucs-2"));
    submit.setMsgFormat(8);
    if (productid!=null) submit.setProductID(productid);

    // ���Ͷ���
    Result[] result = client.SendLong(submit);
    for (int i = 0; i < result.length; i++) {
      System.out.println("--------------------------------");
View Full Code Here


   
    //��ʼ��client
    Client client = new Client(host, port, 2,account, passwd,spid, 0);
   
    //����submit
    Submit submit =new Submit();
    submit.setSrcTermid(spnum);
    submit.setDestTermid(destnum);
    submit.setMsgContent(content.getBytes("iso-10646-ucs-2"));
    submit.setMsgFormat(8);
    if (productid!=null) submit.setProductID(productid);
   
    //���Ͷ���
    Result  result =client.Send(submit);
    System.out.println("Status:"+result.ErrorCode);
    System.out.println("MsgID:"+result.ErrorDescription);
View Full Code Here

    Vector<byte[]> splitContent = SplitContent(submit.getMsgContent());
    Integer[] result = new Integer[splitContent.size()];

    for (int i = 0; i < splitContent.size(); i++) {
      Submit tmpSubmit = submit;
      tmpSubmit.setMsgContent(addContentHeader(splitContent.get(i),
          splitContent.size(), i + 1));
      // System.out.println("msglen:"+tmpSubmit.getMsgLength());
      //tmpSubmit.AddTlv(TlvId.TP_udhi, "1");
      tmpSubmit.setTP_udhi(1);
      tmpSubmit.AddTlv(TlvId.PkNumber, String.valueOf(i + 1));
      tmpSubmit
          .AddTlv(TlvId.PkTotal, String.valueOf(splitContent.size()));
      result[i] = this.Send(tmpSubmit);

    }
View Full Code Here

            }
            break;
          case (0x00000002):
            // submit
            SubmitMessage submitMessage = new SubmitMessage(Message);
            Submit submit = submitMessage.getSubmit();
            SubmitResult submitResult = this.serversim.onSumit(
                submit, this.account);
            SubmitRespMessage submitRespMessage = new SubmitRespMessage(
                SequenceId, submitResult.getStatus(),
                submitResult.getMsgID());
View Full Code Here

    try {
      PushBody = getWapPushBody(desc,url);
      //PushHeader = ;
      if (PushBody.length<(140-12)){
        arraySubmit=new Submit[1];
        arraySubmit[0]=new Submit();
        arraySubmit[0].AddTlv(TlvId.TP_udhi, "1");
        arraySubmit[0].setMsgFormat(4);
        arraySubmit[0].setSrcTermid(srcTermid);
        arraySubmit[0].setChargeTermid(chargeTermid);
        arraySubmit[0].setDestTermid(destTermid);
        arraySubmit[0].setMsgContent(mergeByteArray(getWapPushHeader(1,1),PushBody));
        arraySubmit[0].setProductID(productID);
        arraySubmit[0].setMsgType(7);
      }else {
        Vector<byte[]> contentArray=SplitContent(PushBody);
        arraySubmit=new Submit[contentArray.size()];
        for (int i=0;i<contentArray.size();i++){
          arraySubmit[i]=new Submit();
          arraySubmit[i].AddTlv(TlvId.TP_udhi, "1");
          arraySubmit[i].setMsgFormat(4);
          arraySubmit[i].setSrcTermid(srcTermid);
          arraySubmit[i].setChargeTermid(chargeTermid);
          arraySubmit[i].setDestTermid(destTermid);
View Full Code Here

    Vector<byte[]> splitContent = SplitContent(submit.getMsgContent());
    Result[] result = new Result[splitContent.size()];

    for (int i = 0; i < splitContent.size(); i++) {
      Submit tmpSubmit = submit;
      tmpSubmit.setMsgContent(addContentHeader(splitContent.get(i),
          splitContent.size(), i + 1));
      // System.out.println("msglen:"+tmpSubmit.getMsgLength());
      //tmpSubmit.AddTlv(TlvId.TP_udhi, "1");
      tmpSubmit.setTP_udhi(1);
      tmpSubmit.AddTlv(TlvId.PkNumber, String.valueOf(i + 1));
      tmpSubmit
          .AddTlv(TlvId.PkTotal, String.valueOf(splitContent.size()));
      result[i] = this.Send(tmpSubmit);

    }
View Full Code Here

  private Submit submit;

  public SubmitMessage(byte[] buffer) {
    this.sequence_Id = TypeConvert.byte2int(buffer, 4);
    this.submit = new Submit();
    submit.setMsgType(buffer[8]);
    submit.setNeedReport(buffer[9]);
    submit.setPriority(buffer[10]);
    submit.setServiceID(TypeConvert.getString(buffer, 11, 0, 10));
    submit.setFeetype(TypeConvert.getString(buffer, 21, 0, 2));
View Full Code Here

TOP

Related Classes of cn.com.zjtelecom.smgp.bean.Submit

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.