issrg.utils.repository
Class WebDAVRepository

java.lang.Object
  extended by issrg.utils.repository.DefaultRepository
      extended by issrg.utils.repository.WebDAVRepository
All Implemented Interfaces:
AttributeRepository

public class WebDAVRepository
extends DefaultRepository


Field Summary
 
Fields inherited from interface issrg.utils.repository.AttributeRepository
FAILURE_STATUS, INHERENT_FAILURE_STATUS, PARTIAL_SUCCESS_STATUS, SUCCESS_STATUS
 
Constructor Summary
WebDAVRepository(java.lang.String host, int port)
           
WebDAVRepository(java.lang.String host, int port, SAMLSecurity security)
           
WebDAVRepository(java.lang.String host, int port, java.lang.String p12filename, java.lang.String p12passphrase)
           
 
Method Summary
 javax.naming.directory.Attributes getAllAttributes(java.security.Principal DN)
          This method gets all the attributes from the entry with the DN.
 javax.naming.directory.Attributes getAttributes(java.security.Principal DN, java.lang.String[] attrNames)
          This method does the same as getAttribute for each of the specified attributes in the attribute list.
 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.
 
Methods inherited from class issrg.utils.repository.DefaultRepository
getAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebDAVRepository

public WebDAVRepository(java.lang.String host,
                        int port)

WebDAVRepository

public WebDAVRepository(java.lang.String host,
                        int port,
                        java.lang.String p12filename,
                        java.lang.String p12passphrase)

WebDAVRepository

public WebDAVRepository(java.lang.String host,
                        int port,
                        SAMLSecurity security)
Method Detail

getAttributes

public javax.naming.directory.Attributes getAttributes(java.security.Principal DN,
                                                       java.lang.String[] attrNames)
                                                throws RepositoryException
Description copied from interface: AttributeRepository
This method does the same as getAttribute for each of the specified attributes in the attribute list. It looks in the named entry for the set of attributes. It returns any of the attributes found. Some of the attributes may be missing in the entry.

Parameters:
DN - is the Principal, for which to retrieve the attributes
attrNames - is an array of repository attribute names of the attributes to return; returns all attributes available, if the array is null
Returns:
an Attributes object with multiple values for each attribute, retrieved from the Repository; can be either an empty set of attributes or null, if no such attributes exist
Throws:
RepositoryException

getAllAttributes

public javax.naming.directory.Attributes getAllAttributes(java.security.Principal DN)
                                                   throws RepositoryException
Description copied from class: DefaultRepository
This method gets all the attributes from the entry with the DN. It does the same as getAttributes(DN, null).

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

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