|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectno.feide.moria.directory.index.SerializableIndex
public class SerializableIndex
A serializable index implementation, used for offline generation of a new index.
Field Summary | |
---|---|
private java.util.HashMap |
associations
Internal list of associations; that is, the mapping between logical ID realms (as String s) - following the 'at' character - and
search base references (as String arrays). |
private java.util.HashMap |
exceptions
Internal list of exceptions to the associations; that is, explicitly indexed logical IDs (as String s) to full external
references (as String s). |
private java.util.HashMap |
passwords
Internal list of passwords for each association/exception. |
private java.util.HashMap |
realms
Internal list of realms for each exception. |
(package private) static long |
serialVersionUID
Serial version identifier. |
private java.util.HashMap |
usernames
Internal list of usernames for each association/exception. |
Constructor Summary | |
---|---|
SerializableIndex()
|
Method Summary | |
---|---|
void |
addAssociation(java.lang.String realm,
java.lang.String base,
java.lang.String username,
java.lang.String password)
Adds a new realm-to-base association to the index. |
void |
addException(java.lang.String id,
java.lang.String reference,
java.lang.String realm)
Add a new search exception (exception to the basic rule of realm-to-base associations) to this index. |
boolean |
equals(java.lang.Object obj)
Checks whether two index instances are equal. |
java.lang.String |
getPassword(java.lang.String base)
Return the password associated with a given base. |
java.lang.String |
getRealm(java.lang.String id)
Looks up which realm a given identifier belongs to. |
IndexedReference[] |
getReferences(java.lang.String id)
Looks up an element reference from the index based on its logical ID (typically username). |
java.lang.String |
getUsername(java.lang.String base)
Return the username associated with a given base. |
int |
hashCode()
Generates a hashCode. |
java.lang.String |
toString()
Gives a string representation of the object, for visual debugging. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
static final long serialVersionUID
private java.util.HashMap associations
String
s) - following the 'at' character - and
search base references (as String
arrays).
private java.util.HashMap exceptions
String
s) to full external
references (as String
s).
private java.util.HashMap realms
exceptions
, but the elements of this list give
the explicit realm (as String
s) for each exception.
private java.util.HashMap usernames
private java.util.HashMap passwords
Constructor Detail |
---|
public SerializableIndex()
Method Detail |
---|
public final boolean equals(java.lang.Object obj)
String
representation as given by toString()
.
equals
in class java.lang.Object
obj
- The other SerializableIndex
object to compare
to.
true
if two SerializableIndex
objects are equal, otherwise false
. Two instances
are equal if and only if their lists of associations, exceptions
and realms are equal.Object.equals(java.lang.Object)
,
toString()
public final int hashCode()
hashCode
in class java.lang.Object
java.lang.UnsupportedOperationException
- Always.public final IndexedReference[] getReferences(java.lang.String id)
identifier-at-realm
, similar to an email
address. This is not a requirement for looking up references
in the exception list, and therefore the 'at' character is not required
in the logical ID.
getReferences
in interface DirectoryManagerIndex
id
- The logical identifier to look up.
null
if no such reference was found.DirectoryManagerIndex.getReferences(String)
public final java.lang.String getRealm(java.lang.String id)
getRealm
in interface DirectoryManagerIndex
id
- The logical identifier to get realm for.
null
if
no such realm could be found.DirectoryManagerIndex.getRealm(String)
public final void addAssociation(java.lang.String realm, java.lang.String base, java.lang.String username, java.lang.String password)
realm
- The realm (typically user realm) related to this base. Cannot
be null
.base
- The association. In practical use this will be an LDAP search
base similar to
ldap://some.ldap.server:636/dc=search,dc=base
.
Cannot be null
.username
- The username to be used when performing searches on this
association's base. May not be null
.password
- The password to be used when performing searches on this
association's base. May not be null
.
java.lang.IllegalArgumentException
- If either realm
,base
,
username
, or password
is
null
.public final void addException(java.lang.String id, java.lang.String reference, java.lang.String realm)
id
- The identifier for this exception, typically a user ID. Cannot
be null
.reference
- The reference. In practical use this will be an LDAP element
reference similar to
ldap://some.ldap.server:636/uid=id,dc=search,dc=base
.
Cannot be null
.realm
- The actual realm of the reference, which may not be given by
the identifier (on the form user@realm , for example).
Since moving between realms while keeping an unchanged
identifier is possible, this must be taken into account.
java.lang.IllegalArgumentException
- If either id
or reference
is
null
.public final java.lang.String toString()
toString
in class java.lang.Object
String
, includes
separate lists of associations and exceptions.public final java.lang.String getUsername(java.lang.String base) throws java.lang.IllegalArgumentException
getUsername
in interface DirectoryManagerIndex
base
- The search base. May not be null
or an empty
string.
base
. May be an
empty string, but will never be null
even though
the base
does not exist.
java.lang.IllegalArgumentException
- If base
is null
or an empty
string.public final java.lang.String getPassword(java.lang.String base) throws java.lang.IllegalArgumentException
getPassword
in interface DirectoryManagerIndex
base
- The search base. May not be null
or an empty
string.
base
. May be an
empty string, but will never be null
even though
the base
does not exist.
java.lang.IllegalArgumentException
- If base
is null
or an empty
string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |