org.mega.gasp.platform
Interface IDManager

All Known Implementing Classes:
IDManagerImpl

public interface IDManager

IDManager provide a management of the temporary IDs: the MasterApplicationID(MAID), ApplicationInstanceID(AIID), SessionID (SID) and ActorSessionID (ASID). These ID must be unique on the platform. For all type of IDs, there is a vector of released ID sort by ID and a meter to insure unicity. A max is set to limit the size of the IDs to improve the length of the message communications, in this version of the platform the type short is used. The algorithm to generate a new ID: the meter is incremented for a new ID attribution if the vector of released ID is empty, else the first ID of the vector is attributed and removed from the vector. The algorithm to release an ID: the meter is decremented if the ID is the max attributed ID and a purge of the vector is done, else the ID is released in the vector and insert at the right place (growing order).

Author:
PELLERIN Romain (pellerin@cnam.fr) - MEGA Project

Method Summary
 int generateAIID()
          Generate an unique ApplicationInstance ID .
 int generateASID()
          Generate an unique ActorSession ID.
 int generateMAID()
          Generate an unique MasterApplication ID.
 int generateSID()
          Generate an unique Session ID.
 void releaseAIID(int tempID)
          Release an ApplicationInstance ID.
 void releaseASID(int tempID)
          Release an ActorSession ID.
 void releaseMAID(int tempID)
          Release a MasterApplication ID.
 void releaseSID(int tempID)
          Release a Session ID.
 

Method Detail

generateMAID

public int generateMAID()
Generate an unique MasterApplication ID.

Returns:
an MAID

generateAIID

public int generateAIID()
Generate an unique ApplicationInstance ID .

Returns:
an AIID

generateSID

public int generateSID()
Generate an unique Session ID.

Returns:
an SID

generateASID

public int generateASID()
Generate an unique ActorSession ID.

Returns:
ASID

releaseMAID

public void releaseMAID(int tempID)
Release a MasterApplication ID.

Parameters:
tempID - the MAID

releaseAIID

public void releaseAIID(int tempID)
Release an ApplicationInstance ID.

Parameters:
tempID - the AIID

releaseSID

public void releaseSID(int tempID)
Release a Session ID.

Parameters:
tempID - the SID

releaseASID

public void releaseASID(int tempID)
Release an ActorSession ID.

Parameters:
tempID - the ASID