issrg.simplePERMIS
Class SimplePERMISAuthzTokenRepository

java.lang.Object
  extended by issrg.simplePERMIS.SimplePERMISAuthzTokenRepository
All Implemented Interfaces:
AuthzTokenRepository

public class SimplePERMISAuthzTokenRepository
extends java.lang.Object
implements AuthzTokenRepository

This class implements the AuthTokenRepository interface. When contructing an instance, the underlying AttributeRepository shall be specified, and the associated AuthTokenParser. The associated AuthTokenParser will be used to parse the tokens stored on the specified repository.

Author:
Gansen

Constructor Summary
SimplePERMISAuthzTokenRepository(AttributeRepository repository, AuthzTokenParser parser)
          Constructor of the SimpleSAMTokenRepository.
SimplePERMISAuthzTokenRepository(java.lang.String AttributeName, AttributeRepository repository, AuthzTokenParser parser)
          Constructor of the SimpleSAMAutoRokenRepository.
 
Method Summary
 java.lang.String getAttributeName()
           
 AuthzTokenParser getAuthTokenParser()
           
 javax.naming.directory.Attribute getAuthTokens(TokenLocator subject)
          This function retrieves the authorisation token for the specified subject.
 ParsedToken[] getParsedAuthTokens(TokenLocator subject)
          This function returned the parsed authorisation tokens of the specified subject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimplePERMISAuthzTokenRepository

public SimplePERMISAuthzTokenRepository(java.lang.String AttributeName,
                                        AttributeRepository repository,
                                        AuthzTokenParser parser)
Constructor of the SimpleSAMAutoRokenRepository.
It creates a new instance of SimpleSAMAuthTokenRepository, and specify the name of the attribute. This constructor will automatically create a internal repository.

Parameters:
AttributeName - The name of the attribute that is considered as the authorisation token. The AttributeName will be used by the SimpleSAMAuthTokenRepository object to retrieve the token from the repository that keeps all related attributes and tokens.
repository - The repository that keeps all tokens
parser - The parser that will be used to parse the tokens stored on the repository.

SimplePERMISAuthzTokenRepository

public SimplePERMISAuthzTokenRepository(AttributeRepository repository,
                                        AuthzTokenParser parser)
Constructor of the SimpleSAMTokenRepository. It takes as input the repository that keeps all tokens, and the token parser.

This constructor will assume that the authorisation token is named as "simpleSAM-Attribute". This may be in conflit with some attributes kept by the source repository that are also named as "simpleSAM-Attribute". Further, the source repository must make sure that the authorisation token is named as "simpleSAM-Attribute" for the SimpleSAMAuthTokenRepository to be able to find it.

Parameters:
repository - The source repository that keeps the authorisation tokens.
parser - The parser that is used to parse the authorisation token retrieved from the repository.
Method Detail

getAttributeName

public java.lang.String getAttributeName()
Returns:
the attribute name.

getAuthTokenParser

public AuthzTokenParser getAuthTokenParser()
Returns:
the object token parser.

getAuthTokens

public javax.naming.directory.Attribute getAuthTokens(TokenLocator subject)
                                               throws PbaException
This function retrieves the authorisation token for the specified subject.

Specified by:
getAuthTokens in interface AuthzTokenRepository
Parameters:
subject - The subject specifies whose attributes are needed.
Returns:
The authorisation tokens of the specified subject; never null, but the Attribute may have no values.
Throws:
PbaException - in case of any error while retrieving the tokens

getParsedAuthTokens

public ParsedToken[] getParsedAuthTokens(TokenLocator subject)
                                  throws PbaException
This function returned the parsed authorisation tokens of the specified subject.

Specified by:
getParsedAuthTokens in interface AuthzTokenRepository
Parameters:
subject - The subject specifies whose attributes are needed.
Returns:
Authorisation tokens of the specified subjects in the parsed form.
Throws:
PbaException