|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gridlab.gat.security.SecurityContext
public abstract class SecurityContext
A container for security Information.
Each context has a data object associated with it. The data object is opaque to the GAT API and is used and manipulated by adaptors based upon their interpretation of the context. A globus adaptor could store a GSI credential in it, while an SSH adaptor could store the private key in the data object.
Notes restrict the access to the context because it is a bad idea to broadcast passwords / credentials, so it is useful to restrict those to a set of hosts or adaptors.
Method Summary | |
---|---|
void |
addNote(String key,
String value)
Add notes to this context. |
abstract Object |
clone()
Returns a clone of this context. |
boolean |
containsNoteKey(String key)
Checks whether there exists a note with the given key . |
abstract boolean |
equals(Object obj)
|
Object |
getDataObject(String key)
This method is used by adaptors to get adaptor-specific data associated with this context. |
String |
getNoteValue(String key)
Gets the value belonging to the note with the give key . |
String |
getPassword()
Gets the password. |
String |
getUsername()
Returns the user name. |
abstract int |
hashCode()
|
boolean |
isValidFor(String adaptorName,
String host,
int port)
This method checks the notes associated with this security context, and sees if the context is usable by a particular adaptor. |
void |
putDataObject(String key,
Object data)
This method is used by adaptors to get adaptor-specific data associated with this context. |
void |
removeDataObject(String key)
This method is used by adaptors to remove adaptor-specific data associated with this context. |
void |
setPassword(String password)
Sets the password. |
void |
setUsername(String username)
Sets the user name. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public abstract boolean equals(Object obj)
equals
in class Object
public abstract int hashCode()
hashCode
in class Object
public abstract Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public Object getDataObject(String key)
key
- the key that was used to store the data
public void putDataObject(String key, Object data)
key
- the key that should be used to store the datadata
- the data object that has to be associated with the contextpublic void removeDataObject(String key)
key
- the key that was used to store the datapublic final void addNote(String key, String value)
addNote("host", "machine1.cs.vu.nl")
to indicate that this context is only valid for the machine above. Notes restrict and precise the usage of the authentication data. So an adaptor can verify in advance the usefulness of the authentication data for the host it want to access (e.g. for job submission).
If no notes are defined, adaptors are allowed to use the context for any machine. If at least one note is defined, access is restricted to the adaptor/machine defined in the note(s)
the set of notes known so far is:
Key | Value | Example |
---|---|---|
hosts
| String
| "hostname1:port1,hostname2:port2", where the port is optional |
adaptors
| String
| "adaptorName1,adaptorName2,..." |
There may be more notes that are understood by a particular adaptor.
key
- the name of the notevalue
- the value of the notepublic final boolean containsNoteKey(String key)
key
.
key
- the key to look for
public final String getNoteValue(String key)
key
.
key
- the key to look for
public boolean isValidFor(String adaptorName, String host, int port)
adaptorName
- the name of the adaptor that wants to use this contexthost
- the destination hostnameport
- the destination port
public String getUsername()
public void setUsername(String username)
username
- the user name to setpublic String getPassword()
public void setPassword(String password)
password
- the password to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |