g-Eclipse
Release 1.0.0

eu.geclipse.core.auth
Interface IAuthenticationToken

All Known Implementing Classes:
AbstractAuthenticationToken

public interface IAuthenticationToken

This interface is the base of the authentication/authorisation mechanisms within g-Eclipse. It defines methods for activating and for validating authentication tokens. An authentication token has an inner state. It can be active or inactive. An active token is ready to be used for authentication/authorisation. An inactive token holds the values (files, CA locations) that are needed to activate this token.


Method Summary
 IAuthenticationTokenDescription getDescription()
          Get the authentication token description that was used to create this token.
 java.lang.String getID()
          Get an ID that is used to identify this authentication token.
 long getTimeLeft()
          Get the remaining lifetime of this token or -1 if the token will never expire or is inactive.
 IPath getTokenFile()
          Get the path to the file that contains the token.
 boolean isActive()
          Get the current state of this token, i.e. if this token is either active or inactive.
 boolean isValid()
          Returns if this token is currently valid.
 void setActive(boolean active)
          Either activates or deactivates this token.
 void setActive(boolean active, IProgressMonitor progress)
          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.
 void validate(IProgressMonitor progress)
          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.
 

Method Detail

setActive

void setActive(boolean active)
               throws AuthenticationException
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 setActive(boolean, IProgressMonitor) method instead.

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:
setActive(boolean, IProgressMonitor)

setActive

void setActive(boolean active,
               IProgressMonitor progress)
               throws AuthenticationException
Either activates or deactivates this token. Depending on the type of token this method may open a connection to the Grid.

Parameters:
active - If true the token will be activated, otherwise it will be deactivated.
progress - A progress monitor to show the progress of the activation procedure. Normally this is not used when deactivating the token. If the activation procedure is not time critical use setActive(boolean) instead.
Throws:
AuthenticationException - If an error occurs while activating this token.
See Also:
setActive(boolean)

validate

void validate()
              throws AuthenticationException
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.

Throws:
AuthenticationException - If an error occurs while validating this token.
See Also:
validate(IProgressMonitor)

validate

void validate(IProgressMonitor progress)
              throws AuthenticationException
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.

Parameters:
progress - A progress monitor to show the progress of the validation procedure. Normally this is not used when deactivating the token. If the activation procedure is not time critical use validate() instead.
Throws:
AuthenticationException - If an error occurs while validating this token.
See Also:
validate()

isActive

boolean isActive()
Get the current state of this token, i.e. if this token is either active or inactive.

Returns:
True if the token is currently active.

isValid

boolean isValid()
Returns if this token is currently valid. To validate an authentication token use validate().

Returns:
True if the token was already validated.

getDescription

IAuthenticationTokenDescription getDescription()
Get the authentication token description that was used to create this token.

Returns:
The description from which this token was created.

getTimeLeft

long getTimeLeft()
Get the remaining lifetime of this token or -1 if the token will never expire or is inactive.

Returns:
The remaining lifetime if this token is currently active and its lifetime is limited. Otherwise this method returns -1.

getID

java.lang.String getID()
Get an ID that is used to identify this authentication token. The ID should be generated from the validated information of this token. That also means that an invalid token has no valid ID.

Returns:
An identifier that is used to represent this token.
See Also:
validate()

getTokenFile

IPath getTokenFile()
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.

Returns:
The path to the token file.

g-Eclipse
Release 1.0.0