wt.federation
Class StandardFederationService

java.lang.Object
  extended by wt.services.StandardManager
      extended by wt.federation.StandardFederationService
All Implemented Interfaces:
Serializable, NetFactor, FederationService, FederationServiceSvr, wt.services.Manager

public class StandardFederationService
extends StandardManager
implements FederationService, FederationServiceSvr, Serializable

Standard implementation of the federation service interfaces.

Use the newStandardFederationService static factory method(s), not the StandardFederationService 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

Nested Class Summary
static class wt.federation.StandardFederationService.RMIStreamHandler
           
 
Method Summary
 Persistable checkFreshness(Persistable obj)
          Determines whether the specified object is an expired or stale proxy.
 QueryResult checkFreshness(QueryResult qr)
          Traverses a QueryResult and determines whether any of the objects contained within it are expired or stale proxies.
 QueryResult findObjects(QuerySpec qs)
          Sends a query to all federated services, and returns the merged set of results.
 QueryResult findObjects(QuerySpec qs, String serviceName)
          Sends a query to the specified federated service, and returns the results.
 QueryResult findObjects(QuerySpec qs, String[] serviceNames)
          Sends a query to each of the specified federated services, and returns the merged set of results.
 QueryResult findObjects(QuerySpec qs, String[] serviceNames, boolean searchLocalDB)
          Sends a query to each of the specified federated services, and returns the merged set of results.
 String[] getAllServices()
          Returns an array of the names of all known federated services.
 String[] getNavigableServices(String linkClassName)
          Returns an array of the names of federated services that support navigating a specified link class.
 Persistable getPersistentInstance(Federated proxy)
          Returns a persisted instance of the specified proxy object or null if the proxy has no persisted instance.
 String[] getQueryableServices(String className)
          Returns an array of the names of federated services that support querying a specified class.
 InputStream invokeInfoEngineTemplate(String url)
          Sends a request to Info*Engine to execute the specified template.
 InputStream invokeInfoEngineTemplate(String url, Hashtable params)
          Sends a request to Info*Engine to execute the specified template, optionally providing parameters in URL-encoded form data.
 void refresh(Federated proxy)
          Refreshes the properties of a proxy object.
 void refreshIfStale(Federated proxy)
          Refreshes the properties of a proxy object, but only if the object is stale.
 Vector retrieveInfoEngineObjects(String url)
          Sends a request to Info*Engine to retrieve objects associated with the specified URL.
 void sendFeedback(MethodFeedback feedbackObject)
          Sends Feedback objects to the client.
 Federated storeProxy(Federated proxy)
          Stores a proxy object in the persistent data service.
 void syncObjects(Externalizable source, Externalizable target)
          Copies the properties of a specified source object to a target object.
 
Methods inherited from class wt.services.StandardManager
getManagerService, getManagerStatus, getName, getStartupType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

findObjects

public QueryResult findObjects(QuerySpec qs)
                        throws wt.federation.FederationServicesException,
                               WTException
Sends a query to all federated services, and returns the merged set of results.

Supported API: true

Specified by:
findObjects in interface FederationService
Parameters:
qs - the search criteria to use for the query.
Returns:
QueryResult
Throws:
wt.federation.FederationServicesException
WTException

findObjects

public QueryResult findObjects(QuerySpec qs,
                               String serviceName)
                        throws wt.federation.FederationServicesException,
                               WTException
Sends a query to the specified federated service, and returns the results.

Supported API: true

Specified by:
findObjects in interface FederationService
Parameters:
qs - the search criteria to use for the query.
serviceName - the name of the federated service to be queried.
Returns:
QueryResult
Throws:
wt.federation.FederationServicesException
WTException

findObjects

public QueryResult findObjects(QuerySpec qs,
                               String[] serviceNames)
                        throws wt.federation.FederationServicesException,
                               WTException
Sends a query to each of the specified federated services, and returns the merged set of results.

Supported API: true

Specified by:
findObjects in interface FederationService
Parameters:
qs - the search criteria to use for the query.
serviceNames - the names of the federated services to be queried.
Returns:
QueryResult
Throws:
wt.federation.FederationServicesException
WTException

findObjects

public QueryResult findObjects(QuerySpec qs,
                               String[] serviceNames,
                               boolean searchLocalDB)
                        throws wt.federation.FederationServicesException,
                               WTException
Sends a query to each of the specified federated services, and returns the merged set of results. If searchLocalDB is true, also queries the local system and includes any locally defined entries in the search results.

Supported API: true

Specified by:
findObjects in interface FederationService
Parameters:
qs - the search criteria to use for the query.
serviceNames - the names of the federated services to be queried.
searchLocalDB - set to true if the local system should be queried.
Returns:
QueryResult
Throws:
wt.federation.FederationServicesException
WTException

getAllServices

public String[] getAllServices()
                        throws wt.federation.FederationServicesException,
                               WTException
Returns an array of the names of all known federated services.

Supported API: true

Specified by:
getAllServices in interface FederationService
Returns:
String []
Throws:
wt.federation.FederationServicesException
WTException

getNavigableServices

public String[] getNavigableServices(String linkClassName)
                              throws wt.federation.FederationServicesException,
                                     WTException
Returns an array of the names of federated services that support navigating a specified link class.

Supported API: true

Specified by:
getNavigableServices in interface FederationService
Parameters:
linkClassName - the name of the class for which navigation is desired.
Returns:
String []
Throws:
wt.federation.FederationServicesException
WTException

getPersistentInstance

public Persistable getPersistentInstance(Federated proxy)
                                  throws wt.federation.FederationServicesException,
                                         WTException
Returns a persisted instance of the specified proxy object or null if the proxy has no persisted instance.

Supported API: true

Specified by:
getPersistentInstance in interface FederationService
Parameters:
proxy - the proxy object.
Returns:
Persistable
Throws:
wt.federation.FederationServicesException
WTException

getQueryableServices

public String[] getQueryableServices(String className)
                              throws wt.federation.FederationServicesException,
                                     WTException
Returns an array of the names of federated services that support querying a specified class.

Supported API: true

Specified by:
getQueryableServices in interface FederationService
Parameters:
className - the name of the class for which querying is desired.
Returns:
String []
Throws:
wt.federation.FederationServicesException
WTException

retrieveInfoEngineObjects

public Vector retrieveInfoEngineObjects(String url)
                                 throws wt.federation.FederationServicesException,
                                        WTException
Sends a request to Info*Engine to retrieve objects associated with the specified URL.

Supported API: true

Specified by:
retrieveInfoEngineObjects in interface FederationService
Parameters:
url - the URL identifying the objects to be retrieved.
Returns:
Vector
Throws:
wt.federation.FederationServicesException
WTException

storeProxy

public Federated storeProxy(Federated proxy)
                     throws wt.federation.FederationServicesException,
                            WTException
Stores a proxy object in the persistent data service.

Supported API: true

Specified by:
storeProxy in interface FederationService
Parameters:
proxy - the object to be persisted.
Returns:
Federated
Throws:
wt.federation.FederationServicesException
WTException

syncObjects

public void syncObjects(Externalizable source,
                        Externalizable target)
                 throws wt.federation.FederationServicesException,
                        WTException
Copies the properties of a specified source object to a target object.

Supported API: true

Specified by:
syncObjects in interface FederationService
Parameters:
source - the source object.
target - the target object.
Throws:
wt.federation.FederationServicesException
WTException

checkFreshness

public Persistable checkFreshness(Persistable obj)
                           throws wt.federation.FederationServicesException
Determines whether the specified object is an expired or stale proxy. Refreshes it immediately if it is an expired proxy. Enqueues a request to refresh the object if it is a stale but not expired proxy. Otherwise, returns the object as is.

Supported API: true

Specified by:
checkFreshness in interface FederationServiceSvr
Parameters:
obj - the object to be checked.
Returns:
Persistable
Throws:
wt.federation.FederationServicesException

checkFreshness

public QueryResult checkFreshness(QueryResult qr)
                           throws wt.federation.FederationServicesException
Traverses a QueryResult and determines whether any of the objects contained within it are expired or stale proxies. Refreshes all expired proxies immediately, and enqueues requests to refresh stale ones that haven't expired.

Supported API: true

Specified by:
checkFreshness in interface FederationServiceSvr
Parameters:
qr - the QueryResult to be checked.
Returns:
QueryResult
Throws:
wt.federation.FederationServicesException

invokeInfoEngineTemplate

public InputStream invokeInfoEngineTemplate(String url)
                                     throws wt.federation.FederationServicesException
Sends a request to Info*Engine to execute the specified template.

Supported API: true

Specified by:
invokeInfoEngineTemplate in interface FederationServiceSvr
Parameters:
url - the URL identifying the template to be executed.
Returns:
InputStream
Throws:
wt.federation.FederationServicesException

invokeInfoEngineTemplate

public InputStream invokeInfoEngineTemplate(String url,
                                            Hashtable params)
                                     throws wt.federation.FederationServicesException
Sends a request to Info*Engine to execute the specified template, optionally providing parameters in URL-encoded form data.

Supported API: true

Specified by:
invokeInfoEngineTemplate in interface FederationServiceSvr
Parameters:
url - the URL identifying the template to be executed.
params - Hashtable of parameters to be sent as form data.
Returns:
InputStream
Throws:
wt.federation.FederationServicesException

refresh

public void refresh(Federated proxy)
             throws wt.federation.FederationServicesException
Refreshes the properties of a proxy object.

Supported API: true

Specified by:
refresh in interface FederationServiceSvr
Parameters:
proxy - the proxy object to be refreshed.
Throws:
wt.federation.FederationServicesException

refreshIfStale

public void refreshIfStale(Federated proxy)
                    throws wt.federation.FederationServicesException
Refreshes the properties of a proxy object, but only if the object is stale.

Supported API: true

Specified by:
refreshIfStale in interface FederationServiceSvr
Parameters:
proxy - the proxy object to be refreshed.
Throws:
wt.federation.FederationServicesException

sendFeedback

public void sendFeedback(MethodFeedback feedbackObject)
                  throws wt.federation.FederationServicesException
Sends Feedback objects to the client.

Supported API: true

Specified by:
sendFeedback in interface FederationServiceSvr
Parameters:
feedbackObject - Required. The feedback object to be sent to the client.
Throws:
wt.federation.FederationServicesException