org.openpermis.repository.basic
Class StreamSubjectRepository

java.lang.Object
  extended by org.openpermis.repository.basic.AbstractSubjectRepository
      extended by org.openpermis.repository.basic.StreamSubjectRepository
All Implemented Interfaces:
SubjectRepository
Direct Known Subclasses:
FileSubjectRepository, UrlSubjectRepository

public class StreamSubjectRepository
extends AbstractSubjectRepository

Abstract subject repository that reads attribute certificates from streams.

The stream subject repository manages its own subject map and provides all the necessary methods for concrete implementations.

Implementation classes are expected to populate the subject repository using either addAttributeCertificate(InputStream) or addAttributeCertificate(AttributeCertificate).

Since:
0.3.0

Constructor Summary
StreamSubjectRepository(CertificateVerifier certificateVerifier)
          Creates an abstract subject repository and uses the specified certificate verifier to validate the attribute certificates.
 
Method Summary
protected  void addAttributeCertificate(AttributeCertificate ac)
          Adds an attribute certificate to the subject repository.
protected  void addAttributeCertificate(InputStream is)
          Adds an attribute certificate to the subject repository.
 Subject retrieveSubject(URI identity)
          Returns a subject whose identity matches the one specified.
 
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

StreamSubjectRepository

public StreamSubjectRepository(CertificateVerifier certificateVerifier)
Creates an abstract subject repository and uses the specified certificate verifier to validate the attribute certificates.

Parameters:
certificateVerifier - the certificate verifier user to verify the the attribute certificates, must not be null.
Since:
0.3.0
Method Detail

addAttributeCertificate

protected void addAttributeCertificate(InputStream is)
                                throws IOException,
                                       NoSuchAlgorithmException,
                                       NoSuchProviderException
Adds an attribute certificate to the subject repository.

The input stream passed in is not closed.

Parameters:
is - the input stream containing the DER encoded attribute certificate, must not be null.
See Also:
AttributeCertificate.AttributeCertificate(InputStream), AbstractSubjectRepository.updateSubjectMap(Map, AttributeCertificate), addAttributeCertificate(AttributeCertificate)
Throws:
IOException - if there is a read or decoding error.
NoSuchProviderException - passed on.
NoSuchAlgorithmException - passed on.
Since:
0.3.0

addAttributeCertificate

protected void addAttributeCertificate(AttributeCertificate ac)
                                throws NoSuchAlgorithmException,
                                       NoSuchProviderException
Adds an attribute certificate to the subject repository.

Parameters:
ac - the attribute certificate to add, must not be null.
See Also:
AbstractSubjectRepository.updateSubjectMap(Map, AttributeCertificate)
Throws:
NoSuchProviderException - passed on.
NoSuchAlgorithmException - passed on.
Since:
0.3.0

retrieveSubject

public Subject retrieveSubject(URI identity)
                        throws SubjectRepositoryException
Description copied from interface: SubjectRepository
Returns a subject whose identity matches the one specified.

Parameters:
identity - a URI that identifies a subject.
Returns:
a Subject associating a person with her assigned roles. The returned subject is never null, but will have no assigned roles for unknown identities.
Throws:
SubjectRepositoryException - when the repository fails to retrieve the roles for the specified identity.
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