public class

TokenTracker

extends Object
java.lang.Object
   ↳ sun.security.jgss.TokenTracker

Class Overview

A utility class that implements a number list that keeps track of which tokens have arrived by storing their token numbers in the list. It helps detect old tokens, out of sequence tokens, and duplicate tokens. Each element of the list is an interval [a, b]. Its existence in the list implies that all token numbers in the range a, a+1, ..., b-1, b have arrived. Gaps in arrived token numbers are represented by the numbers that fall in between two elements of the list. eg. {[a,b], [c,d]} indicates that the token numbers b+1, ..., c-1 have not arrived yet. The maximum number of intervals that we keep track of is MAX_INTERVALS. Thus if there are too many gaps, then some of the older sequence numbers are deleted from the list. The earliest sequence number that exists in the list is the windowStart. The next expected sequence number, or expectedNumber, is one greater than the latest sequence number in the list. The list keeps track the first token number that should have arrived (initNumber) so that it is able to detect if certain numbers occur after the first valid token number but before windowStart. That would happen if the number of elements (intervals) exceeds MAX_INTERVALS and some initial elements had to be deleted. The working of the list is optimized for the normal case where the tokens arrive in sequence.

Summary

Public Constructors
TokenTracker(int initNumber)
Public Methods
synchronized final void getProps(int number, MessageProp prop)
Sets the sequencing and replay information for the given token number.
String toString()
Returns a string representation of the object.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public TokenTracker (int initNumber)

Public Methods

public final synchronized void getProps (int number, MessageProp prop)

Sets the sequencing and replay information for the given token number. The following represents the number line with positions of initNumber, windowStart, expectedNumber marked on it. Regions in between them show the different sequencing and replay state possibilites for tokens that fall in there. (1) windowStart initNumber expectedNumber | | ---|---------------------------|--- GAP | DUP/UNSEQ | GAP (2) initNumber windowStart expectedNumber | | | ---|---------------|--------------|--- GAP | OLD | DUP/UNSEQ | GAP (3) windowStart expectedNumber initNumber | | ---|---------------------------|--- DUP/UNSEQ | GAP | DUP/UNSEQ (4) expectedNumber initNumber windowStart | | | ---|---------------|--------------|--- DUP/UNSEQ | GAP | OLD | DUP/UNSEQ (5) windowStart expectedNumber initNumber | | | ---|---------------|--------------|--- OLD | DUP/UNSEQ | GAP | OLD (This analysis leaves out the possibility that expectedNumber passes initNumber after wrapping around. That may be added later.)

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
  • a string representation of the object.