wt.federation
Class FederatedDirectoryService

java.lang.Object
  extended by wt.fc.WTObject
      extended by wt.fc.Item
          extended by wt.federation.FederatedDirectoryService
All Implemented Interfaces:
Externalizable, Serializable, AccessControlled, wt.access.PolicyAccessControlled, wt.access.SecurityLabeled, wt.admin.DomainAdministered, NetFactor, ObjectMappable, Persistable, FederatedService, DisplayIdentification, RemoteAccess

public class FederatedDirectoryService
extends Item
implements RemoteAccess, FederatedService, Externalizable

This class implements a Federated interface to directory services such as LDAP-accessible directory services.

Use the newFederatedDirectoryService static factory method(s), not the FederatedDirectoryService constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
static String DIRECTORY_ACCESS_CREDENTIALS
          Label for the attribute.
static String DIRECTORY_ACCESS_DN
          Label for the attribute.
static String INITIAL_CONTEXT_FACTORY
          Label for the attribute.
 
Fields inherited from interface wt.federation.FederatedService
SERVICE_NAME
 
Method Summary
 Object createObject(Class objectClass, String sourceObjectId, Hashtable attributes)
          Create a new object in a remote information service.
 void deleteObject(String sourceObjectId)
          Delete the specified object managed by this federated service.
 QueryResult findDirectoryObjects(String url)
          Search the directory service for entries matching the criteria specified in the given LDAP url, and return a QueryResult containing objects corresponding to the matching entries.
 QueryResult findDirectoryObjects(String filterName, Hashtable filterArguments)
          Search the directory service for entries matching the specified filter, and return a QueryResult containing objects corresponding to the matching entries.
 QueryResult findObjects(Class targetLinkClass, Persistable obj1, String obj1Role, Persistable obj2)
          Return all link objects in this service that exist between two specified source objects.
 QueryResult findObjects(QuerySpec criteria)
          Retrieve objects from this federated service using the specified selection criteria.
 String getActionURL(String actionName, Hashtable arguments)
          Returns the URL associated with the specified action and set of named arguments.
 Object getDirectoryAccessCredentials()
          Gets the value of the attribute: DIRECTORY_ACCESS_CREDENTIALS.
 String getDirectoryAccessDN()
          Gets the value of the attribute: DIRECTORY_ACCESS_DN.
 String getInitialContextFactory()
          Gets the value of the attribute: INITIAL_CONTEXT_FACTORY.
 String getServiceName()
          Gets the value of the attribute: SERVICE_NAME.
 Enumeration getSupportedLinkClasses()
          Return the enumeration of link class names for which this service supports navigation.
 Enumeration getSupportedObjectClasses()
          Return the enumeration of class names for which this service supports queries.
 DirectoryTranslationTable getTranslationTable()
          Return an instance of the attribute translation table referenced by this directory service.
protected  void initialize()
          Supports initialization, following construction of an instance.
protected  void initialize(String serviceName)
          Supports initialization, following construction of an instance.
protected  void initialize(String serviceName, String serviceURL, String searchBase, String translationTableName)
          Supports initialization, following construction of an instance.
protected  void initialize(String serviceName, String serviceURL, String searchBase, String translationTableName, String initialContextFactory)
          Supports initialization, following construction of an instance.
 boolean isNavigationSupported(Class linkClass)
          Return true if the named class is defined in the table of supported link classes for this federated service.
 boolean isQuerySupported(Class objectClass)
          Return true if the named class is defined in the table of supported object classes for this federated service.
 QueryResult navigate(Persistable obj, String role, Class linkClass, boolean onlyOtherSide)
          Return objects from this federated service related to the specified source object given a role and link class.
 QueryResult navigate(Persistable obj, String role, QuerySpec criteria, boolean onlyOtherSide)
          Return objects from this federated service related to the specified source object given a role and link selection crtieria.
static FederatedDirectoryService newFederatedDirectoryService()
          Constructor returning an instance initialized with default property values.
static FederatedDirectoryService newFederatedDirectoryService(String serviceName)
          Constructor returning an instance initialized with a specified service name, default initial context factory, and no directory attribute translation table.
static FederatedDirectoryService newFederatedDirectoryService(String serviceName, String serviceURL, String searchBase, String translationTableName)
          Constructor returning an instance initialized with a specified service name, base service URL, directory search base, and translation table name.
static FederatedDirectoryService newFederatedDirectoryService(String serviceName, String serviceURL, String searchBase, String translationTableName, String initialContextFactory)
          Constructor returning an instance initialized with a specified service name, base service URL, directory search base, translation table name, and initial directory context factory value.
 void purgeCaches()
          Purge any caches that might be kept by the service.
 void refreshDirectoryObject(Federated proxy)
          Refreshes the derived properties of a specified proxy object.
 void refreshObject(Federated proxy)
          Refresh the properties of a proxy object that are derived from a remote object.
 Hashtable retrieveAttributes(String sourceObjectId)
          

Supported API: true
 Hashtable retrieveDirectoryAttributes(String distinguishedName)
          Return a Hashtable containing all of the directory attributes read from the specified directory entry.
 Object retrieveDirectoryObject(String distinguishedName)
          Returns a Federated instance of the directory object identified by the specified distinguished name.
 Object retrieveObject(String sourceObjectId)
          Returns a Federated instance of the remote object identified by the specified source object identifier.
 void setDirectoryAccessCredentials(Object a_DirectoryAccessCredentials)
          Sets the value of the attribute: DIRECTORY_ACCESS_CREDENTIALS.
 void setDirectoryAccessDN(String a_DirectoryAccessDN)
          Sets the value of the attribute: DIRECTORY_ACCESS_DN.
 void setInitialContextFactory(String a_InitialContextFactory)
          Sets the value of the attribute: INITIAL_CONTEXT_FACTORY.
 void setServiceName(String a_ServiceName)
          Sets the value of the attribute: SERVICE_NAME.
 void updateObject(String sourceObjectId, Hashtable updateAttributes, Vector deleteAttributes)
          Update the attributes of a specified remote object.
 
Methods inherited from class wt.fc.WTObject
getDisplayIdentifier, getDisplayIdentity, getDisplayType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

INITIAL_CONTEXT_FACTORY

public static final String INITIAL_CONTEXT_FACTORY
Label for the attribute.

Supported API: true

See Also:
Constant Field Values

DIRECTORY_ACCESS_DN

public static final String DIRECTORY_ACCESS_DN
Label for the attribute.

Supported API: true

See Also:
Constant Field Values

DIRECTORY_ACCESS_CREDENTIALS

public static final String DIRECTORY_ACCESS_CREDENTIALS
Label for the attribute.

Supported API: true

See Also:
Constant Field Values
Method Detail

getInitialContextFactory

public String getInitialContextFactory()
Gets the value of the attribute: INITIAL_CONTEXT_FACTORY.

Supported API: true

Returns:
String

setInitialContextFactory

public void setInitialContextFactory(String a_InitialContextFactory)
Sets the value of the attribute: INITIAL_CONTEXT_FACTORY.

Supported API: true

Parameters:
a_InitialContextFactory -

getDirectoryAccessDN

public String getDirectoryAccessDN()
Gets the value of the attribute: DIRECTORY_ACCESS_DN.

Supported API: true

Returns:
String

setDirectoryAccessDN

public void setDirectoryAccessDN(String a_DirectoryAccessDN)
Sets the value of the attribute: DIRECTORY_ACCESS_DN.

Supported API: true

Parameters:
a_DirectoryAccessDN -

getDirectoryAccessCredentials

public Object getDirectoryAccessCredentials()
Gets the value of the attribute: DIRECTORY_ACCESS_CREDENTIALS.

Supported API: true

Returns:
Object

setDirectoryAccessCredentials

public void setDirectoryAccessCredentials(Object a_DirectoryAccessCredentials)
Sets the value of the attribute: DIRECTORY_ACCESS_CREDENTIALS.

Supported API: true

Parameters:
a_DirectoryAccessCredentials -

newFederatedDirectoryService

public static FederatedDirectoryService newFederatedDirectoryService(String serviceName,
                                                                     String serviceURL,
                                                                     String searchBase,
                                                                     String translationTableName)
                                                              throws wt.federation.FederationServicesException
Constructor returning an instance initialized with a specified service name, base service URL, directory search base, and translation table name.

Supported API: true

Parameters:
serviceName -
serviceURL -
searchBase -
translationTableName -
Returns:
FederatedDirectoryService
Throws:
wt.federation.FederationServicesException

initialize

protected void initialize(String serviceName,
                          String serviceURL,
                          String searchBase,
                          String translationTableName)
                   throws wt.federation.FederationServicesException
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

Supported API: true

Parameters:
serviceName -
serviceURL -
searchBase -
translationTableName -
Throws:
wt.federation.FederationServicesException

newFederatedDirectoryService

public static FederatedDirectoryService newFederatedDirectoryService(String serviceName,
                                                                     String serviceURL,
                                                                     String searchBase,
                                                                     String translationTableName,
                                                                     String initialContextFactory)
                                                              throws wt.federation.FederationServicesException
Constructor returning an instance initialized with a specified service name, base service URL, directory search base, translation table name, and initial directory context factory value.

Supported API: true

Parameters:
serviceName -
serviceURL -
searchBase -
translationTableName -
initialContextFactory -
Returns:
FederatedDirectoryService
Throws:
wt.federation.FederationServicesException

initialize

protected void initialize(String serviceName,
                          String serviceURL,
                          String searchBase,
                          String translationTableName,
                          String initialContextFactory)
                   throws wt.federation.FederationServicesException
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

Supported API: true

Parameters:
serviceName -
serviceURL -
searchBase -
translationTableName -
initialContextFactory -
Throws:
wt.federation.FederationServicesException

newFederatedDirectoryService

public static FederatedDirectoryService newFederatedDirectoryService(String serviceName)
                                                              throws wt.federation.FederationServicesException
Constructor returning an instance initialized with a specified service name, default initial context factory, and no directory attribute translation table.

Supported API: true

Parameters:
serviceName -
Returns:
FederatedDirectoryService
Throws:
wt.federation.FederationServicesException

initialize

protected void initialize(String serviceName)
                   throws wt.federation.FederationServicesException
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

Supported API: true

Parameters:
serviceName -
Throws:
wt.federation.FederationServicesException

newFederatedDirectoryService

public static FederatedDirectoryService newFederatedDirectoryService()
                                                              throws wt.federation.FederationServicesException
Constructor returning an instance initialized with default property values.

Supported API: true

Returns:
FederatedDirectoryService
Throws:
wt.federation.FederationServicesException

retrieveDirectoryObject

public Object retrieveDirectoryObject(String distinguishedName)
                               throws wt.federation.FederationServicesException,
                                      WTException
Returns a Federated instance of the directory object identified by the specified distinguished name.

Supported API: true

Parameters:
distinguishedName -
Returns:
Object
Throws:
wt.federation.FederationServicesException
WTException

refreshDirectoryObject

public void refreshDirectoryObject(Federated proxy)
                            throws wt.federation.FederationServicesException,
                                   WTException
Refreshes the derived properties of a specified proxy object.

Supported API: true

Parameters:
proxy -
Throws:
wt.federation.FederationServicesException
WTException

findDirectoryObjects

public QueryResult findDirectoryObjects(String filterName,
                                        Hashtable filterArguments)
                                 throws wt.federation.FederationServicesException,
                                        WTException
Search the directory service for entries matching the specified filter, and return a QueryResult containing objects corresponding to the matching entries.

Supported API: true

Parameters:
filterName -
filterArguments -
Returns:
QueryResult
Throws:
wt.federation.FederationServicesException
WTException

findDirectoryObjects

public QueryResult findDirectoryObjects(String url)
                                 throws wt.federation.FederationServicesException,
                                        WTException
Search the directory service for entries matching the criteria specified in the given LDAP url, and return a QueryResult containing objects corresponding to the matching entries.

Supported API: true

Parameters:
url -
Returns:
QueryResult
Throws:
wt.federation.FederationServicesException
WTException

getTranslationTable

public DirectoryTranslationTable getTranslationTable()
                                              throws wt.federation.FederationServicesException
Return an instance of the attribute translation table referenced by this directory service.

Supported API: true

Returns:
DirectoryTranslationTable
Throws:
wt.federation.FederationServicesException

retrieveDirectoryAttributes

public Hashtable retrieveDirectoryAttributes(String distinguishedName)
                                      throws wt.federation.FederationServicesException,
                                             WTException
Return a Hashtable containing all of the directory attributes read from the specified directory entry.

Supported API: true

Parameters:
distinguishedName -
Returns:
Hashtable
Throws:
wt.federation.FederationServicesException
WTException

getServiceName

public String getServiceName()
Gets the value of the attribute: SERVICE_NAME.

Supported API: true

Specified by:
getServiceName in interface FederatedService
Returns:
String

setServiceName

public void setServiceName(String a_ServiceName)
Sets the value of the attribute: SERVICE_NAME.

Supported API: true

Specified by:
setServiceName in interface FederatedService
Parameters:
a_ServiceName -

getActionURL

public String getActionURL(String actionName,
                           Hashtable arguments)
                    throws wt.federation.FederationServicesException
Returns the URL associated with the specified action and set of named arguments.

Supported API: true

Specified by:
getActionURL in interface FederatedService
Parameters:
actionName -
arguments -
Returns:
String
Throws:
wt.federation.FederationServicesException

retrieveObject

public Object retrieveObject(String sourceObjectId)
                      throws wt.federation.FederationServicesException
Returns a Federated instance of the remote object identified by the specified source object identifier.

Supported API: true

Specified by:
retrieveObject in interface FederatedService
Parameters:
sourceObjectId -
Returns:
Object
Throws:
wt.federation.FederationServicesException

retrieveAttributes

public Hashtable retrieveAttributes(String sourceObjectId)
                             throws wt.federation.FederationServicesException


Supported API: true

Specified by:
retrieveAttributes in interface FederatedService
Parameters:
sourceObjectId -
Returns:
Hashtable
Throws:
wt.federation.FederationServicesException

refreshObject

public void refreshObject(Federated proxy)
                   throws wt.federation.FederationServicesException
Refresh the properties of a proxy object that are derived from a remote object.

Supported API: true

Specified by:
refreshObject in interface FederatedService
Parameters:
proxy -
Throws:
wt.federation.FederationServicesException

createObject

public Object createObject(Class objectClass,
                           String sourceObjectId,
                           Hashtable attributes)
                    throws wt.federation.FederationServicesException
Create a new object in a remote information service.

Supported API: true

Specified by:
createObject in interface FederatedService
Parameters:
objectClass -
sourceObjectId -
attributes -
Returns:
Object
Throws:
wt.federation.FederationServicesException

updateObject

public void updateObject(String sourceObjectId,
                         Hashtable updateAttributes,
                         Vector deleteAttributes)
                  throws wt.federation.FederationServicesException
Update the attributes of a specified remote object.

Supported API: true

Specified by:
updateObject in interface FederatedService
Parameters:
sourceObjectId -
updateAttributes -
deleteAttributes -
Throws:
wt.federation.FederationServicesException

deleteObject

public void deleteObject(String sourceObjectId)
                  throws wt.federation.FederationServicesException
Delete the specified object managed by this federated service.

Supported API: true

Specified by:
deleteObject in interface FederatedService
Parameters:
sourceObjectId -
Throws:
wt.federation.FederationServicesException

findObjects

public QueryResult findObjects(QuerySpec criteria)
                        throws wt.federation.FederationServicesException
Retrieve objects from this federated service using the specified selection criteria.

Supported API: true

Specified by:
findObjects in interface FederatedService
Parameters:
criteria -
Returns:
QueryResult
Throws:
wt.federation.FederationServicesException

findObjects

public QueryResult findObjects(Class targetLinkClass,
                               Persistable obj1,
                               String obj1Role,
                               Persistable obj2)
                        throws wt.federation.FederationServicesException
Return all link objects in this service that exist between two specified source objects.

Supported API: true

Specified by:
findObjects in interface FederatedService
Parameters:
targetLinkClass -
obj1 -
obj1Role -
obj2 -
Returns:
QueryResult
Throws:
wt.federation.FederationServicesException

navigate

public QueryResult navigate(Persistable obj,
                            String role,
                            Class linkClass,
                            boolean onlyOtherSide)
                     throws wt.federation.FederationServicesException
Return objects from this federated service related to the specified source object given a role and link class. Return only the related objects themselves if specified. Otherwise, return both the related objects as well as the link objects that associate them with the source object.

Supported API: true

Specified by:
navigate in interface FederatedService
Parameters:
obj -
role -
linkClass -
onlyOtherSide -
Returns:
QueryResult
Throws:
wt.federation.FederationServicesException

navigate

public QueryResult navigate(Persistable obj,
                            String role,
                            QuerySpec criteria,
                            boolean onlyOtherSide)
                     throws wt.federation.FederationServicesException
Return objects from this federated service related to the specified source object given a role and link selection crtieria. Return only the related objects themselves if specified. Otherwise, return both the related objects as well as the link objects that associate them with the source object.

Supported API: true

Specified by:
navigate in interface FederatedService
Parameters:
obj -
role -
criteria -
onlyOtherSide -
Returns:
QueryResult
Throws:
wt.federation.FederationServicesException

getSupportedObjectClasses

public Enumeration getSupportedObjectClasses()
                                      throws wt.federation.FederationServicesException
Return the enumeration of class names for which this service supports queries.

Supported API: true

Specified by:
getSupportedObjectClasses in interface FederatedService
Returns:
Enumeration
Throws:
wt.federation.FederationServicesException

getSupportedLinkClasses

public Enumeration getSupportedLinkClasses()
                                    throws wt.federation.FederationServicesException
Return the enumeration of link class names for which this service supports navigation.

Supported API: true

Specified by:
getSupportedLinkClasses in interface FederatedService
Returns:
Enumeration
Throws:
wt.federation.FederationServicesException

isQuerySupported

public boolean isQuerySupported(Class objectClass)
                         throws wt.federation.FederationServicesException
Return true if the named class is defined in the table of supported object classes for this federated service.

Supported API: true

Specified by:
isQuerySupported in interface FederatedService
Parameters:
objectClass -
Returns:
boolean
Throws:
wt.federation.FederationServicesException

isNavigationSupported

public boolean isNavigationSupported(Class linkClass)
                              throws wt.federation.FederationServicesException
Return true if the named class is defined in the table of supported link classes for this federated service.

Supported API: true

Specified by:
isNavigationSupported in interface FederatedService
Parameters:
linkClass -
Returns:
boolean
Throws:
wt.federation.FederationServicesException

purgeCaches

public void purgeCaches()
                 throws wt.federation.FederationServicesException
Purge any caches that might be kept by the service.

Supported API: true

Specified by:
purgeCaches in interface FederatedService
Throws:
wt.federation.FederationServicesException

initialize

protected void initialize()
                   throws wt.federation.FederationServicesException
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

Supported API: true

Throws:
wt.federation.FederationServicesException