Comment #2 on issue 135 by [email protected]: Implement provideRoamingNumber MAP message
http://code.google.com/p/jss7/issues/detail?id=135

1. ProvideRoamingNumberRequestImpl and ProvideRoamingNumberResponsetImpl:
- use PrimitiveName field to save correct name of a primitive "public static final String _PrimitiveName = "ProvideRoamingNumberRequest";". This is not a bug, but using this simplifies usage your implemetationa as a templete for other primitives.
- encodeAll(AsnOutputStream asnOs, int tagClass, int tag):
use "asnOs.writeTag(tagClass, this.getIsPrimitive(), tag);"
instead of "asnOs.writeTag(tagClass, false, tag);"
This is not a bug but this prevent from possible bugs
- _decode():
use " throws MAPParsingComponentException, IOException, AsnException " for this method instead of catching exceptions inside this method. We are catching exceptions in decodeAll() and decodeData() methods
- _decode():
you do not check if parameter is primitive or constructed like:
if (ais.isTagPrimitive()) {
throw new MAPParsingComponentException("Error while decoding " + _PrimitiveName + ".extensionContainer: is primitive", MAPParsingComponentExceptionReason.MistypedParameter);
}
- toString() method should be introduced for all primitives
- please can you follow the order of methods in the file like in other primitive it is Look at org.mobicents.protocols.ss7.map.service.mobility.imei.CheckImeiResponseImpl as an example for all above

2. ProvideRoamingNumberRequestImpl._decode():
- for "if (this.mapProtocolVersion <= 2)" you do not check if tagClass==CONTEXT_SPECIFIC (you do so for protocol version==3).

3. ProvideRoamingNumberResponseImpl._decode():
- for protocol version version 1 & 2:
replace "((ISDNAddressStringImpl) this.roamingNumber).decodeAll(ais);"
with "((ISDNAddressStringImpl) this.roamingNumber).decodeData(ais);"
4. ProvideRoamingNumberResponseImpl.encodeData()
- for protocol version version 1 & 2:
also encodeAll() -> encodeData()







Reply via email to