sun.security.mule.jgss
Class TokenTracker

java.lang.Object
  extended by sun.security.mule.jgss.TokenTracker

public class TokenTracker
extends Object

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.

Since:
1.4
Author:
Mayank Upadhyay

Constructor Summary
TokenTracker(int initNumber)
           
 
Method Summary
 void getProps(int number, MessageProp prop)
          Sets the sequencing and replay information for the given token number.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TokenTracker

public TokenTracker(int initNumber)
Method Detail

getProps

public final 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.)


toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.