org.aselect.server.tgt
Class TGTManager

java.lang.Object
  extended by org.aselect.system.storagemanager.StorageManager
      extended by org.aselect.server.tgt.TGTManager

public class TGTManager
extends StorageManager

The A-Select Server TGT manager.

Description:
Creates TGT's and storages them in a storage manager.

Concurrency issues:
-

Author:
Alfa & Ariss

Method Summary
 java.lang.String createTGT(java.util.Hashtable htTGTContext)
          Creates a new TGT for the supplied data and stores it in the storage manager.
static TGTManager getHandle()
          Method to return an instance of the TGTManager instead of using the constructor.
 java.util.Hashtable getTGT(java.lang.String sTGT)
          Returns the tgt context for the tgt specified in sTGT.
 long getTGTCounter()
          Returns the number of TGT's that are created by the TGT manager for monitoring purposes.
 void init()
          Initializes the A-Select TGT Manager.
 boolean updateTGT(java.lang.String sTGT, java.util.Hashtable htTGTContext)
          Updates a valid tgt context with a new one.
 
Methods inherited from class org.aselect.system.storagemanager.StorageManager
containsKey, destroy, get, getAll, getCount, getExpirationTime, getTimestamp, init, put, remove, removeAll, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHandle

public static TGTManager getHandle()
Method to return an instance of the TGTManager instead of using the constructor.

Returns:
always the same TGTManager instance.

init

public void init()
          throws ASelectException
Initializes the A-Select TGT Manager.

Description:
  • Reads the ticket manager configuration
  • Initializes the StorageManager object
  • Resets the _lTGTCounter


  • Concurrency issues:
    -

    Preconditions:
  • The ASelectSystemLogger must be initialized
  • The ASelectConfigManager must be initialized


  • Postconditions:
    All class variables are created and initialized.

    Throws:
    ASelectException - if config is missing or the configured information is incorrect

    createTGT

    public java.lang.String createTGT(java.util.Hashtable htTGTContext)
                               throws ASelectException
    Creates a new TGT for the supplied data and stores it in the storage manager.

    Description:
    Generates a tgt of TGT_LENGTH random bytes. It is made sure that the tgt is not present in the current tgt table. The variable htTGTContext contains information from the caller. The caller can retrieve this information by calling the getTGT() method.

  • checks if the maximum TGT's are reached
  • generates a unique tgt
  • stores the ticket to the storage manager
  • increases the tgt counter for monitoring purposes


  • Concurrency issues:
    -

    Preconditions:
    -

    Postconditions:
    -

    Parameters:
    htTGTContext - The context of the TGT that will be created.
    Returns:
    the created TGT.
    Throws:
    ASelectException - If creation fails.

    updateTGT

    public boolean updateTGT(java.lang.String sTGT,
                             java.util.Hashtable htTGTContext)
    Updates a valid tgt context with a new one.

    Description:
    Overwrites the context of the supplied TGT with supplied context with the one in the storage manager if the TGT already exists.

    Concurrency issues:
    -

    Preconditions:
    -

    Postconditions:
    -

    Parameters:
    sTGT - The TGT that must be updated
    htTGTContext - The new context of the TGT
    Returns:
    TRUE if the TGT context is updated.

    getTGT

    public java.util.Hashtable getTGT(java.lang.String sTGT)
    Returns the tgt context for the tgt specified in sTGT.

    Parameters:
    sTGT - The A-Select TGT created with the createTGT method
    Returns:
    a Hashtable containing the TGT context

    getTGTCounter

    public long getTGTCounter()
    Returns the number of TGT's that are created by the TGT manager for monitoring purposes.

    Returns:
    the number of TGT's created by this TGT manager


    Copyright © 2008 SURFnet BV. All Rights Reserved.