org.openpermis.repository.basic
Class UrlSubjectRepository

java.lang.Object
  extended by org.openpermis.repository.basic.AbstractSubjectRepository
      extended by org.openpermis.repository.basic.StreamSubjectRepository
          extended by org.openpermis.repository.basic.UrlSubjectRepository
All Implemented Interfaces:
SubjectRepository

public class UrlSubjectRepository
extends StreamSubjectRepository

A subject repository containing certificates from a list of URLs.

Since:
0.3.0

Constructor Summary
UrlSubjectRepository(CertificateVerifier certificateVerifier, URL... urls)
          Creates a file directory subject repository from directory and the specified certificate verifier.
 
Method Summary
static UrlSubjectRepository createClasspathSubjectRepository(CertificateVerifier certificateVerifier, Class<?> clazz, String... resources)
          Creates a subject repository for a list of attribute certificates loaded as resources from a class loader.
static UrlSubjectRepository createClasspathSubjectRepository(CertificateVerifier certificateVerifier, ClassLoader classLoader, String... resources)
          Creates a subject repository for a list of attribute certificates loaded as resources from a class loader.
 
Methods inherited from class org.openpermis.repository.basic.StreamSubjectRepository
addAttributeCertificate, addAttributeCertificate, retrieveSubject
 
Methods inherited from class org.openpermis.repository.basic.AbstractSubjectRepository
updateSubjectMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UrlSubjectRepository

public UrlSubjectRepository(CertificateVerifier certificateVerifier,
                            URL... urls)
                     throws SubjectRepositoryException
Creates a file directory subject repository from directory and the specified certificate verifier.

Parameters:
certificateVerifier - the certificate verifier user to verify the the attribute certificates, must not be null.
urls - a list of URLs pointing to attribute certificates to be added, must not be null.
Throws:
SubjectRepositoryException - if the repository cannot be built.
Since:
0.3.0
Method Detail

createClasspathSubjectRepository

public static UrlSubjectRepository createClasspathSubjectRepository(CertificateVerifier certificateVerifier,
                                                                    ClassLoader classLoader,
                                                                    String... resources)
                                                             throws SubjectRepositoryException
Creates a subject repository for a list of attribute certificates loaded as resources from a class loader.

Uses the Thread.getContextClassLoader() as a fallback if a resource cannot be retrieved using the specified class loader.

Parameters:
certificateVerifier - the certificate verifier user to verify the the attribute certificates, must not be null.
classLoader - the class loader to use for retrieving the resource URLs.
resources - list of resource locations to process, must not be null or empty.
See Also:
ClassLoader.getResource(String)
Returns:
the subject repository created.
Throws:
SubjectRepositoryException - if the repository cannot be built or if there is a problem retrieving a resource.
Since:
0.3.0

createClasspathSubjectRepository

public static UrlSubjectRepository createClasspathSubjectRepository(CertificateVerifier certificateVerifier,
                                                                    Class<?> clazz,
                                                                    String... resources)
                                                             throws SubjectRepositoryException
Creates a subject repository for a list of attribute certificates loaded as resources from a class loader.

Parameters:
certificateVerifier - the certificate verifier user to verify the the attribute certificates, must not be null.
clazz - the class to use for retrieving the resource URLs.
resources - list of resource locations to process, must not be null or empty.
See Also:
Class.getResource(String)
Returns:
the subject repository created.
Throws:
SubjectRepositoryException - if the repository cannot be built or if there is a problem retrieving a resource.
Since:
0.3.0


PERMIS Role Based Access Control 0.3.0 (Build 14)
2009/05/08 09:06:10
Copyright (c) 2002-2007 Ergon Informatik AG