@Override public boolean isOid() { return ext.isOid(); }
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); } }
/* * (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; }
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); } }
@Override public boolean isOctet() { return ext.isOctet(); }
@Override public void setAsn(boolean asn) { ext.setAsn(asn); }
@Override public boolean isAsn() { return ext.isAsn(); }
@Override public void setIndirectReference(long indirectReference) { ext.setIndirectReference(indirectReference); }
@Override public long getIndirectReference() { return ext.getIndirectReference(); }
@Override public BitSetStrictLength getEncodeBitStringType() throws AsnException { return ext.getEncodeBitStringType(); }
@Override public void setArbitrary(boolean arbitrary) { ext.setArbitrary(arbitrary); }
@Override public boolean isObjDescriptor() { return ext.isObjDescriptor(); }
@Override public boolean isInteger() { return ext.isInteger(); }
@Override public void setInteger(boolean integer) { ext.setInteger(integer); }
@Override public void setOid(boolean oid) { ext.setOid(oid); }
@Override public byte[] getEncodeType() throws AsnException { return ext.getEncodeType(); }
@Override public void setEncodeBitStringType(BitSetStrictLength data) { ext.setEncodeBitStringType(data); }
@Override public void setOctet(boolean octet) { ext.setOctet(octet); }
@Override public long[] getOidValue() { return ext.getOidValue(); }
@Override public boolean isArbitrary() { return ext.isArbitrary(); }
@Override public void setOidValue(long[] oidValue) { ext.setOidValue(oidValue); }
@Override public void setObjDescriptor(boolean objDescriptor) { ext.setObjDescriptor(objDescriptor); }
@Override public void setEncodeType(byte[] data) { ext.setEncodeType(data); }