issrg.utils.repository
Class SAMLRepository

java.lang.Object
  extended by issrg.utils.repository.DefaultRepository
      extended by issrg.utils.repository.SAMLRepository
All Implemented Interfaces:
AttributeRepository
Direct Known Subclasses:
VOMSSAMLRepository

public abstract class SAMLRepository
extends DefaultRepository

Author:
Linying Su

Field Summary
 
Fields inherited from interface issrg.utils.repository.AttributeRepository
FAILURE_STATUS, INHERENT_FAILURE_STATUS, PARTIAL_SUCCESS_STATUS, SUCCESS_STATUS
 
Constructor Summary
SAMLRepository(java.net.URL urlIn, SAMLMetaInfo info, SAMLSecurity sec)
          Creates a new instance of SAMLRepository
 
Method Summary
 javax.naming.directory.Attribute getAllAssertions(java.security.Principal DN)
          this method acts as a SAML client to get a SAML Response.
 javax.naming.directory.Attribute getAttribute(java.security.Principal DN, java.lang.String AttributeName)
          This method gets the named attribute from the entry with the DN.
 javax.naming.directory.Attributes getAttributes(java.security.Principal DN, java.lang.String[] attrNames)
          This method returns the specified attributes or empty set, if the attributes are not present.
 java.lang.Throwable getDiagnosis()
          This method returns the last Exception thrown or an exception the Repository wanted to throw very much, but did not, only because the error was not fatal.
 int getStatus()
          This method returns the status of the Repository.
 void setSAMLPort(java.lang.String name)
           
 
Methods inherited from class issrg.utils.repository.DefaultRepository
getAllAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAMLRepository

public SAMLRepository(java.net.URL urlIn,
                      SAMLMetaInfo info,
                      SAMLSecurity sec)
Creates a new instance of SAMLRepository

Method Detail

setSAMLPort

public void setSAMLPort(java.lang.String name)

getAttribute

public javax.naming.directory.Attribute getAttribute(java.security.Principal DN,
                                                     java.lang.String AttributeName)
                                              throws RepositoryException
This method gets the named attribute from the entry with the DN. It does effectively the same as getAttributes(DN, new String[]{AttributeName}).get(AttributeName);

Specified by:
getAttribute in interface AttributeRepository
Overrides:
getAttribute in class DefaultRepository
Parameters:
DN - The distinguished name
AttributeName - The LDAP name for the attribute
Returns:
Attribute containing all the values that could be retrieved; null, if for any reason no attribute values could be retrieved; the status and diagnosis are refreshed
Throws:
RepositoryException
See Also:
getAttributes(java.security.Principal,String[])

getAttributes

public javax.naming.directory.Attributes getAttributes(java.security.Principal DN,
                                                       java.lang.String[] attrNames)
                                                throws RepositoryException
This method returns the specified attributes or empty set, if the attributes are not present.

Parameters:
DN - is the subject DN.
attrNames - is depreciated here
Returns:
an Attribute object with multiple values for each attribute, retrieved from the Repository; can be an empty set of attributes, if no attribute exist.
Throws:
RepositoryException, - if no such entry exists, or other error occurs during the call.
RepositoryException

getAllAssertions

public javax.naming.directory.Attribute getAllAssertions(java.security.Principal DN)
                                                  throws RepositoryException
this method acts as a SAML client to get a SAML Response.

Parameters:
DN - iidentifies the subject, whose attributes will be extracted from the SAML Response.
attrNames - are attribute names, which are used as a filter. Only the SAML Response, which contains some specified attributes, can be returned. Otherwise, an empty set is returned.
Throws:
RepositoryException

getDiagnosis

public java.lang.Throwable getDiagnosis()
Description copied from interface: AttributeRepository
This method returns the last Exception thrown or an exception the Repository wanted to throw very much, but did not, only because the error was not fatal.

TODO: I am very keen to remove getStatus() method, and return DiagnosisException only; which will contain the status code in it and a reference to an embedded exception. Thus it will be possible to throw such an exception in cases of need, and still it will be possible to keep it for further information. I envisage that the PbaException is one of this sort: a DiagnosisException.

Returns:
the last Throwable the Repository was eager to throw or has thrown
See Also:
AttributeRepository.getStatus()

getStatus

public int getStatus()
Description copied from interface: AttributeRepository
This method returns the status of the Repository.

Returns:
one of the *_STATUS values
See Also:
AttributeRepository.SUCCESS_STATUS, AttributeRepository.FAILURE_STATUS, AttributeRepository.PARTIAL_SUCCESS_STATUS, AttributeRepository.INHERENT_FAILURE_STATUS