|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TLVTable
Map of tag/length/value (TLV) parameters.
TLV stands for Tag/Length/Value and was a capability added to SMPP version 3.4. It is an extensible means of adding new parameter types to SMPP packets. Each optional parameter has a 2-byte tag, which is a unique identifier of that parameter, a 2-byte length, which is an integer value representing the length of the value of the parameter and a value. The value may be of various types including integers, C Strings, octet strings, bit masks etc. The tag defines the type of the value.
TLVs were originally called "optional parameters". SMPP v5 altered this since it introduced the concept of required TLV parameters.
This class holds a mapping of tags to values. Each SMPP packet holds a TLV table which holds that packet's set of current optional parameters. Upon serializing the packet to an output stream or byte array, the format of the serialized packet is:
+-------------------------+
| SMPP Packet |
| +----------------------+|
| | SMPP Header ||
| +----------------------+|
| | ||
| | ||
| | Mandatory parameters ||
| | ||
| | ||
| +----------------------+|
| | Optional parameters ||
| | +------------------+ ||
| | | Tag/Length/Value | ||
| | +------------------+ ||
| | | ... | ||
| | +------------------+ ||
| +----------------------+|
+-------------------------+
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Method Summary | |
|---|---|
Object |
get(int tag)
Get the value for a tag. |
BitSet |
getBitmask(Tag tag)
Get the tag's value as a bit set. |
byte[] |
getBytes(Tag tag)
Get the tag's value as a byte array. |
int |
getInt(Tag tag)
Get the tag's value as an int. |
int |
getLength()
Get the length the parameters in the table would encode as. |
long |
getLong(Tag tag)
Get the tag's value as a long. |
String |
getString(Tag tag)
Get the tag's value as a string. |
Object |
put(Tag tag,
char value)
|
Object |
put(Tag tag,
int value)
|
Object |
put(Tag tag,
long value)
|
Object |
put(Tag tag,
short value)
|
void |
readFrom(PacketDecoder decoder,
int length)
|
void |
remove(int tag)
Remove (or un-set) a tag/value from this table. |
void |
writeTo(PacketEncoder encoder)
|
| Methods inherited from interface java.util.Map |
|---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
| Method Detail |
|---|
void readFrom(PacketDecoder decoder,
int length)
void writeTo(PacketEncoder encoder)
throws IOException
IOExceptionObject get(int tag)
tag - The tag's integer value.String getString(Tag tag)
tag - The tag to retrieve the value for.
null if the specified
tag is not set in this table.int getInt(Tag tag)
tag - The tag to retrieve the value for.
-1 if the specified
tag is not set in this table.
ClassCastException - If the value for the specified tag is not
a number (castable as a java.lang.Number).long getLong(Tag tag)
tag - The tag to retrieve the value for.
-1 if the specified
tag is not set in this table.
ClassCastException - If the value for the specified tag is not
a number (castable as a java.lang.Number).BitSet getBitmask(Tag tag)
tag - The tag to retrieve the value for.
java.util.BitSet, or
null if the specified tag is not set in this table.
ClassCastException - If the value for the specified tag is not
a bit mask.byte[] getBytes(Tag tag)
tag - The tag to retrieve the value for.
byte[], or null
if the specified tag is not set in this table.
ClassCastException - If the value for the specified tag is not
a byte array.
Object put(Tag tag,
char value)
Object put(Tag tag,
short value)
Object put(Tag tag,
int value)
Object put(Tag tag,
long value)
void remove(int tag)
tag - The tag to remove from the table.int getLength()
sizeof (smpp_header) + sizeof (mandatory_parameters)
+ sizeof (optional_parameters).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||