org.jabber.jabberbeans
Class IdentifierCounter

java.lang.Object
  |
  +--org.jabber.jabberbeans.IdentifierCounter

public class IdentifierCounter
extends java.lang.Object
implements java.io.Serializable

This counter is used to add a unique identifier to outgoing messages, so that the message can be linked to an error message should one be reported by the server. The default value of the counter starts at 0, and is incremented by 1 for each new identifier that is created.

Version:
$Revision: 1.1.1.1 $
Author:
David Waite <dwaite@jabber.com>, $Author: lucky $
See Also:
Serialized Form

Field Summary
private static int currentValue
          current value of the counter
 
Constructor Summary
private IdentifierCounter()
           
 
Method Summary
static java.lang.String getNewIdentifier()
          return an identifier for use in creating a message.
static void setValue(int newVal)
          Set the value of the counter.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

currentValue

private static int currentValue
current value of the counter
Constructor Detail

IdentifierCounter

private IdentifierCounter()
Method Detail

getNewIdentifier

public static java.lang.String getNewIdentifier()
return an identifier for use in creating a message.
Returns:
new (unique by session) identifier

setValue

public static void setValue(int newVal)
Set the value of the counter. The next value returned will be newVal + 1.