|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgldapo.entry.GldapoEntry
public abstract class GldapoEntry
The API reference for schema classes.
Schema classes do not extend this class
(i.e. schemaObject instanceof GldapoEntry will return false.)
| Constructor Summary | |
|---|---|
GldapoEntry()
|
|
| Method Summary | |
|---|---|
boolean |
authenticate(String password)
Test if password is this entry's password. |
void |
create()
Writes the object in it's entirety to the directory. |
void |
delete()
Removes the entry specified by this object's brdn from the directory. |
void |
deleteRecursively()
Removes the entry specified by this object's brdn from the directory, and all it's children. |
static GldapoEntry |
find()
Peform a search (using default options), returning the first object found. |
static List<GldapoEntry> |
find(Closure closure)
Calls find(Map), with a filter option of closure. |
static GldapoEntry |
find(Map options)
Peform a search, but returning the first object found. |
static List<GldapoEntry> |
find(Map options,
Closure closure)
Calls find(Map), after setting filter in options to closure |
static GldapoEntry |
findAll()
Peforms a search using all default options. |
static List<GldapoEntry> |
findAll(Closure closure)
Calls findAll(Map), with a filter option of closure. |
static List<GldapoEntry> |
findAll(Map options)
Performs a search returning all of the matching entries. |
static List<GldapoEntry> |
findAll(Map options,
Closure closure)
Calls findAll(Map), after setting filter in options to closure |
DistinguishedName |
getBrdn()
The Base Relative Distinguished Name for this entry. |
static GldapoEntry |
getByDn(Object dn)
Fetches the entry at dn from the the default directory. |
static GldapoEntry |
getByDn(Object dn,
Object directory)
Fetches the entry at dn from directory. |
GldapoDirectory |
getDirectory()
The connection to an actual LDAP directory. |
DistinguishedName |
getDn()
The absolute location of this entry in it's directory. |
String |
getNamingAttribute()
The name of the property that is used to define this entry's name. |
String |
getNamingValue()
The value for the naming attribute. |
DistinguishedName |
getParent()
The dn for the entry in the directory that contains this entry. |
void |
move(Object brdn)
Relocate this object in the directory, after sending any updates. |
void |
move(Object namingValue,
Object parent)
Relocate this object in the directory, after sending any updates. |
void |
replace()
Replaces the entry specified by this objects's brdn with this object. |
void |
replace(Object brdn)
Replaces the entry @ brdn with this object. |
void |
replace(Object namingValue,
Object parent)
Replaces the entry at the location specified by namingValue and parent with this
object. |
void |
save()
Creates of updates the object depending on whether it is a new object or not. |
void |
setBrdn(Object brdn)
Set the location of this entry, with a dn relative to the entry's directory base. |
void |
setDirectory(Object directory)
Before an operation (create, update, delete etc.) can be performed on an object, it must have directory to perform the operation against. |
void |
setNamingValue(String value)
Sets the value of the naming attribute. |
void |
setParent(Object parent)
Defines the location for this entry by defining it's parent container. |
void |
update()
Saves any modifications made to this object to the directory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GldapoEntry()
| Method Detail |
|---|
public GldapoDirectory getDirectory()
null if not set yet.
public void setDirectory(Object directory)
throws GldapoDirectoryNotFoundException
directory to perform the operation against.
directory - If not an instance of GldapoDirectory, will be toString()'d
and treated as a directory name and the corresponding directory will be pulled
from the class's gldapo instance.
GldapoDirectoryNotFoundException - If directory is used as a name, and no directory
is registered with that name.
public DistinguishedName getBrdn()
throws GldapoException
base
of the object's directory. It is a combination of the parent, and
namingAttribute/namingValue properties.
GldapoException - if the naming value for this object is null
public void setBrdn(Object brdn)
throws GldapoException
brdn is converted to a string, and then a DistinguishedName.
The leading (leftmost) rdn is seperated from the dn and the value
passed to setNamingValue(String). Any remaining rdns are passed as a single value
to setParent(Object).
brdn - An object whose string representation will be the brdn
GldapoException - if the leading rdn of brdn has a different attribute name
to the defined naming attribute for this class
public DistinguishedName getDn()
throws GldapoException
brdn, plus the base
of this object's directory.
GldapoException - if this object has no directory, or naming value setpublic DistinguishedName getParent()
"" indicates that the entry's parent is the
base of it's directory. If a parent has not been explicitly set,
an empty dn will be returned.
nullpublic void setParent(Object parent)
parent - the string representation of this object will form the parent dnpublic String getNamingValue()
naming attribute.
This defines part of the location/brdn of this entry.
null if not yet set
public void setNamingValue(String value)
throws GldapoException
naming attribute.
This value cannot be changed once set. See move(Object,Object) if you need
to move an entry (i.e. change it's naming value)
value - the naming value
GldapoException - if this object already has a naming valuepublic String getNamingAttribute()
@GldapoNamingAttribute
and is mandatory for schema classes.
null
public static GldapoEntry getByDn(Object dn,
Object directory)
throws GldapoException
dn from directory.
If directory is null, the default directory will
be used.
dn - an object's whose string representation is the dn of the target entrydirectory - if not a directory, an objects whose string representation
is the name of a registered directory
null if there is no entry at dn
GldapoException - if dn or directory are invalid, or an LDAP error occurs.
public static GldapoEntry getByDn(Object dn)
throws GldapoException
dn from the the default directory.
Calls getByDn(dn,null).
GldapoException
public void create()
throws GldapoException
directory. To have
a location, it must at least have a naming value.
GldapoException - If the object is in an invalid state for creating, or an LDAP error occurs.
public void update()
throws GldapoException
creating new objects.
If this object has no modifications, this is a no-op.
GldapoException - if the object is not in a suitable state for updating, or an LDAP error occurs.
public void save()
throws GldapoException
Creates of updates the object depending on whether it is a new object or not.
GldapoException - if the object is not in a suitable state for saving, or an LDAP error occurs.
public void move(Object brdn)
throws GldapoException
sending any updates.
brdn - the new brdn of the object (the string representation will be used).
GldapoException - if brdn is invalid, this is not an existing entry, or an LDAP error occurs.
public void move(Object namingValue,
Object parent)
throws GldapoException
sending any updates.
namingValue - the new naming value (the string representation will be used). If null,
the existing naming value will be used.parent - the new parent container (the string representation will be used). If null,
the existing parent value will be used. Use "" to specify no parent.
GldapoException - if brdn is invalid, this is not an existing entry, or an LDAP error occurs.
public void replace(Object brdn)
throws GldapoException
brdn with this object.
brdn - the location of the entry to replace (the string representation will be used).
GldapoException - if this object has no directory, or and LDAP error occurs.
public void replace(Object namingValue,
Object parent)
throws GldapoException
namingValue and parent with this
object.
namingValue - the replacee's naming value (the string representation will be used). If null,
this object's naming value will be used.parent - the replacee's parent container (the string representation will be used). If null,
this object's parent value will be used. Use "" to specify no parent.
GldapoException - if this object has no directory, or and LDAP error occurs.
public void replace()
throws GldapoException
brdn with this object.
GldapoException - if this object has no directory, no valid brdn, or and LDAP error occurs.
public void delete()
throws GldapoException
brdn from the directory.
This will fail if the entry has children, use deleteRecursively() in that case.
GldapoException - if this object has no directory, no valid brdn, or and LDAP error occurs.
public void deleteRecursively()
throws GldapoException
brdn from the directory, and all it's children.
GldapoException - if this object has no directory, no valid brdn, or and LDAP error occurs.
public boolean authenticate(String password)
throws GldapoException
password is this entry's password.
GldapoException - if this object has no location or directory defined, or an LDAP error occurs
public static List<GldapoEntry> findAll(Map options)
throws GldapoException
The options map can contain the following items (but requires none):
| Key | Value Description |
|---|---|
directory | The directory to use. Either by name or instance. If null, the default directory will be used |
filter | The filter used to restrict the search (string value will be used, or passed to filter builder if Closure). Will be anded with the schema filter if present. |
base | The dn (relative to the base of the directory) to start the search at. If null, the directory base will be used. |
absoluteBase | The dn to start the search at, but absolutely, not relative to the directory base. |
searchScope | A string indicating the scope of the search (either "object", "onelevel" or "subtree") |
pageSize | The number of entries to return in one page. If null or less than 1, paging will not be used |
countLimit | The maximum amount of entries for the server to return. No limit is used if null. (be mindful that some servers set limits server side) |
timeLimit | The maximum number of milliseconds to spend searching. No limit is used if null. (be mindful that some servers set limits server side) |
derefLinkFlag | A boolean to enable/disable link dereferencing during the search. |
Values override the default search options defined by the target directory. Where an option is omitted from options,
the value from the directory's set options.
If the filter option is a closure, it will be used with FilterBuilder to build the filter string.
GldapoException - if the proposed options are invalid in anyway, or an LDAP error occurs.
public static List<GldapoEntry> findAll(Map options,
Closure closure)
throws GldapoException
findAll(Map), after setting filter in options to closure
GldapoException
public static List<GldapoEntry> findAll(Closure closure)
throws GldapoException
findAll(Map), with a filter option of closure.
GldapoException
public static GldapoEntry findAll()
throws GldapoException
GldapoException - if the proposed options are invalid in anyway, or an LDAP error occurs.findAll(Map)
public static GldapoEntry find(Map options)
throws GldapoException
options - the same as findAll(Map)
null if not found
GldapoException - if the proposed options are invalid in anyway, or an LDAP error occurs.
public static List<GldapoEntry> find(Map options,
Closure closure)
throws GldapoException
find(Map), after setting filter in options to closure
GldapoException
public static List<GldapoEntry> find(Closure closure)
throws GldapoException
find(Map), with a filter option of closure.
GldapoException
public static GldapoEntry find()
throws GldapoException
null if not found
GldapoException - if the proposed options are invalid in anyway, or an LDAP error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||