org.openpermis.repository.basic
Class FileSubjectRepository

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

public class FileSubjectRepository
extends StreamSubjectRepository

A subject repository containing certificates from a local directory.

Reads all .ace files in the directory and its sub directories specified at construction time.

Since:
0.1.0
0.3.0 Added support for sub directories.

Field Summary
private static FileFilter ACE_FILE_FILTER
          Filter for .ace files and sub directories.
private static org.slf4j.Logger LOGGER
          The logger object of this class.
 
Constructor Summary
FileSubjectRepository(CertificateVerifier certificateVerifier, File... directories)
          Creates a file directory subject repository from directory and the specified certificate verifier.
 
Method Summary
private  void addAttributeCertificate(File file)
          Adds an attribute certificate for the specified file.
private  void process(File directory)
          Loads all attribute certificates stored in the specified directory.
 
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
 

Field Detail

LOGGER

private static final org.slf4j.Logger LOGGER
The logger object of this class.

Since:
0.3.0

ACE_FILE_FILTER

private static final FileFilter ACE_FILE_FILTER
Filter for .ace files and sub directories.

Since:
0.3.0
Constructor Detail

FileSubjectRepository

public FileSubjectRepository(CertificateVerifier certificateVerifier,
                             File... directories)
                      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.
directories - a list of directories to be searched for .ace files, must not be null.
Throws:
SubjectRepositoryException - if the repository can not be build up.
Since:
0.1.0
0.3.0 Changed order of parameters and used variable length list of directories.
Method Detail

addAttributeCertificate

private void addAttributeCertificate(File file)
                              throws NoSuchAlgorithmException,
                                     NoSuchProviderException,
                                     IOException
Adds an attribute certificate for the specified file.

Parameters:
file - the file containing the DER encoded attribute certificate, must not be null.
Throws:
NoSuchAlgorithmException - passed on.
NoSuchProviderException - passed on.
IOException - if the file cannot be opened or StreamSubjectRepository.addAttributeCertificate(InputStream) reports an error.
See Also:
StreamSubjectRepository.addAttributeCertificate(InputStream)
Since:
0.3.0

process

private void process(File directory)
              throws NoSuchAlgorithmException,
                     NoSuchProviderException,
                     IOException
Loads all attribute certificates stored in the specified directory.

Parameters:
directory - the directory to load the certificates from.
Throws:
IOException - passed on.
NoSuchProviderException - passed on.
NoSuchAlgorithmException - passed on.
See Also:
addAttributeCertificate(File)
Since:
0.3.0


PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:14:59
Copyright (c) 2002-2007 Ergon Informatik AG