issrg.simplePERMIS
Class SimplePERMISTokenParser

java.lang.Object
  extended byissrg.simplePERMIS.SimplePERMISTokenParser
All Implemented Interfaces:
AuthTokenParser, RoleBasedAuthTokenParser

public class SimplePERMISTokenParser
extends java.lang.Object
implements RoleBasedAuthTokenParser

This class implements the RoleBasedAuthTokenParser interface. It is

Author:
Romain & Gansen

Field Summary
protected  RoleHierarchyPolicy roleHierarchy
           
 
Constructor Summary
SimplePERMISTokenParser()
           
 
Method Summary
 ParsedToken decode(java.lang.Object creds)
          modified by romain 03/03/2006 This method decodes the credentials if possible.
 java.util.Map getAuthTokenParsingRules()
          This method gets the Auth Token parsing rules.
 SignatureVerifier getSignatureVerifier()
          This method gets the Signature Verifier used by the Token Parser.
 void setAuthTokenParsingRules(java.util.Map m)
          This method sets the Auth Token parsing rules.
 void setRoleHierarchy(RoleHierarchyPolicy rhp)
          Set the Role Hierarchy Policy.
 void setSignatureVerifier(SignatureVerifier sv)
          This method sets the signature verifier for the parser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

roleHierarchy

protected RoleHierarchyPolicy roleHierarchy
Constructor Detail

SimplePERMISTokenParser

public SimplePERMISTokenParser()
Method Detail

setRoleHierarchy

public void setRoleHierarchy(RoleHierarchyPolicy rhp)
Set the Role Hierarchy Policy. The policy defines the types of the roles, the values of the roles of each type, and the hierarchical relationship between them.

Specified by:
setRoleHierarchy in interface RoleBasedAuthTokenParser
Parameters:
rhp - is a reference to the Role Hierarchy

setAuthTokenParsingRules

public void setAuthTokenParsingRules(java.util.Map m)
This method sets the Auth Token parsing rules.

Specified by:
setAuthTokenParsingRules in interface AuthTokenParser

getAuthTokenParsingRules

public java.util.Map getAuthTokenParsingRules()
This method gets the Auth Token parsing rules.

Specified by:
getAuthTokenParsingRules in interface AuthTokenParser
Returns:
The parsing rules of thype Map.

decode

public ParsedToken decode(java.lang.Object creds)
                   throws PbaException
modified by romain 03/03/2006 This method decodes the credentials if possible. If the credential is already parsed, it returned it in a ParsedToken type, otherwise, it tries to use the object as a SimpleSAMPrincipal and parses it.

Specified by:
decode in interface AuthTokenParser
Parameters:
creds - The credentials to be parsed.
Returns:
The parsed form of the credential.
Throws:
PbaException - if any error occurs; for example, the given object is not a proper Authorisation Token that the implementation can handle

setSignatureVerifier

public void setSignatureVerifier(SignatureVerifier sv)
This method sets the signature verifier for the parser. Since SimpleSAMTokenParser does not care about signatures, the method simply discards the input parameter and return true.

Specified by:
setSignatureVerifier in interface AuthTokenParser

getSignatureVerifier

public SignatureVerifier getSignatureVerifier()
Description copied from interface: AuthTokenParser
This method gets the Signature Verifier used by the Token Parser. Token Parsers for tokens that do not have signatures may return null. If the Signature Verifier has not been set yet, the method may return null.

Specified by:
getSignatureVerifier in interface AuthTokenParser