Пример #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);
 }