FileDocCategorySizeDatePackage
SnmpRequestCounter.javaAPI DocJava SE 5 API1113Fri Aug 26 14:55:06 BST 2005com.sun.jmx.snmp.daemon

SnmpRequestCounter

public final class SnmpRequestCounter extends Object
A static instance of this class is usually created. It contains a counter that is incremented every time it is accessed. For example, this class can be used in SnmpSession to generate a request identifier that is used to identify a message in a client-server session. The class wraps around when it reaches the maximum positive value, 2^31 - 1.

Fields Summary
int
reqid
A counter with value between 1...2^31-1.
Constructors Summary
public SnmpRequestCounter()


	  
Methods Summary
public synchronized intgetNewId()
Returns the next request identifier.

return
next request identifier. The value wraps to 1 if it reaches negative value.

		if (++reqid  < 0)
			reqid = 1 ;
		return reqid ;