Example #1
0
  /**
   * Encodes this message into an ASN.1 element. A status request message has the following syntax:
   * <br>
   * <br>
   * <CODE>StatusRequest ::= [APPLICATION 8] SEQUENCE {</CODE> <CODE>
   *     jobID           OCTET STRING OPTIONAL }</CODE> <br>
   *
   * @return An ASN.1 encoded representation of this message.
   */
  @Override()
  public ASN1Element encode() {
    ASN1Integer messageIDElement = new ASN1Integer(messageID);
    ASN1Sequence statusRequestSequence = new ASN1Sequence(ASN1_TYPE_STATUS_REQUEST);

    if (!((jobID == null) || (jobID.length() == 0))) {
      statusRequestSequence.addElement(new ASN1OctetString(jobID));
    }

    ASN1Element[] messageElements = new ASN1Element[] {messageIDElement, statusRequestSequence};

    return new ASN1Sequence(messageElements);
  }