|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An enterprise directory is a service that accesses the enterprise naming and directory server using JNDI. It is the entry point into the enterprise directory. After an authenticated binding with the server, the enterprise directory service provides:
Field Summary | |
static java.lang.String |
APPLICATION_CONTEXT
An enterprise directory environment key whose value contains the String representation of the context where application-specific information is stored. |
static java.lang.String |
BASE_CONTEXT
An enterprise directory environment key whose value contains the String representation of the context where ... |
static java.lang.String |
CLASS_MAPPING
A static string used by the EnterpriseDirectory to map class attributes for reflection. |
static java.lang.String |
DEBUG
An enterprise directory environment key whose value contains the PrintStream used for debug messages. |
static java.lang.String |
ENTITY_MAPPING
A static string used by the EnterpriseDirectory to map entity type for reflection. |
static java.lang.String |
GROUP_CONTEXT
An environment key for accessing the base location of group entries. |
static java.lang.String |
PROPERTY_CHANGED
The property change fired when one or more properties in an entity change. |
static java.lang.String |
SUBPROPERTY_CHANGED
The property change fired when one or more properties in an entity contained within the entity change. |
static java.lang.String |
USER_CONTEXT
An environment key for accessing the base location of person entries. |
Method Summary | |
void |
addCacheChangeListener(CacheChangeListener listener)
Add a cache change listener |
void |
addChangeListener(DirectoryChangeListener listener,
java.lang.String dn)
Add an entry change listener. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a property change listener to the listener list. |
void |
cacheChange(java.lang.String dn)
Process a cache change from another source. |
void |
close()
Close the connection to the enterprise directory server and release resources. |
void |
edirAddAttributes(java.lang.String namedObject,
EnterpriseDirectoryAttributes attributes)
Adds attributes to the named object. |
void |
edirCreate(java.lang.String context,
EnterpriseDirectoryAttributes attrs)
Creates an entity in the directory. |
EnterpriseDirectoryAttributes |
edirGetAttribute(java.lang.String context,
java.lang.String attribute)
Retrieve a single named attribute from a directory entry. |
EnterpriseDirectoryAttributes |
edirGetAttributes(java.lang.String namedObject)
Returns the attributes for the named object. |
EnterpriseDirectoryAttributes |
edirGetAttributes(java.lang.String context,
java.lang.String[] attributes)
Retrieve a list of attributes from a directory entry. |
java.util.ListIterator |
edirListIterator(Filter filter)
Given a filter, return a ListIterator of Entities that match that filter. |
java.util.ListIterator |
edirListIterator(Filter filter,
java.util.Comparator compare)
Returns a sorted listIterator of Entities that match the criteria specified in the filter. |
Entity |
edirNewEntity(java.lang.String context,
EnterpriseDirectoryAttributes attributes)
Creates a new entity from attributes retrieved from the directory service. |
void |
edirRemove(java.lang.String context)
Removes an entity from the directory. |
void |
edirRemoveAttributes(java.lang.String namedObject,
EnterpriseDirectoryAttributes attributes)
Removes attributes from the named object. |
void |
edirRemoveSubtree(java.lang.String context)
Removes a subtree from the directory. |
void |
edirReplaceAttributes(java.lang.String namedObject,
EnterpriseDirectoryAttributes attributes)
Replaces attributes in the named object. |
java.util.Enumeration |
edirSearch(SearchFilter filter)
Search the enterprise directory for entries that satisfy the filter. |
java.util.Enumeration |
edirSearch(java.lang.String filter,
EnterpriseDirectorySearchConstraint constraints)
Search the enterprise directory for entries that satisfy the filter and contraints. |
java.util.Enumeration |
edirSearch(java.lang.String context,
java.lang.String filter,
EnterpriseDirectorySearchConstraint constraints)
Search in the specified context of the enterprise directory for entries that satisfy the filter and contraints. |
void |
edirUpdateObject(Entity entity,
EnterpriseDirectoryModificationItem[] modList)
Process a modification list on an object to update it in the directory. |
java.io.PrintStream |
getDebugStream()
Returns the stream used to display debug messages. |
java.util.Map |
getEnvironment()
Returns the enterprise directory environment. |
java.util.Map |
getFactoryMap()
Return the factory map. |
java.util.Locale |
getLocale()
Returns the current locale. |
PortalPool |
getPoolSettings()
Creates a PortalPool object using the directory environment. |
EnterpriseDirectorySecurity |
getSecurityObject()
Get the security object for this instance. |
java.lang.Object |
getTrackedObject(long id)
Get an object associated with a tracking id. |
User |
getUser()
Returns the User object which represents the identity used by this instance to establish a connection to the directory server. |
EnterpriseDirectoryAttribute |
newAttribute(java.lang.String attrName)
Return a new Attribute object |
EnterpriseDirectoryAttribute |
newAttribute(java.lang.String attrName,
java.lang.Object attrValue)
Return a new Attribute object. |
EnterpriseDirectoryAttributes |
newAttributes()
Return a new attribute set. |
EnterpriseDirectoryAttributes |
newAttributes(java.lang.String attrName,
java.lang.Object attrValue)
Return a new attribute set initialized with an attribute. |
java.lang.Object |
newObject(java.lang.String key)
Creates a new object using reflection by looking up the key in the mapping list to find an array of reflection arguments. |
java.lang.Object |
newObject(java.lang.String[] pArray)
Creates a new object using reflection |
java.lang.Object |
newObject(java.lang.String[] pArray,
java.lang.Object[] ctorArgs)
Creates a new object using a String array of properties plus an array of constructor arguments. |
java.lang.Object |
newObject(java.lang.String key,
java.lang.Object[] ctorArgs)
Constructs a new object using reflection. |
EnterpriseDirectorySearchConstraint |
newSearchConstraint()
Return a new EnterpriseSearchConstraint |
void |
removeCacheChangeListener(CacheChangeListener listener)
Removes a cache change listener to this object |
void |
removeChangeListener(DirectoryChangeListener listener,
java.lang.String dn)
Remove an entry change listener from the list. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a property change listener from the listener list. |
void |
setLocale(java.util.Locale locale)
Sets the current locale. |
void |
trackObject(TrackedObject thingToTrack)
Add an object to the tracking list. |
Methods inherited from interface com.sas.edir.Caching |
edirUpdateStore, getTimeToLive, isExpired, refreshCache, refreshCachedObjects, releaseCache, setDirty, setTimeToLive, setTimeToLive, updateStore |
Methods inherited from interface java.beans.PropertyChangeListener |
propertyChange |
Field Detail |
public static final java.lang.String APPLICATION_CONTEXT
public static final java.lang.String BASE_CONTEXT
public static final java.lang.String USER_CONTEXT
public static final java.lang.String GROUP_CONTEXT
public static final java.lang.String DEBUG
public static final java.lang.String CLASS_MAPPING
public static final java.lang.String ENTITY_MAPPING
public static final java.lang.String PROPERTY_CHANGED
public static final java.lang.String SUBPROPERTY_CHANGED
Method Detail |
public void close()
public Entity edirNewEntity(java.lang.String context, EnterpriseDirectoryAttributes attributes) throws EnterpriseDirectoryException
context
- The directory context of the entity to be created.attributes
- The attributes of the object to be created. If this
parameter is null, the context is used to retrieve the attributes from
the directory service.NamingException
- Exceptions are thrown if the context is not valid
in the directory service, or if the entry's object class doesn't have a
valid mapping for reflection.public java.lang.Object newObject(java.lang.String key) throws ReflectionException
key
- The key into the mapping list for the object type desired.ReflectionException
- In the event the key was not found in the
mapping list, or an error occurred creating the new object.public java.lang.Object newObject(java.lang.String key, java.lang.Object[] ctorArgs) throws ReflectionException
The key is looked up in the mapping list and the resulting string array and constructor arguments are used to create the new object.
key
- Mapping list key for the desired object typectorArgs
- A list of constructor arguments to use when creating the objectReflectionException
- if the key was not found in the mapping list, or there
was an error creating the objectpublic java.lang.Object newObject(java.lang.String[] pArray) throws ReflectionException
A new object is created using the string array as a list of properties, and no constructor arguments to create a new object.
pArray
- A String array of properties to use to create
a new object.ReflectionException
- if there was an error creating the object.public java.lang.Object newObject(java.lang.String[] pArray, java.lang.Object[] ctorArgs) throws ReflectionException
pArray
- An array of Strings used as properties to create the
new object. A class property is required.ReflectionException
- If there was an error creating the object.public java.lang.Object getTrackedObject(long id)
The Enterprise Directory service keeps a list of objects that it creates in the newEntity and newObject methods by a tracking ID. This tracking ID can be used outside the directory service to refer to the object.
id
- The tracking ID to look uppublic void trackObject(TrackedObject thingToTrack)
If an object created outside the Directory service needs to be tracked it can be added to the tracking list using this method.
thingToTrack
- A TrackedObject to add to the tracking listpublic java.util.ListIterator edirListIterator(Filter filter) throws EnterpriseDirectoryException
filter
- a Filter object that specifies the search criteria to
use for returning objects from the directory.NamingException
- Thrown for enterprise directory failure.public java.util.ListIterator edirListIterator(Filter filter, java.util.Comparator compare) throws EnterpriseDirectoryException
filter
- a Filter object that specifies the search criteria to
use for returning objects from the directory.compare
- Comparator to use to sort the list.NamingException
- Thrown for enterprise directory failure.public java.util.Enumeration edirSearch(SearchFilter filter) throws EnterpriseDirectoryException
filter
- The search filter.EnterpriseDirectoryException
- Thrown for enterprise directory failure.public java.util.Enumeration edirSearch(java.lang.String filter, EnterpriseDirectorySearchConstraint constraints) throws EnterpriseDirectoryException
filter
- The search filter. The syntax is the LDAP filter syntax
defined in RFC 2254.constraints
- The search constraints.EnterpriseDirectoryException
- Thrown for enterprise directory failure.public java.util.Enumeration edirSearch(java.lang.String context, java.lang.String filter, EnterpriseDirectorySearchConstraint constraints) throws EnterpriseDirectoryException
context
- The context to search.filter
- The search filter. The syntax is the LDAP filter syntax
defined in RFC 2254.constraints
- The search constraints.EnterpriseDirectoryException
- Thrown for enterprise directory failure.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The property change listener.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The property change listener.public void edirUpdateObject(Entity entity, EnterpriseDirectoryModificationItem[] modList) throws EnterpriseDirectoryException
entity
- The object to update.modList
- An array of ModificationItems to apply to the object.NamingException
- Thrown for enterprise directory failure.public void edirAddAttributes(java.lang.String namedObject, EnterpriseDirectoryAttributes attributes) throws EnterpriseDirectoryException
namedObject
- The named object.attributes
- The attributes to add.EnterpriseDirectoryException
- Thrown for enterprise directory failure.public EnterpriseDirectoryAttributes edirGetAttribute(java.lang.String context, java.lang.String attribute) throws EnterpriseDirectoryException
context
- The directory context of the entry to look upattribute
- The attribute type to retrieve the value(s) for.EnterpriseDirectoryException
- in the event of a directory failure.public EnterpriseDirectoryAttributes edirGetAttributes(java.lang.String context, java.lang.String[] attributes) throws EnterpriseDirectoryException
context
- The directory context of the entry to retrieve.attributes
- An array of attribute types to return for that entry.EnterpriseDirectoryException
- in the event of a directory failure.public EnterpriseDirectoryAttributes edirGetAttributes(java.lang.String namedObject) throws EnterpriseDirectoryException
namedObject
- The named object.NamingException
- Thrown for enterprise directory failure.public void edirRemoveAttributes(java.lang.String namedObject, EnterpriseDirectoryAttributes attributes) throws EnterpriseDirectoryException
namedObject
- The named object.attributes
- The attributes to remove.EnterpriseDirectoryException
- Thrown for enterprise directory failure.public void edirReplaceAttributes(java.lang.String namedObject, EnterpriseDirectoryAttributes attributes) throws EnterpriseDirectoryException
namedObject
- The named object.attributes
- The attributes to replace.EnterpriseDirectoryException
- Thrown for enterprise directory failure.public void edirRemove(java.lang.String context) throws EnterpriseDirectoryException
context
- The context of the object to removeEnterpriseDirectoryException
- Thrown for enterprise directory failurepublic void edirRemoveSubtree(java.lang.String context) throws EnterpriseDirectoryException
context
- The context of the subtee to removeEnterpriseDirectoryException
- Thrown for enterprise directory failurepublic void edirCreate(java.lang.String context, EnterpriseDirectoryAttributes attrs) throws EnterpriseDirectoryException
context
- the context of the entry to addattrs
- the attributes to assign to the entryEnterpriseDirectoryException
- Thrown for enterprise directory failurepublic java.io.PrintStream getDebugStream()
public java.util.Map getEnvironment()
public PortalPool getPoolSettings()
public User getUser()
NamingException
- Thrown for enterprise directory failure.public void addCacheChangeListener(CacheChangeListener listener)
The EnterpriseDirectory objects maintain a cache of entries it has retrieved from the directory server. Interested parties can be notified when cached objects change by being added using this method. This is typically used by other directory services to synchronize their data.
listener
- A new CacheChangeListener to add to the list.public void removeCacheChangeListener(CacheChangeListener listener)
listener
- The listener to remove from the list.public void cacheChange(java.lang.String dn)
dn
- The dn that was changed.public void addChangeListener(DirectoryChangeListener listener, java.lang.String dn)
The directory service can also report changes to dn's. A listener registers itself, and the dn it's interested in. A "*" can be used to listen for changes to all entries.
listener
- The object to add to the listener list.dn
- The directory context the object is interested in. "*" to listen
for changes to all entries.public void removeChangeListener(DirectoryChangeListener listener, java.lang.String dn)
listener
- The listener to remove.dn
- The directory context the object is listening for.public EnterpriseDirectorySecurity getSecurityObject()
public java.util.Locale getLocale()
public void setLocale(java.util.Locale locale)
locale
- The user's locale.public java.util.Map getFactoryMap()
public EnterpriseDirectoryAttribute newAttribute(java.lang.String attrName)
attrName
- The attribute name.public EnterpriseDirectoryAttribute newAttribute(java.lang.String attrName, java.lang.Object attrValue)
attrName
- The attribute name.attrValue
- The attribute value.public EnterpriseDirectoryAttributes newAttributes()
public EnterpriseDirectoryAttributes newAttributes(java.lang.String attrName, java.lang.Object attrValue)
attrName
- The attribute name to initialize with.attrValue
- The attribute value to initialize with.public EnterpriseDirectorySearchConstraint newSearchConstraint()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |