Esempio n. 1
3
 @Override
 public boolean isOid() {
   return ext.isOid();
 }
Esempio n. 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);
    }
  }
Esempio n. 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;
 }
Esempio n. 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);
    }
  }
Esempio n. 5
0
 @Override
 public boolean isOctet() {
   return ext.isOctet();
 }
Esempio n. 6
0
 @Override
 public void setAsn(boolean asn) {
   ext.setAsn(asn);
 }
Esempio n. 7
0
 @Override
 public boolean isAsn() {
   return ext.isAsn();
 }
Esempio n. 8
0
 @Override
 public void setIndirectReference(long indirectReference) {
   ext.setIndirectReference(indirectReference);
 }
Esempio n. 9
0
 @Override
 public long getIndirectReference() {
   return ext.getIndirectReference();
 }
Esempio n. 10
0
 @Override
 public BitSetStrictLength getEncodeBitStringType() throws AsnException {
   return ext.getEncodeBitStringType();
 }
Esempio n. 11
0
 @Override
 public void setArbitrary(boolean arbitrary) {
   ext.setArbitrary(arbitrary);
 }
Esempio n. 12
0
 @Override
 public boolean isObjDescriptor() {
   return ext.isObjDescriptor();
 }
Esempio n. 13
0
 @Override
 public boolean isInteger() {
   return ext.isInteger();
 }
Esempio n. 14
0
 @Override
 public void setInteger(boolean integer) {
   ext.setInteger(integer);
 }
Esempio n. 15
0
 @Override
 public void setOid(boolean oid) {
   ext.setOid(oid);
 }
Esempio n. 16
0
 @Override
 public byte[] getEncodeType() throws AsnException {
   return ext.getEncodeType();
 }
Esempio n. 17
0
 @Override
 public void setEncodeBitStringType(BitSetStrictLength data) {
   ext.setEncodeBitStringType(data);
 }
Esempio n. 18
0
 @Override
 public void setOctet(boolean octet) {
   ext.setOctet(octet);
 }
Esempio n. 19
0
 @Override
 public long[] getOidValue() {
   return ext.getOidValue();
 }
Esempio n. 20
0
 @Override
 public boolean isArbitrary() {
   return ext.isArbitrary();
 }
Esempio n. 21
0
 @Override
 public void setOidValue(long[] oidValue) {
   ext.setOidValue(oidValue);
 }
Esempio n. 22
0
 @Override
 public void setObjDescriptor(boolean objDescriptor) {
   ext.setObjDescriptor(objDescriptor);
 }
Esempio n. 23
0
 @Override
 public void setEncodeType(byte[] data) {
   ext.setEncodeType(data);
 }