Class MMCode

  • All Implemented Interfaces:
    DataObject, FastSerializable, Serializable

    public final class MMCode
    extends AbstractLazyEncodedNamedInteger<MMCode.EncodedValue>
    implements FastSerializable
    Class MMCode encapsulates a Mobility Management event. It represents the ASN.1 OCTET STRING type MAP-MS-DataTypes.MM-Code.

    The API offered by this class is as if the type were specified in ASN.1 as follows.

     MMCode ::= SEQUENCE {
         encodedValue EncodedValue
     }

    EncodedValue is a NamedInteger. For each named value of the type, n, the API defines three Java static fields: a DataObject n, a NamedInteger EncodedValue.n, and an int EncodedValue._n.

    The encoding is based on comments in ASN.1 module MAP-MS-DataTypes in 3GPP TS 29.002 V10.0.0 (2010-09) p378.

    See Also:
    Serialized Form
    • Field Detail

      • LOCATION_UPDATE_IN_SAME_VLR

        public static final MMCode LOCATION_UPDATE_IN_SAME_VLR
        Location update in same VLR
      • LOCATION_UPDATE_TO_OTHER_VLR

        public static final MMCode LOCATION_UPDATE_TO_OTHER_VLR
        Location update to other VLR
      • IMSI_ATTACH

        public static final MMCode IMSI_ATTACH
        IMSI attach
      • MS_INITIATED_IMSI_DETACH

        public static final MMCode MS_INITIATED_IMSI_DETACH
        MS initiated IMSI detach
      • NETWORK_INITIATED_IMSI_DETACH

        public static final MMCode NETWORK_INITIATED_IMSI_DETACH
        Network initiated IMSI detach
      • ROUTEING_AREA_UPDATE_IN_SAME_SGSN

        public static final MMCode ROUTEING_AREA_UPDATE_IN_SAME_SGSN
        Routeing (sic) area update in same SGSN
      • ROUTEING_AREA_UPDATE_TO_OTHER_SGSN_UPDATE_FROM_NEW_SGSN

        public static final MMCode ROUTEING_AREA_UPDATE_TO_OTHER_SGSN_UPDATE_FROM_NEW_SGSN
        Routeing (sic) area updateTo other SGSN update from new SGSN
      • ROUTEING_AREA_UPDATE_TO_OTHER_SGSN_DISCONNECT_BY_DETACH

        public static final MMCode ROUTEING_AREA_UPDATE_TO_OTHER_SGSN_DISCONNECT_BY_DETACH
        Routeing (sic) area update to other SGSN disconnect by detach
      • GPRS_ATTACH

        public static final MMCode GPRS_ATTACH
        GPRS attach
      • MS_INITIATED_GPRS_DETACH

        public static final MMCode MS_INITIATED_GPRS_DETACH
        MS initiated GPRS detach
      • NETWORK_INITIATED_GPRS_DETACH

        public static final MMCode NETWORK_INITIATED_GPRS_DETACH
        Network initiated GPRS detach
      • NETWORK_INITIATED_TRANSFER_TO_MS_NOT_REACHABLE_FOR_PAGING

        public static final MMCode NETWORK_INITIATED_TRANSFER_TO_MS_NOT_REACHABLE_FOR_PAGING
        Network initiated transfer toMS not reachable for paging
    • Constructor Detail

      • MMCode

        public MMCode()
        Constructs a new MMCode object with no fields set.
      • MMCode

        public MMCode​(byte[] data)
        Constructs a new MMCode object from network-encoded data. The data is not decoded and might not be decodable.
        Parameters:
        data - network-encoded data
        Throws:
        NullPointerException - if data is null
      • MMCode

        public MMCode​(byte[] data,
                      int start,
                      int len)
        Constructs a new MMCode object from part of network-encoded data. The part starts at index start and is len bytes long. The data is not decoded and might not be decodable.
        Parameters:
        data - network-encoded data
        start - starting offset of network-encoded data in byte array
        len - default length if not predictable
        Throws:
        NullPointerException - if data is null
        IllegalArgumentException - if len is negative
      • MMCode

        public MMCode​(MMCode.EncodedValue encodedValue)
        Constructs a new MMCode object from given values for all fields.
        Parameters:
        encodedValue - the MMCode value
      • MMCode

        public MMCode​(int arg)
        Constructs a new MMCode object from the given int, making it be read-only (immutable).
        Parameters:
        arg - int
      • MMCode

        public MMCode​(DataInput in)
               throws IOException
        Constructs a new MMCode object from data deserialized from a stream that was written by toStream(DataOutput).
        Parameters:
        in - the stream to read from
        Throws:
        EOFException - if reading is pre-empted by end-of-file
        IOException - if the data cannot be read
    • Method Detail

      • hasEncodedValue

        public boolean hasEncodedValue()
                                throws DecodeException
        Tests whether the field EncodedValue has a value.
        Returns:
        whether the field has a value
        Throws:
        DecodeException - if encoded state cannot be decoded
      • copyOf

        public static MMCode copyOf​(MMCode from)
        Creates a new object of this type, cloning the values of common fields from the given object of any subclass of the same base type.
        Parameters:
        from - the object from which to copy
        Returns:
        MMCode
      • getFieldAccessors

        public static FieldAccessor[] getFieldAccessors()
        Gets a new array of the accessors for fields of this type.
        Returns:
        FieldAccessor[]
      • getFieldsMap

        public Map<String,​Object> getFieldsMap​(boolean withAbsents)
        Gets a Map from field-name to field-value for the fields of a sequence. For a field of primitive type, the field-value is boxed. For an absent optional field, the field-value is AbstractFieldsObject.FIELD_ABSENT. For an uninitialised mandatory field, the field-value is AbstractFieldsObject.FIELD_UNINITIALISED. For a field of String type, the encoded form is used if the String cannot be decoded. For a type that represents an OCTET STRING that cannot be decoded, a map from "encodedValue" to the byte array value is returned.
        Specified by:
        getFieldsMap in class AbstractFieldsObject
        Parameters:
        withAbsents - whether to put absent optional fields into Map
        Returns:
        Map from field-name to field-value
      • encodedIsInvalid

        protected boolean encodedIsInvalid()
        Determines whether the encoded form is invalid.
        Returns:
        boolean
      • getByteArrayForm

        public byte[] getByteArrayForm()
                                throws EncodeException
        Gets the byte array encoded form. The size of the array is the least of 1, 2, 4, or 8 according to the type's bounds. The most significant byte of the numeric value is in the lowest indexed byte of the array.
        Returns:
        byte array form
        Throws:
        EncodeException - if encoding fails