|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AttributeRepository
This interface defines the basic methods that can be performed on a read-only repository. It provides methods for retrieving attributes from a given entry (attributes and entries are terms like for the Directory). Besides this the caller can enquire on the status of the repository between calls to react more intelligently should an outage occur.
Note that some terms (like DN) are Directory-like, but in fact they are treated in a quite general fashion, and the interface does not require them to be DNs, if the implementation uses a different naming convention.
For better multi-threaded support it is advised that the methods were NOT synchronized, so that multiple threads could request attributes simultaneously. Note also that if you do need them to be synchronized, make sure that there will be no recursive invocation of it from multiple threads. For example, MultiRepository spawns multiple threads that often invoke the same MultiRepository; if somehow your repository invokes getAttributes on the same MultiRepository that called it, the synchronized method in your repository may block execution. So the remedy is: don't wrap repositories that may call you, or don't use synchronized methods.
MultiRepository
Field Summary | |
---|---|
static int |
FAILURE_STATUS
This is a status code for when an unrecoverable error occurred. |
static int |
INHERENT_FAILURE_STATUS
This is when the repository failed to process a request because any of the previous calls returned an unfavourable result. |
static int |
PARTIAL_SUCCESS_STATUS
This is a status code for when the repository succeeded to execute the call only partially. |
static int |
SUCCESS_STATUS
This is a status code for when everything is alright with the repository. |
Method Summary | |
---|---|
javax.naming.directory.Attributes |
getAllAttributes(java.security.Principal DN)
This method returns the collection of all attributes and all of their values. |
javax.naming.directory.Attribute |
getAttribute(java.security.Principal DN,
java.lang.String AttributeName)
This method returns the given attribute or null, if the attribute is not present in the given entry of the repository. |
javax.naming.directory.Attributes |
getAttributes(java.security.Principal DN,
java.lang.String[] AttributeNames)
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. |
Field Detail |
---|
static final int SUCCESS_STATUS
static final int FAILURE_STATUS
static final int PARTIAL_SUCCESS_STATUS
static final int INHERENT_FAILURE_STATUS
Method Detail |
---|
javax.naming.directory.Attribute getAttribute(java.security.Principal DN, java.lang.String AttributeName) throws RepositoryException
getAttributes(DN, new String[]{AttributeName});
though, returns one attribute only.
DN
- is the Principal, for which to retrieve the attributeAttributeName
- is a repository attribute name of the attribute to
return
RepositoryException,
- if no such entry exists, or other error occurs
during the call
RepositoryException
javax.naming.directory.Attributes getAttributes(java.security.Principal DN, java.lang.String[] AttributeNames) throws RepositoryException
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.
DN
- is the Principal, for which to retrieve the attributesAttributeNames
- is an array of repository attribute names of
the attributes to
return; returns all attributes available, if the array is null
RepositoryException,
- if no such entry exists, or other error occurs
during the call
RepositoryException
javax.naming.directory.Attributes getAllAttributes(java.security.Principal DN) throws RepositoryException
getAttributes(DN, null);
DN
- is the Principal, for which to retrieve the attributes
RepositoryException,
- if no such entry exists, or other error occurs
during the call
RepositoryException
int getStatus()
SUCCESS_STATUS
,
FAILURE_STATUS
,
PARTIAL_SUCCESS_STATUS
,
INHERENT_FAILURE_STATUS
java.lang.Throwable getDiagnosis()
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.
getStatus()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |