org.gridlab.gat
Class GATContext

java.lang.Object
  extended by org.gridlab.gat.GATContext
All Implemented Interfaces:
Serializable, Cloneable

public class GATContext
extends Object
implements Cloneable, Serializable

An instance of this class is the primary GAT state object.

See Also:
Serialized Form

Constructor Summary
GATContext()
          This no arguments constructor creates an instance of a GATContext.
 
Method Summary
 void addPreference(String key, Object value)
          Adds a single preference to the GATContext which will be used to choose between adaptors if the constructor of an object is not called with a Preferences object.
 void addPreferences(Preferences newPreferences)
          Adds a Preferences object to the GATContext which will be used to choose between adaptors if the constructor of an object is not called with a Preferences object.
 void addSecurityContext(SecurityContext securityContext)
          Adds the passed SecurityContext.
 Object clone()
          Returns a clone of this GATContext.
 boolean equals(Object o)
           
 Preferences getPreferences()
          Returns the Preferences object associated with the GATContext.
 List<SecurityContext> getSecurityContexts()
          Gets the list of SecurityContexts associated with this GATContext.
 List<SecurityContext> getSecurityContextsByType(String type)
          Gets a list of SecurityContexts of the specified type associated with this GATContext.
 int hashCode()
           
 void removePreferences()
          Removes the Preferences object associated with the GATContext.
 void removeSecurityContext(SecurityContext securityContext)
          Removes the passed SecurityContext.
 void removeSecurityContexts()
          Remove all the SecurityContexts associated with this GATContext.
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GATContext

public GATContext()
This no arguments constructor creates an instance of a GATContext.

Method Detail

addSecurityContext

public void addSecurityContext(SecurityContext securityContext)
Adds the passed SecurityContext.

Parameters:
securityContext - A SecurityContext.

removeSecurityContext

public void removeSecurityContext(SecurityContext securityContext)
Removes the passed SecurityContext.

Parameters:
securityContext - A SecurityContext.

getSecurityContexts

public List<SecurityContext> getSecurityContexts()
Gets the list of SecurityContexts associated with this GATContext.

Returns:
List of SecurityContexts.

getSecurityContextsByType

public List<SecurityContext> getSecurityContextsByType(String type)
Gets a list of SecurityContexts of the specified type associated with this GATContext.

Parameters:
type - A SecurityContext type, a String, e.g., org.gridlab.gat.security.PasswordSecurityContext;
Returns:
List of SecurityContexts.

removeSecurityContexts

public void removeSecurityContexts()
Remove all the SecurityContexts associated with this GATContext.


addPreferences

public void addPreferences(Preferences newPreferences)
Adds a Preferences object to the GATContext which will be used to choose between adaptors if the constructor of an object is not called with a Preferences object. Only one such object may be associated with the GATContext at any one time.

Parameters:
newPreferences - A Preferences object.

addPreference

public void addPreference(String key,
                          Object value)
Adds a single preference to the GATContext which will be used to choose between adaptors if the constructor of an object is not called with a Preferences object.

Parameters:
key - The key of the single preference
value - The value that belongs to the key of the single preference

removePreferences

public void removePreferences()
Removes the Preferences object associated with the GATContext.


getPreferences

public Preferences getPreferences()
Returns the Preferences object associated with the GATContext.

Returns:
the Preferences object

clone

public Object clone()
Returns a clone of this GATContext.

Overrides:
clone in class Object
Returns:
the new clone

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object