public final class SccpAddress extends AbstractDataObject implements FastSerializable
Modifier and Type | Class and Description |
---|---|
static class |
SccpAddress.GTIndicator
Enumeration of global title indicator values.
|
static class |
SccpAddress.Type
Enumeration of SCCP Address types.
|
Modifier and Type | Field and Description |
---|---|
static int |
NATURE_INTERNATIONAL_NUMBER
Nature of address indicator value corresponding to an international number.
|
static int |
NATURE_NATIONAL_NUMBER
Nature of address indicator value corresponding to a national number.
|
static int |
NATURE_SUBSCRIBER_NUMBER
Nature of address indicator value corresponding to a subscriber number.
|
static int |
NATURE_UNKNOWN
Nature of address indicator value corresponding to unknown.
|
static int |
NUMBERING_PLAN_DATA
Numbering plan indicator value corresponding to the Data numbering plan
(ITU-T Recommendation X.121) (national use).
|
static int |
NUMBERING_PLAN_GENERIC
Numbering plan indicator value corresponding to a generic numbering plan.
|
static int |
NUMBERING_PLAN_ISDN
Numbering plan indicator value corresponding to the ISDN (Telephony) number plan
(ITU-T Recommendation E.164).
|
static int |
NUMBERING_PLAN_ISDN_MOBILE
Numbering plan indicator value corresponding to the ISDN (Mobile) number plan
(ITU-T Recommendation E.214).
|
static int |
NUMBERING_PLAN_LAND_MOBILE
Numbering plan indicator value corresponding to the Land Mobile numbering plan
(ITU-T Recommendation E.212).
|
static int |
NUMBERING_PLAN_MARITIME_MOBILE
Numbering plan indicator value corresponding to the Maritime Mobile numbering plan
(ITU-T Recommendation E.210/E.211).
|
static int |
NUMBERING_PLAN_PRIVATE
Numbering plan indicator value corresponding to a private numbering plan.
|
static int |
NUMBERING_PLAN_TELEX
Numbering plan indicator value corresponding to the Telex numbering plan
(ITU-T Recommendation F.69) (national use).
|
static int |
NUMBERING_PLAN_UNKNOWN
Numbering plan indicator value corresponding to an unknown numbering plan.
|
static int |
SSN_AUC
Subsystem value constant corresponding to the Authentication Centre.
|
static int |
SSN_BROADBAND_ISDN
Subsystem value constant corresponding to Broadband ISDN.
|
static int |
SSN_EIC
Subsystem value constant corresponding to the Equipment Identity Centre.
|
static int |
SSN_HLR
Subsystem value constant corresponding to the Home Location Register.
|
static int |
SSN_ISDN_SUPPLEMENTARY_SERVICES
Subsystem value constant corresponding to ISDN Supplementary Services.
|
static int |
SSN_ISDN_USER_PART
Subsystem value constant corresponding to ISN user part.
|
static int |
SSN_MAP
Subsystem value constant corresponding to MAP.
|
static int |
SSN_MSC
Subsystem value constant corresponding to the Mobile Switching Centre.
|
static int |
SSN_OMAP
Subsystem value constant corresponding to OMAP.
|
static int |
SSN_SCCP_MANAGEMENT
Subsystem value constant corresponding to SCCP management.
|
static int |
SSN_TC_TEST_RESPONDER
Subsystem value constant corresponding to the TC Test Responder.
|
static int |
SSN_UNKNOWN
Subsystem value constant corresponding to unknown.
|
static int |
SSN_VLR
Subsystem value constant corresponding to the Visitor Location Register.
|
Constructor and Description |
---|
SccpAddress(DataInput in)
Create an SCCP address initialised from the specified DataInput.
|
SccpAddress(SccpAddress.Type addressType)
Create an new SCCP address.
|
Modifier and Type | Method and Description |
---|---|
void |
clearEncodingScheme()
Clear the optional Encoding Scheme parameter.
|
void |
clearGlobalTitleIndicator()
Clear the optional Global Title Indicator parameter.
|
void |
clearNatureOfAddress()
Clear the optional Nature Of Address parameter.
|
void |
clearNumberingPlan()
Clear the optional Numbering Plan parameter.
|
void |
clearPointCode()
Clear the optional Point Code paramter.
|
void |
clearSSN()
Clear the optional SSN parameter.
|
void |
clearTranslationType()
Clear the optional Translation Type parameter.
|
SccpAddress |
clone()
Perform a deep copy of this object.
|
static SccpAddress |
copyOf(SccpAddress from) |
static String |
decodeAscii(byte[] encoded)
Decode an address from a byte array of ASCII digits, one digit per byte.
|
static String |
decodeBCD(byte[] encoded,
boolean odd)
Decode an address from a byte array of packed BCD-encoded digits, one nibble
per digit
|
static String |
decodeBinary(byte[] encoded)
Decode an adddress from a byte array of binary-encoded digits, one per byte.
|
static byte[] |
encodeAscii(String address)
Encode an address into a byte array of ASCII characters, one digit per byte.
|
static byte[] |
encodeBCD(String address)
Encode an address string into a byte array of packed BCD encoded digits,
one nibble per digit.
|
static byte[] |
encodeBinary(String address)
Encode an address into a byte array of binary digits, one digit per byte.
|
boolean |
equals(Object o) |
String |
getAddress()
Get the optional Global Title Address parameter.
|
SccpAddress.Type |
getAddressType()
Get the type of this address.
|
int |
getEncodingScheme()
Get the optional Encoding Scheme parameter.
|
SccpAddress.GTIndicator |
getGlobalTitleIndicator()
Get the optional Global Title Indicator parameter.
|
int |
getNatureOfAddress()
Get the optional Nature Of Address parameter.
|
int |
getNumberingPlan()
Get the optional Numbering Plan parameter.
|
int |
getPointCode()
Get the optional Point Code as a single decimal value.
|
int[] |
getPointCodeMemberClusterNetwork()
Get the optional Point Code using the ANSI member/cluster/zone format (8/8/8 bit fields).
|
int[] |
getPointCodeZoneAreaSignalPoint()
Get the optional Point Code using the ITU-T zone/area/signal-point format
(3/8/3 bit fields).
|
int |
getSSN()
Get the optional SSN parameter.
|
int |
getTranslationType()
Get the optional Translation Type parameter.
|
boolean |
hasAddress()
Determine if the SCCP Address has the optional Global Title Address parameter.
|
boolean |
hasEncodingScheme()
Determine if the SCCP Address has the optional Encoding Scheme parameter.
|
boolean |
hasGlobalTitleIndicator()
Determine if the SCCP Address has a Global Title Indicator.
|
int |
hashCode() |
boolean |
hasNatureOfAddress()
Determine if the SCCP Address has the optional Nature Of Address parameter.
|
boolean |
hasNumberingPlan()
Determine if the SCCP Address has the optional Numbering Plan parameter.
|
boolean |
hasPointCode()
Detetmine if the SCCP address has the optional Point Code parameter.
|
boolean |
hasSSN()
Determine if the SCCP Address has the optional SSN parameter.
|
boolean |
hasTranslationType()
Determine if the SCCP Address has the optional Translation Type parameter.
|
boolean |
isNational()
Determine if the SCCP Address has the National Use indicator set.
|
boolean |
routeOnPC()
Determine if the SCCP Address has the Route On Point Code indicator set.
|
void |
setAddress(String address)
Set the optional Global Title Address parameter.
|
void |
setEncodingScheme(int encoding)
Set the optional Encoding Scheme parameter.
|
void |
setGlobalTitleIndicator(SccpAddress.GTIndicator gt)
Set the optional Global Title Indicator parameter.
|
void |
setNational(boolean national)
Set the National Use indicator.
|
void |
setNatureOfAddress(int nature)
Set the optional Nature Of Address parameter.
|
void |
setNumberingPlan(int plan)
Set the optional Numbering Plan parameter.
|
void |
setPointCode(int pc)
Set the optional Point Code as a single decimal value.
|
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).
|
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).
|
void |
setRouteOnPC(boolean routeOnPC)
Set the Route On Point Code indicator.
|
void |
setSSN(int ssn)
Set the optional SSN parameter.
|
void |
setTranslationType(int tt)
Set the optional Translation Type parameter.
|
void |
toStream(DataOutput out)
Serialize the state of this object to a stream.
|
String |
toString() |
checkModify, isReadOnly, setReadOnly
public static final int SSN_UNKNOWN
public static final int SSN_SCCP_MANAGEMENT
public static final int SSN_ISDN_USER_PART
public static final int SSN_OMAP
public static final int SSN_MAP
public static final int SSN_HLR
public static final int SSN_VLR
public static final int SSN_MSC
public static final int SSN_EIC
public static final int SSN_AUC
public static final int SSN_ISDN_SUPPLEMENTARY_SERVICES
public static final int SSN_BROADBAND_ISDN
public static final int SSN_TC_TEST_RESPONDER
public static final int NATURE_UNKNOWN
public static final int NATURE_SUBSCRIBER_NUMBER
public static final int NATURE_NATIONAL_NUMBER
public static final int NATURE_INTERNATIONAL_NUMBER
public static final int NUMBERING_PLAN_UNKNOWN
public static final int NUMBERING_PLAN_ISDN
public static final int NUMBERING_PLAN_GENERIC
public static final int NUMBERING_PLAN_DATA
public static final int NUMBERING_PLAN_TELEX
public static final int NUMBERING_PLAN_MARITIME_MOBILE
public static final int NUMBERING_PLAN_LAND_MOBILE
public static final int NUMBERING_PLAN_ISDN_MOBILE
public static final int NUMBERING_PLAN_PRIVATE
public SccpAddress(SccpAddress.Type addressType)
addressType
- the type of address.public SccpAddress(DataInput in) throws IOException
in
- the DataInput
to read the SCCP address state from.IOException
- if an I/O error occurs reading from the specified
DataInput
.public SccpAddress.Type getAddressType()
public boolean isNational()
true
.public void setNational(boolean national)
national
- the new value for the National Use indicator.public boolean routeOnPC()
true
if the Route On Point Code indicator is set,
false
otherwise.public void setRouteOnPC(boolean routeOnPC)
routeOnPC
- the new value for the Route On Point Code indicator.public boolean hasPointCode()
true
if the SCCP address has the Point Code parameter,
false
otherwise.public void setPointCode(int pc)
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.
pc
- the Point Code. Must be in the range 0-0xffffff.IllegalArgumentException
- if the value of pc
is not
within the specified range.public int getPointCode()
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.
-1
if none has been set.public void clearPointCode()
public void setPointCodeMemberClusterNetwork(int member, int cluster, int network)
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.IllegalArgumentException
- if the value of any parameter is not within
the specified range.public int[] getPointCodeMemberClusterNetwork()
{ member, cluster, network }
,
or null
if a Point Code has not been set.public void setPointCodeZoneAreaSignalPoint(int zone, int area, int signalPoint)
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.IllegalArgumentException
- if the value of any parameter is not within
the specified range.public int[] getPointCodeZoneAreaSignalPoint()
{ zone, area, signal-point }
,
or null
if a Point Code has not been set.public boolean hasSSN()
true
if the SCCP Address has the SSN parameter,
false
otherwise.public int getSSN()
-1
if none has been set.public void setSSN(int ssn)
ssn
- the SSN. Must be in the range 0-255.IllegalArgumentException
- if the value of ssn
is out of
the allowed range.public void clearSSN()
public boolean hasGlobalTitleIndicator()
true
if a Global Title Indicator is present,
false
otherwise.public SccpAddress.GTIndicator getGlobalTitleIndicator()
GT_0000
if no GTI is presentpublic void setGlobalTitleIndicator(SccpAddress.GTIndicator gt)
gt
- the Global Titile Indicator; if GT_0000 is specified, the GTI is cleared.NullPointerException
- if gt
is not within the
specified range.public void clearGlobalTitleIndicator()
public boolean hasNatureOfAddress()
true
if the SCCP Address has the Nature Of Address
parameter, false
otherwise.public int getNatureOfAddress()
-1
if none has been set.public void setNatureOfAddress(int nature)
nature
- the Nature Of Address. This value must be in the range
[0,127].IllegalArgumentException
- if nature
is not within the
specified range.public void clearNatureOfAddress()
public boolean hasTranslationType()
true
if the SCCP Address has the Translation Type
parameter, false
otherwise.public int getTranslationType()
-1
if none has been set.public void setTranslationType(int tt)
tt
- the Translation Type. This value must be in the range [0,255].IllegalArgumentException
- if tt
is not within the
specified range.public void clearTranslationType()
public boolean hasNumberingPlan()
true
if the SCCP Address has the Numbering Plan
parameter, false
otherwise.public int getNumberingPlan()
-1
if none has been set.public void setNumberingPlan(int plan)
plan
- the Numbering Plan. This value must be in the range [0,15].IllegalArgumentException
- if plan
is not within the
specified range.public void clearNumberingPlan()
public boolean hasEncodingScheme()
true
if the SCCP Address has the Encoding Scheme
parameter, false
otherwise.public int getEncodingScheme()
-1
if none has been set.public void setEncodingScheme(int encoding)
encoding
- the Encoding Scheme. This value must be in the range [0,15].IllegalArgumentException
- if encoding
is not within the
specified range.public void clearEncodingScheme()
public boolean hasAddress()
true
if the SCCP Address has the Global Title Address
parameter, false
otherwise.public String getAddress()
null
if none has been set.public void setAddress(String address)
address
- the Global Title Address. May be null
to remove
any previous value set.public static byte[] encodeAscii(String address)
address
- the address to encode.IllegalArgumentException
- if the address contains invalid characters.public static String decodeAscii(byte[] encoded)
encoded
- the address to decode.public static byte[] encodeBinary(String address)
address
- the address to encode.IllegalArgumentException
- if the address contains invalid characters.public static String decodeBinary(byte[] encoded)
encoded
- the address to decode.public static byte[] encodeBCD(String address)
address
- the address to encode.public static String decodeBCD(byte[] encoded, boolean odd)
encoded
- address to decode.odd
- whether or not the encoded address has an odd number of digits.public void toStream(DataOutput out) throws IOException
FastSerializable
toStream
in interface FastSerializable
out
- the stream to serialize to.IOException
- if an error occurs during serializationpublic SccpAddress clone()
DataObject
Inherently immutable objects may optionally return the same object without modification from clone(), rather than constructing a new instance.
clone
in interface DataObject
clone
in class AbstractDataObject
public static SccpAddress copyOf(SccpAddress from)