ie.omk.smpp.message.tlv
Class Tag

java.lang.Object
  extended by ie.omk.smpp.message.tlv.Tag
All Implemented Interfaces:
Serializable

public final class Tag
extends Object
implements Serializable

Enumeration class for optional parameter tag values.

Version:
$Id: Tag.java 380 2007-08-27 23:01:00Z orank $
Author:
Oran Kelly
See Also:
Serialized Form

Field Summary
static Tag ADDITIONAL_STATUS_INFO_TEXT
           
static Tag ALERT_ON_MESSAGE_DELIVERY
           
static Tag CALLBACK_NUM
           
static Tag CALLBACK_NUM_ATAG
           
static Tag CALLBACK_NUM_PRES_IND
           
static Tag DELIVERY_FAILURE_REASON
           
static Tag DEST_ADDR_SUBUNIT
           
static Tag DEST_BEARER_TYPE
           
static Tag DEST_NETWORK_TYPE
           
static Tag DEST_SUBADDRESS
           
static Tag DEST_TELEMATICS_ID
           
static Tag DESTINATION_PORT
           
static Tag DISPLAY_TIME
           
static Tag DPF_RESULT
           
static Tag ITS_REPLY_TYPE
           
static Tag ITS_SESSION_INFO
           
static Tag LANGUAGE_INDICATOR
           
static Tag MESSAGE_PAYLOAD
           
static Tag MESSAGE_STATE
           
static Tag MORE_MESSAGES_TO_SEND
           
static Tag MS_AVAILABILITY_STATUS
           
static Tag MS_MSG_WAIT_FACILITIES
           
static Tag MS_VALIDITY
           
static Tag NETWORK_ERROR_CODE
           
static Tag NUMBER_OF_MESSAGES
           
static Tag PAYLOAD_TYPE
           
static Tag PRIVACY_INDICATOR
           
static Tag QOS_TIME_TO_LIVE
           
static Tag RECEIPTED_MESSAGE_ID
           
static Tag SAR_MSG_REF_NUM
           
static Tag SAR_SEGMENT_SEQNUM
           
static Tag SAR_TOTAL_SEGMENTS
           
static Tag SC_INTERFACE_VERSION
           
static Tag SET_DPF
           
static Tag SMS_SIGNAL
           
static Tag SOURCE_ADDR_SUBUNIT
           
static Tag SOURCE_BEARER_TYPE
           
static Tag SOURCE_NETWORK_TYPE
           
static Tag SOURCE_PORT
           
static Tag SOURCE_SUBADDRESS
           
static Tag SOURCE_TELEMATICS_ID
           
static Tag USER_MESSAGE_REFERENCE
           
static Tag USER_RESPONSE_CODE
           
static Tag USSD_SERVICE_OP
           
 
Method Summary
static Tag defineTag(int tagValue, Class type, Encoder enc, int fixedSize)
          Define a new tag type which has a fixed length.
static Tag defineTag(int tagValue, Class type, Encoder enc, int minSize, int maxSize)
          Define a new tag type with minimum and maximum sizes.
 boolean equals(int tag)
          Test for equality against an integer.
 boolean equals(Object obj)
          Test for equality.
 Encoder getEncoder()
          Get the encoder used to encode values of this tag type.
 int getLength()
          Get the allowed length of a value of this tag type.
 int getMaxLength()
          Get the maximum length of a value of this tag type.
 int getMinLength()
          Get the minimum length of a value of this tag type.
static Tag getTag(int tagValue)
          Get the Tag object that represents tag tagValue.
 Class getType()
          Get the Java type of values of this tag type.
 int hashCode()
          Get the hashCode for this Tag.
 int intValue()
          Get the integer value of this tag.
static boolean isTagDefined(int tagValue)
          Determine if a tag is defined for a particular tag integer value.
 String toHexString()
          Convert this tag to a String.
 String toString()
          Convert this tag to a String.
static Tag undefineTag(Tag tag)
          Undefine a tag.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEST_ADDR_SUBUNIT

public static final Tag DEST_ADDR_SUBUNIT

DEST_NETWORK_TYPE

public static final Tag DEST_NETWORK_TYPE

DEST_BEARER_TYPE

public static final Tag DEST_BEARER_TYPE

DEST_TELEMATICS_ID

public static final Tag DEST_TELEMATICS_ID

SOURCE_ADDR_SUBUNIT

public static final Tag SOURCE_ADDR_SUBUNIT

SOURCE_NETWORK_TYPE

public static final Tag SOURCE_NETWORK_TYPE

SOURCE_BEARER_TYPE

public static final Tag SOURCE_BEARER_TYPE

SOURCE_TELEMATICS_ID

public static final Tag SOURCE_TELEMATICS_ID

QOS_TIME_TO_LIVE

public static final Tag QOS_TIME_TO_LIVE

PAYLOAD_TYPE

public static final Tag PAYLOAD_TYPE

ADDITIONAL_STATUS_INFO_TEXT

public static final Tag ADDITIONAL_STATUS_INFO_TEXT

RECEIPTED_MESSAGE_ID

public static final Tag RECEIPTED_MESSAGE_ID

MS_MSG_WAIT_FACILITIES

public static final Tag MS_MSG_WAIT_FACILITIES

PRIVACY_INDICATOR

public static final Tag PRIVACY_INDICATOR

SOURCE_SUBADDRESS

public static final Tag SOURCE_SUBADDRESS

DEST_SUBADDRESS

public static final Tag DEST_SUBADDRESS

USER_MESSAGE_REFERENCE

public static final Tag USER_MESSAGE_REFERENCE

USER_RESPONSE_CODE

public static final Tag USER_RESPONSE_CODE

SOURCE_PORT

public static final Tag SOURCE_PORT

DESTINATION_PORT

public static final Tag DESTINATION_PORT

SAR_MSG_REF_NUM

public static final Tag SAR_MSG_REF_NUM

LANGUAGE_INDICATOR

public static final Tag LANGUAGE_INDICATOR

SAR_TOTAL_SEGMENTS

public static final Tag SAR_TOTAL_SEGMENTS

SAR_SEGMENT_SEQNUM

public static final Tag SAR_SEGMENT_SEQNUM

SC_INTERFACE_VERSION

public static final Tag SC_INTERFACE_VERSION

CALLBACK_NUM_PRES_IND

public static final Tag CALLBACK_NUM_PRES_IND

CALLBACK_NUM_ATAG

public static final Tag CALLBACK_NUM_ATAG

NUMBER_OF_MESSAGES

public static final Tag NUMBER_OF_MESSAGES

CALLBACK_NUM

public static final Tag CALLBACK_NUM

DPF_RESULT

public static final Tag DPF_RESULT

SET_DPF

public static final Tag SET_DPF

MS_AVAILABILITY_STATUS

public static final Tag MS_AVAILABILITY_STATUS

NETWORK_ERROR_CODE

public static final Tag NETWORK_ERROR_CODE

MESSAGE_PAYLOAD

public static final Tag MESSAGE_PAYLOAD

DELIVERY_FAILURE_REASON

public static final Tag DELIVERY_FAILURE_REASON

MORE_MESSAGES_TO_SEND

public static final Tag MORE_MESSAGES_TO_SEND

MESSAGE_STATE

public static final Tag MESSAGE_STATE

USSD_SERVICE_OP

public static final Tag USSD_SERVICE_OP

DISPLAY_TIME

public static final Tag DISPLAY_TIME

SMS_SIGNAL

public static final Tag SMS_SIGNAL

MS_VALIDITY

public static final Tag MS_VALIDITY

ALERT_ON_MESSAGE_DELIVERY

public static final Tag ALERT_ON_MESSAGE_DELIVERY

ITS_REPLY_TYPE

public static final Tag ITS_REPLY_TYPE

ITS_SESSION_INFO

public static final Tag ITS_SESSION_INFO
Method Detail

intValue

public int intValue()
Get the integer value of this tag.

Returns:
the integer value of this tag.

getLength

public int getLength()
Get the allowed length of a value of this tag type.

Returns:
The allowed length, or the maximum length if a range is set.

getMinLength

public int getMinLength()
Get the minimum length of a value of this tag type.

Returns:
the minimum length of a value of this tag type.

getMaxLength

public int getMaxLength()
Get the maximum length of a value of this tag type.

Returns:
the maximum length of a value of this tag type.

getType

public Class getType()
Get the Java type of values of this tag type.

Returns:
the Java type of values of this tag type.

equals

public boolean equals(Object obj)
Test for equality. Two tags are equal if their integer values are equivalent.

Overrides:
equals in class Object
Returns:
true if obj is Tag and has the same tag value.

equals

public boolean equals(int tag)
Test for equality against an integer.

Returns:
true if this Tag's integer value is equal to tag.

hashCode

public int hashCode()
Get the hashCode for this Tag. The hashCode for a Tag is the same as:
new Integer(tag.tagValue()).hashCode()

Overrides:
hashCode in class Object
Returns:
A hash code for this tag.

toString

public String toString()
Convert this tag to a String. This returns a decimal representation of the tag's integer value in a String.

Overrides:
toString in class Object
Returns:
This tag's string value.

toHexString

public String toHexString()
Convert this tag to a String. This returns a hex representation of the tag's integer value in a String.

Returns:
This tag's hexadecimal representation.

getEncoder

public Encoder getEncoder()
Get the encoder used to encode values of this tag type.

Returns:
the encoder used to encode values of this tag type.

getTag

public static Tag getTag(int tagValue)
Get the Tag object that represents tag tagValue. If the tag is known then the static Tag object representing the tag is returned. If the tag is not known, a fresh instance of Tag will be returned which uses an octet-string type.

WARNING The behaviour of this method may change to returning null for an undefined tag. It needs to be determined which behaviour is the best.

Returns:
The Tag object representing the tag tagValue. Will never return null.

defineTag

public static Tag defineTag(int tagValue,
                            Class type,
                            Encoder enc,
                            int fixedSize)
                     throws TagDefinedException
Define a new tag type which has a fixed length.

Parameters:
tagValue - the integer value of the tag.
type - the parameter type.
enc - the encoder used to serialize and deserialize. This may be null to use the API's default internally defined encoders.
fixedSize - the defined size of the parameter.
Throws:
TagDefinedException - if an attempt is made to define a tag with a integer value equivalent to an already defined tag.
See Also:
Encoder

defineTag

public static Tag defineTag(int tagValue,
                            Class type,
                            Encoder enc,
                            int minSize,
                            int maxSize)
                     throws TagDefinedException
Define a new tag type with minimum and maximum sizes.

Parameters:
tagValue - the integer value of the tag.
type - the parameter type.
enc - the encoder used to serialize and deserialize. This may be null to use the API's default internally defined encoders.
minSize - the minimum size of the parameter.
maxSize - the maximum size of the parameter.
Throws:
TagDefinedException - if an attempt is made to define a tag with a integer value equivalent to an already defined tag.
See Also:
Encoder

isTagDefined

public static boolean isTagDefined(int tagValue)
Determine if a tag is defined for a particular tag integer value.

Parameters:
tagValue - The integer value of the tag.
Returns:
true if the tag is defined, false otherwise.

undefineTag

public static Tag undefineTag(Tag tag)
Undefine a tag. This removes all knoweledge of this tag type from the internal tables. If there is no such tag defined already, this method will do nothing.

Parameters:
tag - The tag to undefine. null if there was no tag defined already.
Returns:
The Tag object that has been undefined.


Copyright © 2011 smppapi at Sourceforge. All Rights Reserved.