|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object issrg.utils.repository.VirtualRepository
public class VirtualRepository
This is the class for representing the virtual repository of ACs and ACRLs for the push model. It can be used to store other attributes, too.
Field Summary | |
---|---|
protected RepositoryException |
diagnosis
This is the diagnostic message reference; it is null, if everything was OK |
protected java.util.Map |
repository
This is the actual repository. |
Fields inherited from interface issrg.utils.repository.AttributeRepository |
---|
FAILURE_STATUS, INHERENT_FAILURE_STATUS, PARTIAL_SUCCESS_STATUS, SUCCESS_STATUS |
Constructor Summary | |
---|---|
VirtualRepository()
|
Method Summary | |
---|---|
javax.naming.directory.Attributes |
get(java.lang.String DN)
This method allows the caller to access the Attributes of the given entry, which can be useful for updating the entry's contents (remove or replace attributes or their values). |
javax.naming.directory.Attributes |
getAllAttributes(java.security.Principal DN)
This method returns all available attributes from the entry. |
javax.naming.directory.Attribute |
getAttribute(java.security.Principal DN,
java.lang.String attributeID)
This method returns the values of the requested attribute from a given entry. |
javax.naming.directory.Attributes |
getAttributes(java.security.Principal DN,
java.lang.String[] attributeIDs)
This method returns the attributes from the given entry. |
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. |
byte[] |
loadPKC(java.lang.String pkcattribute,
java.io.File f)
This method loads a PKC from the given file, populates this repository with the DN taken from the PKC, and returns the byte array that has been placed in the repository. |
void |
populate(java.lang.String DN,
java.lang.String attributeName,
java.lang.Object value)
This method allows the caller to place the given value of the named attribute in the specified entry. |
javax.naming.directory.Attributes |
remove(java.lang.String DN)
This method destroys the whole entry: all the data is lost; the former contents of the entry is returned. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map repository
protected final RepositoryException diagnosis
Constructor Detail |
---|
public VirtualRepository()
Method Detail |
---|
public void populate(java.lang.String DN, java.lang.String attributeName, java.lang.Object value)
DN
- is the canonical LDAP DN of the entryattributeName
- is the name of the attributevalue
- is the value to add to the attributepublic byte[] loadPKC(java.lang.String pkcattribute, java.io.File f) throws java.io.IOException
java.io.IOException
public javax.naming.directory.Attributes get(java.lang.String DN)
DN
- is the canonical LDAP DN of the entry to retrieve
public javax.naming.directory.Attributes remove(java.lang.String DN)
DN
- is the canonical LDAP DN of the entry to remove
public javax.naming.directory.Attribute getAttribute(java.security.Principal DN, java.lang.String attributeID)
getAttribute
in interface AttributeRepository
DN
- is the name of the entryattributeID
- is the name of the attribute to return
public javax.naming.directory.Attributes getAttributes(java.security.Principal DN, java.lang.String[] attributeIDs)
getAttributes
in interface AttributeRepository
DN
- - the entry name; its getName() should return the canonical nameattributeIDs
- - the array of attribute names; if null, all available
attributes are returned
public javax.naming.directory.Attributes getAllAttributes(java.security.Principal DN)
getAllAttributes
in interface AttributeRepository
DN
- - the entry name; its getName method should return the canonical
name
public int getStatus()
AttributeRepository
getStatus
in interface AttributeRepository
AttributeRepository.SUCCESS_STATUS
,
AttributeRepository.FAILURE_STATUS
,
AttributeRepository.PARTIAL_SUCCESS_STATUS
,
AttributeRepository.INHERENT_FAILURE_STATUS
public java.lang.Throwable getDiagnosis()
AttributeRepository
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.
getDiagnosis
in interface AttributeRepository
AttributeRepository.getStatus()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |