issrg.pba
Class MultiAuthzTokenParser

java.lang.Object
  extended by issrg.pba.MultiAuthzTokenParser
All Implemented Interfaces:
AuthzTokenParser, RoleBasedAuthzTokenParser

public class MultiAuthzTokenParser
extends java.lang.Object
implements RoleBasedAuthzTokenParser

Author:
Linying Su

Constructor Summary
MultiAuthzTokenParser()
          Creates a new instance of MultiAuthTokenParser
 
Method Summary
 void associate(java.lang.String repository, java.lang.String parser)
          this method is used to associate a repository with an auth token parser to .
 ParsedToken decode(java.lang.Object token)
          This method decodes a given RawCredential object.
 java.util.Map getAuthzTokenParsingRules()
          This method returns the Authorisation Token Parsing Rules, as a Map with a single entry with the key issrg.pba.rbac.RoleHierarchyPolicy.class and the value being the RoleHierarchyPolicy used by this RoleBasedACParser.
 SignatureVerifier getSignatureVerifier()
          This method returns the SignatureVerifier used by this RoleBasedACParser.
 void register(java.lang.String className)
          this method is used to register an auth token parser.
 void setAuthzTokenParsingRules(java.util.Map m)
          This method sets the Authorisation Token Parsing Rules.
 void setRoleHierarchy(RoleHierarchyPolicy rhpn)
          This method sets the Authorisation Token Parsing Rules by directly specifying the Role Hierarchy to be used.
 void setSignatureVerifier(SignatureVerifier signatureVerifier)
          This method sets the SignatureVerifier to be used to validate the X.509 Attribute Certificates.
 void unregister(java.lang.String className)
          this method is used to unregister an auth token parser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiAuthzTokenParser

public MultiAuthzTokenParser()
Creates a new instance of MultiAuthTokenParser

Method Detail

setRoleHierarchy

public void setRoleHierarchy(RoleHierarchyPolicy rhpn)
This method sets the Authorisation Token Parsing Rules by directly specifying the Role Hierarchy to be used.

Specified by:
setRoleHierarchy in interface RoleBasedAuthzTokenParser
Parameters:
rhpn - - the RoleHierarchyPolicy to be used; if null, decoding the credentias will always fail

getAuthzTokenParsingRules

public java.util.Map getAuthzTokenParsingRules()
This method returns the Authorisation Token Parsing Rules, as a Map with a single entry with the key issrg.pba.rbac.RoleHierarchyPolicy.class and the value being the RoleHierarchyPolicy used by this RoleBasedACParser.

Specified by:
getAuthzTokenParsingRules in interface AuthzTokenParser
Returns:
Map of rules; this implementation fills a single entry with the key issrg.pba.rbac.RoleHierarchyPolicy.class and the value being the RoleHierarchyPolicy; if the RoleHierarchyPolicy has not been set, the Map does not contain any entries

setSignatureVerifier

public void setSignatureVerifier(SignatureVerifier signatureVerifier)
This method sets the SignatureVerifier to be used to validate the X.509 Attribute Certificates.

Specified by:
setSignatureVerifier in interface AuthzTokenParser
Parameters:
signatureVerifier - is the SignatureVerifier used to validate the ACs; if null, no signature verification will be performed (SHOULD NOT BE USED IN PRODUCTION SCENARIOS!)

getSignatureVerifier

public SignatureVerifier getSignatureVerifier()
This method returns the SignatureVerifier used by this RoleBasedACParser.

Specified by:
getSignatureVerifier in interface AuthzTokenParser
Returns:
SignatureVerifier used by this RoleBasedACParser, or null, if no signature verification is being performed.

setAuthzTokenParsingRules

public void setAuthzTokenParsingRules(java.util.Map m)
This method sets the Authorisation Token Parsing Rules. It should contain a issrg.pba.rbac.RoleHierarchyPolicy in the entry with the key issrg.pba.rbac.RoleHierarchyPolicy.class.

Specified by:
setAuthzTokenParsingRules in interface AuthzTokenParser
Parameters:
m - - the Map of rules with a RoleHierarchyPolicy inside

decode

public ParsedToken decode(java.lang.Object token)
                   throws PbaException
This method decodes a given RawCredential object. It can not be null.

Specified by:
decode in interface AuthzTokenParser
Parameters:
token - - implementation-specific object returned by the Repository; it is the authorisation token to be decoded
Returns:
the ParsedToken representing a Attribute Certificate
Throws:
PbaException, - if no Role Hierarchy Policy has been specified through the constructor or either of the methods, or if there was a problem when decoding the Authorisation Token
PbaException - if any error occurs; for example, the given object is not a proper Authorisation Token that the implementation can handle

register

public void register(java.lang.String className)
this method is used to register an auth token parser.

Parameters:
className - is the class name of the auth token parser.

unregister

public void unregister(java.lang.String className)
this method is used to unregister an auth token parser.

Parameters:
className - is the class name of the auth token parser.

associate

public void associate(java.lang.String repository,
                      java.lang.String parser)
this method is used to associate a repository with an auth token parser to .

Parameters:
parser - is the class name of the auth token parser.
repos - is the class name of the repository.