g-Eclipse
Release 1.0.0

eu.geclipse.core.auth
Class AbstractAuthTokenProvider

java.lang.Object
  extended by eu.geclipse.core.auth.AbstractAuthTokenProvider
All Implemented Interfaces:
IAuthTokenProvider
Direct Known Subclasses:
CoreAuthTokenProvider

public abstract class AbstractAuthTokenProvider
extends java.lang.Object
implements IAuthTokenProvider

Abstract implementation of the IAuthTokenProvider interface that adds some static methods to deal with the extensions of that interface. The most important methods are therefore the static access methods for retrieving authentication tokens.


Constructor Summary
AbstractAuthTokenProvider()
           
 
Method Summary
static boolean isTokenRequestCanceledException(java.lang.Throwable t)
          Checks if the specified Throwable was issued by a token request cancelation.
static IAuthenticationToken staticRequestToken()
          Static access method that calls the corresponding method of the token provider with the highest priority of all currently registered providers.
static IAuthenticationToken staticRequestToken(AuthTokenRequest request)
          Static access method that calls the corresponding method of the token provider with the highest priority of all currently registered providers.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eu.geclipse.core.auth.IAuthTokenProvider
requestToken, requestToken
 

Constructor Detail

AbstractAuthTokenProvider

public AbstractAuthTokenProvider()
Method Detail

isTokenRequestCanceledException

public static boolean isTokenRequestCanceledException(java.lang.Throwable t)
Checks if the specified Throwable was issued by a token request cancelation.

Parameters:
t - The Throwable to be checked.
Returns:
True if the specified Throwable is a ProblemException and the exception's id is equal to ICoreProblems.AUTH_TOKEN_REQUEST_CANCELED.

staticRequestToken

public static IAuthenticationToken staticRequestToken()
                                               throws ProblemException
Static access method that calls the corresponding method of the token provider with the highest priority of all currently registered providers.

Returns:
An authentication token if at least one provider is registered and a token could be found.
Throws:
ProblemException - If a problem occured during the token request. This exception with the ICoreProblems.AUTH_TOKEN_REQUEST_CANCELED id is especially thrown if the token request was canceled by the user.
See Also:
IAuthTokenProvider.requestToken()

staticRequestToken

public static IAuthenticationToken staticRequestToken(AuthTokenRequest request)
                                               throws ProblemException
Static access method that calls the corresponding method of the token provider with the highest priority of all currently registered providers.

Parameters:
request - Request parameters for the token.
Returns:
An authentication token if at least one provider is registered and a token could be found.
Throws:
ProblemException - If a problem occured during the token request. This exception with the ICoreProblems.AUTH_TOKEN_REQUEST_CANCELED id is especially thrown if the token request was canceled by the user.
See Also:
IAuthTokenProvider.requestToken(AuthTokenRequest)

g-Eclipse
Release 1.0.0