ie.omk.smpp.util
Interface SequenceNumberScheme

All Known Implementing Classes:
DefaultSequenceScheme

public interface SequenceNumberScheme

SMPP packet sequence numbering scheme interface. Implementations of this interface provide a Connectionwith a unique number for each call to nextNumber. This number is used as the packet's sequence number in the SMPP header. The default implementation ( DefaultSequenceScheme) counts monotonically from 1 upwards for each number requested. While this is the SMPP specification's recommended behaviour, there is no requirement for 2 sequentially-requested numbers to be numerically sequential.

Version:
1.0
Author:
Oran Kelly

Field Summary
static int PEEK_UNSUPPORTED
           
 
Method Summary
 int nextNumber()
          Get the next number in this sequence's scheme.
 int peek()
          Get the next number in this sequence's scheme without causing it to move to the next-in-sequence.
 int peek(int nth)
          Get the nth next number in this sequence's scheme without causing it to move to the next-in-sequence.
 void reset()
          Reset the sequence scheme to the beginning of the sequence.
 

Field Detail

PEEK_UNSUPPORTED

static final int PEEK_UNSUPPORTED
See Also:
Constant Field Values
Method Detail

nextNumber

int nextNumber()
Get the next number in this sequence's scheme. An implementation of this interface must guard against multi-threaded access to this method to prevent more than one thread getting the same sequence number.


peek

int peek()
Get the next number in this sequence's scheme without causing it to move to the next-in-sequence. This method returns the number that will be returned by the next call to nextNumber without actually increasing the sequence. Multiple calls to peek will return the same number until a call to nextNumber is made.


peek

int peek(int nth)
Get the nth next number in this sequence's scheme without causing it to move to the next-in-sequence. This method returns the nth next number in the sequence. This is an optional operation. If a sequence numbering scheme does not support this operation, it should always return PEEK_UNSUPPORTEDto the caller.


reset

void reset()
Reset the sequence scheme to the beginning of the sequence.



Copyright © 2011 smppapi at Sourceforge. All Rights Reserved.