示例#1
3
 @Override
 public boolean isOid() {
   return ext.isOid();
 }
示例#2
0
  public void encode(AsnOutputStream aos) throws EncodeException {

    try {
      aos.writeTag(Tag.CLASS_APPLICATION, false, _TAG);
      int pos = aos.StartContentDefiniteLength();

      if (this.dialogAPDU == null) {
        throw new EncodeException(
            "No APDU in DialogPortion is defined when encoding DialogPortion");
      }

      if (this.getOidValue() == null) {
        throw new EncodeException(
            "No setUnidirectional() for DialogPortion is defined when encoding DialogPortion");
      }

      AsnOutputStream aos2 = new AsnOutputStream();
      dialogAPDU.encode(aos2);
      ext.setEncodeType(aos2.toByteArray());

      ext.encode(aos);

      aos.FinalizeContent(pos);

    } catch (AsnException e) {
      throw new EncodeException("AsnException when encoding DialogPortion: " + e.getMessage(), e);
    }
  }
示例#3
0
 /*
  * (non-Javadoc)
  *
  * @see org.mobicents.protocols.ss7.tcap.asn.DialogPortion#setUnidirectional( boolean)
  */
 public void setUnidirectional(boolean flag) {
   if (flag) {
     ext.setOidValue(_DIALG_UNI);
     // super.oidValue = _DIALG_UNI;
   } else {
     ext.setOidValue(_DIALG_STRUCTURED);
     // super.oidValue = _DIALG_STRUCTURED;
   }
   this.uniDirectional = flag;
 }
示例#4
0
  public void decode(AsnInputStream aisA) throws ParseException {

    // TAG has been decoded already, now, lets get LEN
    try {
      AsnInputStream ais = aisA.readSequenceStream();

      int tag = ais.readTag();
      if (tag != Tag.EXTERNAL)
        throw new ParseException(
            PAbortCauseType.IncorrectTxPortion,
            null,
            "Error decoding DialogPortion: wrong value of tag, expected EXTERNAL, found: " + tag);

      ext.decode(ais);

      if (!isAsn() || !isOid()) {
        throw new ParseException(
            PAbortCauseType.IncorrectTxPortion,
            null,
            "Error decoding DialogPortion: Oid and Asd parts not found");
      }

      // Check Oid
      if (Arrays.equals(_DIALG_UNI, this.getOidValue())) this.uniDirectional = true;
      else if (Arrays.equals(_DIALG_STRUCTURED, this.getOidValue())) this.uniDirectional = false;
      else
        throw new ParseException(
            PAbortCauseType.IncorrectTxPortion,
            null,
            "Error decoding DialogPortion: bad Oid value");

      AsnInputStream loaclAsnIS = new AsnInputStream(ext.getEncodeType());

      // now lets get APDU
      tag = loaclAsnIS.readTag();
      this.dialogAPDU = TcapFactory.createDialogAPDU(loaclAsnIS, tag, isUnidirectional());

    } catch (IOException e) {
      throw new ParseException(
          PAbortCauseType.BadlyFormattedTxPortion,
          null,
          "IOException when decoding DialogPortion: " + e.getMessage(),
          e);
    } catch (AsnException e) {
      throw new ParseException(
          PAbortCauseType.BadlyFormattedTxPortion,
          null,
          "AsnException when decoding DialogPortion: " + e.getMessage(),
          e);
    }
  }
示例#5
0
 @Override
 public boolean isOctet() {
   return ext.isOctet();
 }
示例#6
0
 @Override
 public void setAsn(boolean asn) {
   ext.setAsn(asn);
 }
示例#7
0
 @Override
 public boolean isAsn() {
   return ext.isAsn();
 }
示例#8
0
 @Override
 public void setIndirectReference(long indirectReference) {
   ext.setIndirectReference(indirectReference);
 }
示例#9
0
 @Override
 public long getIndirectReference() {
   return ext.getIndirectReference();
 }
示例#10
0
 @Override
 public BitSetStrictLength getEncodeBitStringType() throws AsnException {
   return ext.getEncodeBitStringType();
 }
示例#11
0
 @Override
 public void setArbitrary(boolean arbitrary) {
   ext.setArbitrary(arbitrary);
 }
示例#12
0
 @Override
 public boolean isObjDescriptor() {
   return ext.isObjDescriptor();
 }
示例#13
0
 @Override
 public boolean isInteger() {
   return ext.isInteger();
 }
示例#14
0
 @Override
 public void setInteger(boolean integer) {
   ext.setInteger(integer);
 }
示例#15
0
 @Override
 public void setOid(boolean oid) {
   ext.setOid(oid);
 }
示例#16
0
 @Override
 public byte[] getEncodeType() throws AsnException {
   return ext.getEncodeType();
 }
示例#17
0
 @Override
 public void setEncodeBitStringType(BitSetStrictLength data) {
   ext.setEncodeBitStringType(data);
 }
示例#18
0
 @Override
 public void setOctet(boolean octet) {
   ext.setOctet(octet);
 }
示例#19
0
 @Override
 public long[] getOidValue() {
   return ext.getOidValue();
 }
示例#20
0
 @Override
 public boolean isArbitrary() {
   return ext.isArbitrary();
 }
示例#21
0
 @Override
 public void setOidValue(long[] oidValue) {
   ext.setOidValue(oidValue);
 }
示例#22
0
 @Override
 public void setObjDescriptor(boolean objDescriptor) {
   ext.setObjDescriptor(objDescriptor);
 }
示例#23
0
 @Override
 public void setEncodeType(byte[] data) {
   ext.setEncodeType(data);
 }