g-Eclipse
Release 1.0.0

eu.geclipse.core.auth
Class AbstractAuthenticationToken

java.lang.Object
  extended by eu.geclipse.core.auth.AbstractAuthenticationToken
All Implemented Interfaces:
IAuthenticationToken

public abstract class AbstractAuthenticationToken
extends java.lang.Object
implements IAuthenticationToken

Abstract implementation of the IAuthenticationToken interface.


Constructor Summary
AbstractAuthenticationToken(IAuthenticationTokenDescription description)
          Construct a new AbstractAuthenticationToken from the specified IAuthenticationTokenDescription.
 
Method Summary
 IAuthenticationTokenDescription getDescription()
          Get the authentication token description that was used to create this token.
 IPath getTokenFile()
          Get the path to the file that contains the token.
static IPath getTokenLocation()
          Get the location in the file system where tokens are saved.
 void setActive(boolean active)
          Either activates or deactivates this token.
 void validate()
          Tries to validate this token, i.e. reads the underlying files or tries to connect to specified authentication authorities in order to verify the settings that are needed to use/activate this token.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eu.geclipse.core.auth.IAuthenticationToken
getID, getTimeLeft, isActive, isValid, setActive, validate
 

Constructor Detail

AbstractAuthenticationToken

public AbstractAuthenticationToken(IAuthenticationTokenDescription description)
Construct a new AbstractAuthenticationToken from the specified IAuthenticationTokenDescription.

Parameters:
description - The IAuthenticationTokenDescription from which this token should be created.
Method Detail

getTokenLocation

public static IPath getTokenLocation()
Get the location in the file system where tokens are saved. Note that only activated tokens are saved and that they are deleted if they are deactivated.

Returns:
An IPath pointing to the location in the file system where all activated tokens are saved.

getDescription

public IAuthenticationTokenDescription getDescription()
Description copied from interface: IAuthenticationToken
Get the authentication token description that was used to create this token.

Specified by:
getDescription in interface IAuthenticationToken
Returns:
The description from which this token was created.

setActive

public void setActive(boolean active)
               throws AuthenticationException
Description copied from interface: IAuthenticationToken
Either activates or deactivates this token. Depending on the type of token this method may open a connection to the Grid. If the activation procedure is time consuming and/or consists of different independent steps use the IAuthenticationToken.setActive(boolean, IProgressMonitor) method instead.

Specified by:
setActive in interface IAuthenticationToken
Parameters:
active - If true the token will be activated, otherwise it will be deactivated.
Throws:
AuthenticationException - If an error occurs while activating this token.
See Also:
IAuthenticationToken.setActive(boolean, IProgressMonitor)

validate

public void validate()
              throws AuthenticationException
Description copied from interface: IAuthenticationToken
Tries to validate this token, i.e. reads the underlying files or tries to connect to specified authentication authorities in order to verify the settings that are needed to use/activate this token. Depending on the type of token this method may open a connection to the Grid. After the token was successfully validated it should have an unique ID.

Specified by:
validate in interface IAuthenticationToken
Throws:
AuthenticationException - If an error occurs while validating this token.
See Also:
IAuthenticationToken.validate(IProgressMonitor)

getTokenFile

public IPath getTokenFile()
Description copied from interface: IAuthenticationToken
Get the path to the file that contains the token. The token file is created when the token is activated. Before the activation the path may point to an invalid filename.

Specified by:
getTokenFile in interface IAuthenticationToken
Returns:
The path to the token file.

g-Eclipse
Release 1.0.0