Package org.apache.camel.component.smpp
Class SmppSplitter
- java.lang.Object
-
- org.apache.camel.component.smpp.SmppSplitter
-
- Direct Known Subclasses:
Smpp8BitSplitter,SmppDefaultSplitter,SmppNLSTSplitter,SmppUcs2Splitter
public class SmppSplitter extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static intMAX_MSG_BYTE_LENGTHThe maximum length of the message in bytes.protected static intMAX_SEG_COUNTThe maximum amount of segments in the multipart message.protected static intUDHIE_HEADER_LENGTHThe length of the UDH in bytes.protected static intUDHIE_HEADER_REAL_LENGTHThe real length of the UDH header.protected static byteUDHIE_IDENTIFIER_SARThe value that identifier length of the SAR fragment.protected static byteUDHIE_SAR_LENGTHThe length of the SAR fragment.protected static intUDHIE_SAR_REF_NUM_LENGTHThe length of the reference number of the SAR fragmet of the UDH header.
-
Constructor Summary
Constructors Modifier Constructor Description protectedSmppSplitter(int messageLength, int segmentLength, int currentLength)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCurrentLength()Gets length of the message to split.protected static bytegetCurrentReferenceNumber()intgetMessageLength()Gets maximum message length.protected static bytegetReferenceNumber()Returns reference number which length isUDHIE_SAR_REF_NUM_LENGTH.intgetSegmentLength()Gets maximum segment length.protected booleanisSplitRequired()protected static voidresetCurrentReferenceNumber()only needed for the unit testsbyte[][]split(byte[] message)
-
-
-
Field Detail
-
UDHIE_HEADER_LENGTH
protected static final int UDHIE_HEADER_LENGTH
The length of the UDH in bytes. The real length of the header must be 6 bytes, but the first byte that contains the length of the header must not be counted.- See Also:
- Constant Field Values
-
UDHIE_HEADER_REAL_LENGTH
protected static final int UDHIE_HEADER_REAL_LENGTH
The real length of the UDH header. The real length of the UDH header isUDHIE_HEADER_LENGTH+ 1.- See Also:
UDHIE_HEADER_LENGTH, Constant Field Values
-
UDHIE_SAR_REF_NUM_LENGTH
protected static final int UDHIE_SAR_REF_NUM_LENGTH
The length of the reference number of the SAR fragmet of the UDH header. The length can be 1 or 2 bytes and is considered to be 1 byte.- See Also:
- Constant Field Values
-
UDHIE_IDENTIFIER_SAR
protected static final byte UDHIE_IDENTIFIER_SAR
The value that identifier length of the SAR fragment.0x00value must be used if the length of the reference number is 1 byte.
0x08value must be used if the length of the reference number is 2 bytes.- See Also:
- Constant Field Values
-
UDHIE_SAR_LENGTH
protected static final byte UDHIE_SAR_LENGTH
The length of the SAR fragment.0x03value must be used if the length of the reference number is 1 byte.
0x04value must be used if the length of the reference number is 2 bytes.- See Also:
- Constant Field Values
-
MAX_MSG_BYTE_LENGTH
protected static final int MAX_MSG_BYTE_LENGTH
The maximum length of the message in bytes.- See Also:
- Constant Field Values
-
MAX_SEG_COUNT
protected static final int MAX_SEG_COUNT
The maximum amount of segments in the multipart message.- See Also:
- Constant Field Values
-
-
Method Detail
-
getReferenceNumber
protected static byte getReferenceNumber()
Returns reference number which length isUDHIE_SAR_REF_NUM_LENGTH.- Returns:
- the reference number of the multipart message
-
getCurrentReferenceNumber
protected static byte getCurrentReferenceNumber()
-
resetCurrentReferenceNumber
protected static void resetCurrentReferenceNumber()
only needed for the unit tests
-
split
public byte[][] split(byte[] message)
-
isSplitRequired
protected boolean isSplitRequired()
-
getMessageLength
public int getMessageLength()
Gets maximum message length.- Returns:
- maximum message length
-
getSegmentLength
public int getSegmentLength()
Gets maximum segment length.- Returns:
- maximum segment length
-
getCurrentLength
public int getCurrentLength()
Gets length of the message to split.- Returns:
- length of the message to split
-
-