Class SccpAddress

    • Field Detail

      • SSN_UNKNOWN

        public static final int SSN_UNKNOWN
        Subsystem value constant corresponding to unknown.
        See Also:
        Constant Field Values
      • SSN_SCCP_MANAGEMENT

        public static final int SSN_SCCP_MANAGEMENT
        Subsystem value constant corresponding to SCCP management.
        See Also:
        Constant Field Values
      • SSN_ISDN_USER_PART

        public static final int SSN_ISDN_USER_PART
        Subsystem value constant corresponding to ISN user part.
        See Also:
        Constant Field Values
      • SSN_OMAP

        public static final int SSN_OMAP
        Subsystem value constant corresponding to OMAP.
        See Also:
        Constant Field Values
      • SSN_MAP

        public static final int SSN_MAP
        Subsystem value constant corresponding to MAP.
        See Also:
        Constant Field Values
      • SSN_HLR

        public static final int SSN_HLR
        Subsystem value constant corresponding to the Home Location Register.
        See Also:
        Constant Field Values
      • SSN_VLR

        public static final int SSN_VLR
        Subsystem value constant corresponding to the Visitor Location Register.
        See Also:
        Constant Field Values
      • SSN_MSC

        public static final int SSN_MSC
        Subsystem value constant corresponding to the Mobile Switching Centre.
        See Also:
        Constant Field Values
      • SSN_EIC

        public static final int SSN_EIC
        Subsystem value constant corresponding to the Equipment Identity Centre.
        See Also:
        Constant Field Values
      • SSN_AUC

        public static final int SSN_AUC
        Subsystem value constant corresponding to the Authentication Centre.
        See Also:
        Constant Field Values
      • SSN_ISDN_SUPPLEMENTARY_SERVICES

        public static final int SSN_ISDN_SUPPLEMENTARY_SERVICES
        Subsystem value constant corresponding to ISDN Supplementary Services.
        See Also:
        Constant Field Values
      • SSN_BROADBAND_ISDN

        public static final int SSN_BROADBAND_ISDN
        Subsystem value constant corresponding to Broadband ISDN.
        See Also:
        Constant Field Values
      • SSN_TC_TEST_RESPONDER

        public static final int SSN_TC_TEST_RESPONDER
        Subsystem value constant corresponding to the TC Test Responder.
        See Also:
        Constant Field Values
      • NATURE_UNKNOWN

        public static final int NATURE_UNKNOWN
        Nature of address indicator value corresponding to unknown.
        See Also:
        Constant Field Values
      • NATURE_SUBSCRIBER_NUMBER

        public static final int NATURE_SUBSCRIBER_NUMBER
        Nature of address indicator value corresponding to a subscriber number.
        See Also:
        Constant Field Values
      • NATURE_NATIONAL_NUMBER

        public static final int NATURE_NATIONAL_NUMBER
        Nature of address indicator value corresponding to a national number.
        See Also:
        Constant Field Values
      • NATURE_INTERNATIONAL_NUMBER

        public static final int NATURE_INTERNATIONAL_NUMBER
        Nature of address indicator value corresponding to an international number.
        See Also:
        Constant Field Values
      • NUMBERING_PLAN_UNKNOWN

        public static final int NUMBERING_PLAN_UNKNOWN
        Numbering plan indicator value corresponding to an unknown numbering plan.
        See Also:
        Constant Field Values
      • NUMBERING_PLAN_ISDN

        public static final int NUMBERING_PLAN_ISDN
        Numbering plan indicator value corresponding to the ISDN (Telephony) number plan (ITU-T Recommendation E.164).
        See Also:
        Constant Field Values
      • NUMBERING_PLAN_GENERIC

        public static final int NUMBERING_PLAN_GENERIC
        Numbering plan indicator value corresponding to a generic numbering plan.
        See Also:
        Constant Field Values
      • NUMBERING_PLAN_DATA

        public static final int NUMBERING_PLAN_DATA
        Numbering plan indicator value corresponding to the Data numbering plan (ITU-T Recommendation X.121) (national use).
        See Also:
        Constant Field Values
      • NUMBERING_PLAN_TELEX

        public static final int NUMBERING_PLAN_TELEX
        Numbering plan indicator value corresponding to the Telex numbering plan (ITU-T Recommendation F.69) (national use).
        See Also:
        Constant Field Values
      • NUMBERING_PLAN_MARITIME_MOBILE

        public static final int NUMBERING_PLAN_MARITIME_MOBILE
        Numbering plan indicator value corresponding to the Maritime Mobile numbering plan (ITU-T Recommendation E.210/E.211).
        See Also:
        Constant Field Values
      • NUMBERING_PLAN_LAND_MOBILE

        public static final int NUMBERING_PLAN_LAND_MOBILE
        Numbering plan indicator value corresponding to the Land Mobile numbering plan (ITU-T Recommendation E.212).
        See Also:
        Constant Field Values
      • NUMBERING_PLAN_ISDN_MOBILE

        public static final int NUMBERING_PLAN_ISDN_MOBILE
        Numbering plan indicator value corresponding to the ISDN (Mobile) number plan (ITU-T Recommendation E.214).
        See Also:
        Constant Field Values
      • NUMBERING_PLAN_PRIVATE

        public static final int NUMBERING_PLAN_PRIVATE
        Numbering plan indicator value corresponding to a private numbering plan.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SccpAddress

        public SccpAddress​(SccpAddress.Type addressType)
        Create an new SCCP address.
        Parameters:
        addressType - the type of address.
      • SccpAddress

        public SccpAddress​(DataInput in)
                    throws IOException
        Create an SCCP address initialised from the specified DataInput.
        Parameters:
        in - the DataInput to read the SCCP address state from.
        Throws:
        IOException - if an I/O error occurs reading from the specified DataInput.
    • Method Detail

      • getAddressType

        public SccpAddress.Type getAddressType()
        Get the type of this address.
        Returns:
        an enumerated constant for the address type of this address
      • isNational

        public boolean isNational()
        Determine if the SCCP Address has the National Use indicator set.
        Returns:
        the National Use indicator value. The default is true.
      • setNational

        public void setNational​(boolean national)
        Set the National Use indicator.
        Parameters:
        national - the new value for the National Use indicator.
      • routeOnPC

        public boolean routeOnPC()
        Determine if the SCCP Address has the Route On Point Code indicator set. If this indicator is set, SCCP routing occurs using the Point Code and SSN specified in this SCCP Address. Otherwise routing occurs using Global Title addressing.
        Returns:
        true if the Route On Point Code indicator is set, false otherwise.
      • setRouteOnPC

        public void setRouteOnPC​(boolean routeOnPC)
        Set the Route On Point Code indicator.
        Parameters:
        routeOnPC - the new value for the Route On Point Code indicator.
      • hasPointCode

        public boolean hasPointCode()
        Detetmine if the SCCP address has the optional Point Code parameter.
        Returns:
        true if the SCCP address has the Point Code parameter, false otherwise.
      • setPointCode

        public void setPointCode​(int pc)
        Set the optional Point Code as a single decimal value. Valid values are in the range 0 - 16777215 (0xffffff). This allows support for 14-bit C7, 16-bit J7, and 24-bit A7 and CH7 addresses expressed as a single decimal value.

        For A7 and CH7 addresses this decimal value is the network byte order integer derived from the sequence in which ANSI/CHINESE SCCP transmit the member, cluster and network components of the point code. i.e [00000000 MMMMMMMM CCCCCCCC NNNNNNNN]. This is the reverse order to that used by ANSI/CHINESE MTP.

        Parameters:
        pc - the Point Code. Must be in the range 0-0xffffff.
        Throws:
        IllegalArgumentException - if the value of pc is not within the specified range.
      • getPointCode

        public int getPointCode()
        Get the optional Point Code as a single decimal value.

        For A7 and CH7 addresses this decimal value is the network byte order integer derived from the sequence in which ANSI/CHINESE SCCP transmit the member, cluster and network components of the point code. i.e [00000000 MMMMMMMM CCCCCCCC NNNNNNNN]. This is the reverse order to that used by ANSI/CHINESE MTP.

        Returns:
        the Point Code, or -1 if none has been set.
      • clearPointCode

        public void clearPointCode()
        Clear the optional Point Code paramter. Any existing value for this parameter is removed.
      • setPointCodeMemberClusterNetwork

        public void setPointCodeMemberClusterNetwork​(int member,
                                                     int cluster,
                                                     int network)
        Set the optional Point Code parameter using the ANSI member/cluster/zone format (8/8/8 bit fields). This format is typically used for 24-bit A7 addresses, and sometimes also used for CH7 (Chinese) addresses which are also 24-bit.
        Parameters:
        member - the point code member. Must be in the range 0-255.
        cluster - the point code cluster. Must be in the range 0-255.
        network - the point code network. Must be in the range 0-255.
        Throws:
        IllegalArgumentException - if the value of any parameter is not within the specified range.
      • getPointCodeMemberClusterNetwork

        public int[] getPointCodeMemberClusterNetwork()
        Get the optional Point Code using the ANSI member/cluster/zone format (8/8/8 bit fields). This format is typically used for 24-bit A7 addresses, and sometimes also used for CH7 (Chinese) addresses which are also 24-bit.
        Returns:
        an array of length 3 with values { member, cluster, network }, or null if a Point Code has not been set.
      • setPointCodeZoneAreaSignalPoint

        public void setPointCodeZoneAreaSignalPoint​(int zone,
                                                    int area,
                                                    int signalPoint)
        Set the optional Point Code parameter using the ITU-T zone/area/signal-point format (3/8/3 bit fields). This format can be used for 14-bit C7 addresses.
        Parameters:
        zone - the point code zone. Must be in the range 0-7.
        area - the point code area. Must be in the range 0-255.
        signalPoint - the point code signal point. Must be in the range 0-7.
        Throws:
        IllegalArgumentException - if the value of any parameter is not within the specified range.
      • getPointCodeZoneAreaSignalPoint

        public int[] getPointCodeZoneAreaSignalPoint()
        Get the optional Point Code using the ITU-T zone/area/signal-point format (3/8/3 bit fields). This format can be used for 14-bit C7 addresses.
        Returns:
        an array of length 3 with values { zone, area, signal-point }, or null if a Point Code has not been set.
      • hasSSN

        public boolean hasSSN()
        Determine if the SCCP Address has the optional SSN parameter.
        Returns:
        true if the SCCP Address has the SSN parameter, false otherwise.
      • getSSN

        public int getSSN()
        Get the optional SSN parameter.
        Returns:
        the SSN, or -1 if none has been set.
      • setSSN

        public void setSSN​(int ssn)
        Set the optional SSN parameter.
        Parameters:
        ssn - the SSN. Must be in the range 0-255.
        Throws:
        IllegalArgumentException - if the value of ssn is out of the allowed range.
      • clearSSN

        public void clearSSN()
        Clear the optional SSN parameter. Any existing value for this parameter is removed.
      • hasGlobalTitleIndicator

        public boolean hasGlobalTitleIndicator()
        Determine if the SCCP Address has a Global Title Indicator.
        Returns:
        true if a Global Title Indicator is present, false otherwise.
      • getGlobalTitleIndicator

        public SccpAddress.GTIndicator getGlobalTitleIndicator()
        Get the optional Global Title Indicator parameter.
        Returns:
        the Global Title Indicator, or GT_0000 if no GTI is present
      • setGlobalTitleIndicator

        public void setGlobalTitleIndicator​(SccpAddress.GTIndicator gt)
        Set the optional Global Title Indicator parameter.
        Parameters:
        gt - the Global Titile Indicator; if GT_0000 is specified, the GTI is cleared.
        Throws:
        NullPointerException - if gt is not within the specified range.
      • clearGlobalTitleIndicator

        public void clearGlobalTitleIndicator()
        Clear the optional Global Title Indicator parameter. The GTI is reset to GT_0000.
      • hasNatureOfAddress

        public boolean hasNatureOfAddress()
        Determine if the SCCP Address has the optional Nature Of Address parameter.
        Returns:
        true if the SCCP Address has the Nature Of Address parameter, false otherwise.
      • getNatureOfAddress

        public int getNatureOfAddress()
        Get the optional Nature Of Address parameter.
        Returns:
        the Nature Of Address, of -1 if none has been set.
      • setNatureOfAddress

        public void setNatureOfAddress​(int nature)
        Set the optional Nature Of Address parameter.
        Parameters:
        nature - the Nature Of Address. This value must be in the range [0,127].
        Throws:
        IllegalArgumentException - if nature is not within the specified range.
      • clearNatureOfAddress

        public void clearNatureOfAddress()
        Clear the optional Nature Of Address parameter. Any existing value for this parameter is removed.
      • hasTranslationType

        public boolean hasTranslationType()
        Determine if the SCCP Address has the optional Translation Type parameter.
        Returns:
        true if the SCCP Address has the Translation Type parameter, false otherwise.
      • getTranslationType

        public int getTranslationType()
        Get the optional Translation Type parameter.
        Returns:
        the Translation Type, or -1 if none has been set.
      • setTranslationType

        public void setTranslationType​(int tt)
        Set the optional Translation Type parameter.
        Parameters:
        tt - the Translation Type. This value must be in the range [0,255].
        Throws:
        IllegalArgumentException - if tt is not within the specified range.
      • clearTranslationType

        public void clearTranslationType()
        Clear the optional Translation Type parameter. Any existing value for this parameter is removed.
      • hasNumberingPlan

        public boolean hasNumberingPlan()
        Determine if the SCCP Address has the optional Numbering Plan parameter.
        Returns:
        true if the SCCP Address has the Numbering Plan parameter, false otherwise.
      • getNumberingPlan

        public int getNumberingPlan()
        Get the optional Numbering Plan parameter.
        Returns:
        the Numbering Plan, or -1 if none has been set.
      • setNumberingPlan

        public void setNumberingPlan​(int plan)
        Set the optional Numbering Plan parameter.
        Parameters:
        plan - the Numbering Plan. This value must be in the range [0,15].
        Throws:
        IllegalArgumentException - if plan is not within the specified range.
      • clearNumberingPlan

        public void clearNumberingPlan()
        Clear the optional Numbering Plan parameter. Any existing value for this parameter is removed.
      • hasEncodingScheme

        public boolean hasEncodingScheme()
        Determine if the SCCP Address has the optional Encoding Scheme parameter.
        Returns:
        true if the SCCP Address has the Encoding Scheme parameter, false otherwise.
      • getEncodingScheme

        public int getEncodingScheme()
        Get the optional Encoding Scheme parameter.
        Returns:
        the Encoding Scheme, or -1 if none has been set.
      • setEncodingScheme

        public void setEncodingScheme​(int encoding)
        Set the optional Encoding Scheme parameter.
        Parameters:
        encoding - the Encoding Scheme. This value must be in the range [0,15].
        Throws:
        IllegalArgumentException - if encoding is not within the specified range.
      • clearEncodingScheme

        public void clearEncodingScheme()
        Clear the optional Encoding Scheme parameter. Any existing value for this parameter is removed.
      • hasAddress

        public boolean hasAddress()
        Determine if the SCCP Address has the optional Global Title Address parameter.
        Returns:
        true if the SCCP Address has the Global Title Address parameter, false otherwise.
      • getAddress

        public String getAddress()
        Get the optional Global Title Address parameter.
        Returns:
        the Global Title Address, or null if none has been set.
      • setAddress

        public void setAddress​(String address)
        Set the optional Global Title Address parameter.
        Parameters:
        address - the Global Title Address. May be null to remove any previous value set.
      • encodeAscii

        public static byte[] encodeAscii​(String address)
        Encode an address into a byte array of ASCII characters, one digit per byte.
        Parameters:
        address - the address to encode.
        Returns:
        a byte array of ASCII-encoded digits.
        Throws:
        IllegalArgumentException - if the address contains invalid characters.
      • decodeAscii

        public static String decodeAscii​(byte[] encoded)
        Decode an address from a byte array of ASCII digits, one digit per byte.
        Parameters:
        encoded - the address to decode.
        Returns:
        the decoded address string.
      • encodeBinary

        public static byte[] encodeBinary​(String address)
        Encode an address into a byte array of binary digits, one digit per byte. Each digit is BCD encoded into the lower nibble of each byte.
        Parameters:
        address - the address to encode.
        Returns:
        a byte array of binary-encoded digits.
        Throws:
        IllegalArgumentException - if the address contains invalid characters.
      • decodeBinary

        public static String decodeBinary​(byte[] encoded)
        Decode an adddress from a byte array of binary-encoded digits, one per byte.
        Parameters:
        encoded - the address to decode.
        Returns:
        the decoded address string.
      • encodeBCD

        public static byte[] encodeBCD​(String address)
        Encode an address string into a byte array of packed BCD encoded digits, one nibble per digit.
        Parameters:
        address - the address to encode.
        Returns:
        a byte array of packed BCD-encoded digits.
      • decodeBCD

        public static String decodeBCD​(byte[] encoded,
                                       boolean odd)
        Decode an address from a byte array of packed BCD-encoded digits, one nibble per digit
        Parameters:
        encoded - address to decode.
        odd - whether or not the encoded address has an odd number of digits.
        Returns:
        the decoded address string.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • clone

        public SccpAddress clone()
        Description copied from interface: DataObject
        Perform a deep copy of this object. Read-only state of the object is not copied; the new object will be read-write by default.

        Inherently immutable objects may optionally return the same object without modification from clone(), rather than constructing a new instance.

        Specified by:
        clone in interface DataObject
        Specified by:
        clone in class AbstractDataObject
        Returns:
        a new object that is a deep copy of this object; for immutable objects, the same object may optionally be returned.