Design and implementation of a client/server framework for federated multi-search and update across heterogeneous datastores6370541Abstract A design and implementation of a client/server framework for federated multi-search and update across heterogeneous datastores. In particular, a technique for manipulating data in one or more heterogeneous datastores at a computer is provided. An object-oriented model is provided for integrating one or more heterogeneous datastores with a federated datastore. One or more heterogeneous datastores and a federated datastore are generated based on the object-oriented model. The generated datastores are organized into a federated composition. Claims What is claimed is: Description BACKGROUND OF THE INVENTION
dkDatastore
Interface com.ibm.mm.sdk.common.dkDatastore
public interface dkDatastore
extends dkQueryManager
{
public abstract void connect(String datastore_name,
String user_name,
String authentication,
String connect_string) throws DKException, Exception
public abstract void disconnect( ) throws DKException, Exception
public abstract Object getOption(int option) throws DKException,
Exception
public abstract void setOption(int option,
Object value) throws DKException, Exception
public abstract Object evaluate(String command,
short commandLangType,
DKNVPair params[ ]) throws DKException, Exception
public abstract Object evaluate(dkQuery query) throws DKException,
Exception
public abstract Object evaluate(DKCQExpr qe) throws DKException,
Exception
public abstract dkResultSetCursor execute(String command,
short commandLangType,
DKNVPair params[ ]) throws DKException, Exception
public abstract dkResultSetCursor execute(dkQuery query) throws
DKException, Exception
public abstract dkResultSetCursor execute(DKCQExpr qe) throws
DKException, Exception
public abstract void executeWithCallback(dkQuery qo,
dkCallback callbackObj) throws DKException, Exception
public abstract void executeWithCallback(String command,
short commandLangType,
DKNVPair params[ ],
dkCallback callbackObj) throws DKException, Exception
public abstract void executeWithCallback(DKCQExpr qe,
dkCallback callbackObj) throws DKException, Exception
public abstract dkQuery createQuery(String command,
short commandLangType,
DKNVPair params[ ]) throws DKException, Exception
public abstract dkQuery createQuery(DKCQExpr qe) throws DKException,
Exception
public abstract void addObject(dkDataObject ddo) throws DKException,
Exception
public abstract void deleteObject(dkDataObject ddo) throws DKException,
Exception
public abstract void retrieveObject(dkDataObject ddo) throws
DKException, Exception
public abstract void updateObject(dkDataObject ddo) throws DKException,
Exception
public abstract void commit( ) throws DKException, Exception
public abstract void rollback( ) throws DKException, Exception
public abstract boolean isConnected( ) throws Exception
public abstract String datastoreName( ) throws Exception
public abstract String datastoreType( ) throws Exception
public abstract DKHandle connection( ) throws Exception
public abstract DKHandle handle(String type) throws Exception
public abstract String userName( ) throws Exception
public abstract dkCollection listDataSources( ) throws DKException,
Exception
public abstract String[ ] listDataSourceNames( ) throws DKException,
Exception
public abstract Object listServers( ) throws DKException, Exception
public abstract Object listSchema( ) throws DKException, Exception
public abstract Object listSchemaAttributes(String schemaEntry) throws
DKException, public
abstract dkCollection listEntities( ) throws DKException, Exception
public abstract dkCollection listSearchableEntities( ) throws
DKException, Exception
public abstract String[ ] listEntityNames( ) throws DKException,
Exception
public abstract String[ ] listSearchableEntityNames( ) throws
DKException, Exception
public abstract dkCollection listEntityAttrs(String entityName) throws
DKException,
Exception
public abstract String[ ] listEntityAttrNames(String entityName) throws
DKException,
Exception
public abstract dkDatastoreDef datastoreDef( ) throws DKException,
Exception
public abstract String registerMapping(DKNVPair sourceMap) throws
DKException,
Exception
public abstract void unRegisterMapping(String mappingName) throws
DKException,
Exception
public abstract String[ ] listMappingNames( ) throws DKException,
Exception
public abstract dkSchemaMapping getMapping(String mappingName) throws
DKException,
public abstract dkExtension getExtension(String extensionName) throws
DKException, public
abstract void addExtension(String extensionName,
dkExtension extensionObj) throws DKException, Exception
public abstract void removeExtension(String extensionName) throws
DKException, Exception
public abstract String[ ] listExtensionNames( ) throws DKException,
Exception
public abstract DKDDO createDDO(String objectType,
int Flags) throws DKException, Exception
public abstract void changePassword(String userId,
String oldPwd,
String newPwd) throws DKException, Exception
public abstract void destroy( ) throws DKException, Exception
}
The following methods are part of the dkDatastore class: public abstract void connect(String datastore_name, String user_name, String authentication, String connect string) throws DKException, Exception Connects to a datastore. Parameters: datastore_name--the datastore name used for connection user_name--the user name used for connection authentication--the authentication used for connection connect_string--the connect string used for connection. This is used to provide additional connection options. public abstract void disconnect( ) throws DKException, Exception Disconnects to a datastore. public abstract ObjectgetOption(int option) throws DKException, Exception Gets a datastore option. Parameters: option--the option identifier Returns: an option value public abstract void setOption(int option, Object value) throws DKException, Exception Sets a datastore option. Parameters: option--the option identifier value--the option value public abstract Object evaluate(String command, short commandLangType, D NVPair params[ ]) throws DKException, Exception Evaluates a query. Parameters: command--a query string commandLang--a query type params--additional query option in name/value pair Returns: a collection of the results public abstract Object evaluate(dkQuery query) throws DKException, Exception Evaluates a query. Parameters: qo--a query object Returns: a collection of the results public abstract Object evaluate(DKCQExpr qe) throws DKException, Exception Evaluates a query. Parameters: qe--a common query expression object Returns: a collection of the results public abstract dkResultSetCursor execute(String command, short commandLangType, DKNVPairparams[ ]) throws DKException, Exception Executes the query. Parameters: command--a query string commandLang--a query type params--additional query option in name/value pair Returns: resultSetCursor which represents a datastore cursor. public abstract dkResultSetCursor execute(dkQuery query) throws DKException, Exception Executes the query. Parameters: qo--a query object Returns: resultSetCursor which represents a datastore cursor. public abstract dkResultSetCursor execute(DKCQExpr qe) throws DKException, Exception Executes the query. Parameters: qe--a common query expression object Returns: resultSetCursor which represents a datastore cursor. public abstract void executeWithCallback(dkQuery qo, dkcallback callbackObj) throws DKException, Exception Executes the query with callback function. Parameters: qo--a query object callbackObj--a dkCallback object public abstract void executeWithCallback(String command, short commandLangType, DKNVPairparams[ ], dkcallback callbackObj) throws DKException, Exception Executes the query with callback function. Parameters: command--a query string commandLang--a query type params--additional query option in name/value pair callbackObj--a dkCallback object public abstract void executeWithCallback(DKCQExpr qe, dkcallback callbackObj) throws DKException, Exception Executes the query with callback function. Parameters: qe--a common query expression object callbackObj--a dkCallback object public abstract dkQuery createQuery(String command, short commandLangType, KNVPair params[ ]) throws DKException, Exception Creates a query object. Parameters: command--a query string commandLang--a query type params--additional query option in name/value pair Returns: a query object public abstract dkQuery createQuery(DKCQExpr qe) throws DKException, Exception Creates a query object. Parameters: qe--a common query expression object public abstract void addObject(dkDataObject ddo) throws DKException, Exception Adds this ddo to this datastore. Parameters: ddo--the ddo to be added to this datastore public abstract void deleteObject(dkDataObject ddo) throws DKException, Exception Deletes this ddo from this datastore. Parameters: ddo--the ddo to be deleted from this datastore public abstract void retrieveObject(dkDataObject ddo) throws DKException, Exception Retrieves this ddo from this datastore. Parameters: ddo--the ddo to be retrieved from this datastore public abstract void updateObject(dkDataObject ddo) throws DKException, Exception Updates this ddo in this datastore. Parameters: ddo--the ddo to be updated in this datastore public abstract void commit( ) throws DKException, Exception Commits a datastore transaction. public abstract void rollback( ) throws DKException, Exception Rolls back a datastore transaction. public abstract boolean isConnected( ) throws Exception checks to see if the datastore is connected. Returns: true if connected public abstract String datastorename( ) throws Exception Gets the name of this datastore object. Usually it represents a datastore source's server name. Returns: datastore name public abstract String datastoretype( ) throws Exception Gets the datastore type for this datastore object. Returns: datastore type public abstract DKHandle connection( ) throws Exception Gets the connection handle for a datastore. Returns: connection handle public abstract DKHande handle(String type) throws Exception Gets a datastore handle. Parameters: type--type of datastore handle wanted Returns: a datastore handle public abstract String userName( ) throws Exception Gets the user name for this datastore object. Returns: user name public abstract dkcollection listDataSources( ) throws DKException, Exception List the available datastore sources that can be used to connect with. Returns: a collection of server defs public abstract String[ ] listDataSourceNames( ) throws DKException, Exception Lists the available datastore source names that can be used to connect with. Returns: an array of server names public abstract Object listServers( ) throws DKException, Exception Lists the available datastore sources that can be used to connect with. Note: listservers( ) is deprecated. Replace by listDataSources. Returns: a collection of server definitions See Also: listDataSources public abstract Object listSchema( ) throws DKException, Exception List the entities that belong to this datastore. Note: listSchema( ) is deprecated. Replace by listEntities. Returns: an object that contains the schema See Also: listEntities public abstract Object listSchemaAttributes(String schemaEntry) throws DKException, Exception List the attributes that belong to a schema Note: listSchemaAttributes( ) is deprecated. Replace by listEntityAttributes. Parameters: schemaEntry--the name of the schema. Returns: an object that contains the attributes that belong to this schema See Also: listEntityAttrs public abstract dkcollection listEntities( ) throws DKException, Exception Gets a list of entities from persistent datastore. Returns: a collection of entity defs Throws: DKException if error occurs public abstract dkcollection listSearchableEntities( ) throws DKException, Exception public abstract String[ ] listEntityNames( ) throws DKException, Exception Gets a list of entity names from persistent datastore Returns: an array of entity names Throws: DKException if error occurs public abstract String[ ] listSearchableEntityNames( ) throws DKException, Exception public abstract dkcollection listEntityAttrs(String entityName) throws DKException, Exception Gets a list of attributes for a given entity name. Parameters: entityName--name of entity to retrieve attributes for Returns: a dkCollection of dkAttrDef objects Throws: DKException if the entity name does not exist public abstract String[ ] listEntityAttrNames(String entityName) throws DKException, Exception Gets a list of attribute names for a given entity name. Parameters: entityName--name of entity to retrieve attribute names for Returns: an array of attribute names Throws: DKException if the entity name does not exist public abstract dkDatastoreDef datastoreDef( ) throws DKException; Exception Gets datastore definition Returns: the meta-data (dkDatastoreDef) of this datastore public abstract String registerMapping(DKNVPair sourceMap) throws DKException, Exception Registers mapping information to this datastore Parameters: sourceMap--source name and mapping Returns: the mapping name for the mapping information public abstract void unRegisterMapping(String mappingName) throws DKException, Exception Unregisters mapping information for this datastore Parameters: mappingName--name of the mapping information public abstract String[ ] listMappingNames( ) throws DKException, Exception Gets the list of the register mappings for this datastore Returns: an array of register mapping objects' names public abstract dkSchemaMapping getMapping(String mappingName) throws DKException, Exception Gets mapping information for this datastore Parameters: mappingName--name of the mapping information Returns: the schema mapping object public abstract dkextension getExtension(String extensionName) throws DKException, Exception Gets the extension object from a given extenstion name. Parameters: extensionName--name of the extension object. Returns: extension object. public abstract void addExtension(String extensionname, dkExtension extensionObj) throws DKException, Exception Adds a new extension object. Parameters: extensionname--name of new extension object extensionObj--the extension object to be set public abstract void removeExtension(String extensionName) throws DKException, Exception Removes an existing extension object Parameters: extensionname--name of extension object to be removed public abstract String[ ] listExtensionNames( ) throws DKException, Exception Gets the list of extension objects' names Returns: an array of extension objects' names public abstract DKDDO createDDO(String objectType, int Flags) throws DKException, Exception Creates a new DDO with object type, properties and attributes set for a given backend server. Parameters: objectType--the object type user wants to create Flags--to indicate various options to specify more detail characteristics of the DDO to create. For example, it may be a directive to create a document DDO, a folder, etc. Returns: a new DDO of the given object type with all the properties and attributes set, so that the user only need to set the attribute values public abstract void changePassword(String userId, String oldPwd, String newPwd) throws DKException, Exception public abstract void destroy( ) throws DKException, Exception Destroys datastore and performs datastore cleanup if needed. 2. Federated Datastore In the preferred embodiment, the federated datastore takes query strings expressed in a federated query language. An example class definition for DatastoreFederated is set forth below.
DKDatastoreFed.java
package com.ibm.mm.sdk.server;
public class DKDatastoreFed extends dkAbstractDataStore
implements DKConstantFed,
DKConstant,
DKMessageIdFed,
DKMessageId,
dkFederation,
java.io.Serializable
{
public dkCollection listEntities( ) throws DKException, Exception
public String[ ] listEntityNames( ) throws DKException, Exception
public String[ ] listTextEntityNames( ) throws DKException, Exception
public String[ ] listParmEntityNames( ) throws DKException, Exception
public dkCollection listEntityAttrs(String entityName) throws
DKException, Exception
public String[ ] listEntityAttrNames(String entityName) throws
DKException, Exception
public String registerMapping(DKNVPair sourceMap) throws DKException,
Exception
public void unRegisterMapping(String mappingName) throws DKException,
Exception
public String[ ] listMappingNames( ) throws DKException, Exception
public dkSchemaMapping getMapping(String mappingName) throws
DKException,
Exception
public synchronized dkExtension getExtension(String extensionName)
throws
DKException, Exception
public synchronized void addExtension(String extensionName,
dkExtension extensionObj) throws DKException, Exception
public synchronized void removeExtension(String extensionName) throws
DKException,
Exception
public synchronized String[ ] listExtensionNames( ) throws DKException,
Exception
public DKDDO createDDO(String objectType,
int Flags) throws DKException, Exception
public dkCollection listSearchTemplates( ) throws DKException,
Exception
public String[ ] listSearchTemplateNames( ) throws DKException,
Exception
public dkSearchTemplate getSearchTemplate(StringtemplateName) throws
DKException,
Exception
public void destroy( ) throws DKException, Exception
public synchronized string addRemoveCursor (dkResultSetCursor iCurt int
action)
throws DKException, Exception
public dkDatastore datastoreByServerName (String dsType, String dsName)
throws DKException, Exception
public void changePassword (String serverName,
String user Id,
String oldPwd,
String newPwd)
throws DKException, Exception
public void requestConnection (String serverName,
String userId,
String passwd,
String connectString)
throws DKException, Exception
public void excludeServer (Sting serverName, String templateName)
throws DKException, Exception
public boolean isServerExcluded (String serverName, String
templateName)
throws DKException, Exception, java.rmi.RemoteException
public String[ ] listExcludedServers(String templateName) throws
DKException, Exception
public void clearExcludedServers(String templateName) throws
DKException, Exception
};
The following methods are part of the federated datastore class: public DKDatastoreFed( ) throws DKException, Exception Constructs default Federated Datastore. public DKDatastoreFed(String configuration) throws DKException, Exception Constructs default Federated Datastore. public void connect(String datastore_name, String user_name, String authentication, String connect_string) throws DKException, Exception Establishes a connection to a federated datastore. Parameters: datastore_name--federated datastore name user_name--userid to logon to this federated datastore authentication--password for this user_name connect_string--additional information string Throws: DKException if either: datastore_name, user_name, or authentication is null or if error occurs in the federated datastore Overrides: connect in class dkAbstractDatastore public void disconnect( ) throws DKException, Exception Disconnects from the federated datastore. Throws: DKException if unable to disconnect from server. Overrides: disconnect in class dkAbstractDatastore public Object getoption(int option) throws DKException Gets defined datastore option Parameters: option--an option id Returns: the value for the given option Throws: DKException if option is not set Overrides: getOption in class dkAbstractDatastore public void setOption(int option, Object value) throws DKException Sets the given "option" with a specific "value". Parameters: option--an option id value--the value for the "option" Throws: DKException if option/value is invalid Overrides: setOption in class dkAbstractDatastore public Object evaluate(String command, short commandLangType, DKNVPairparams[ ]) throws DKException, Exception Evaluates a query and returns the result as a dkQueryableCollection object. Parameters: command--a query stirring that represent the query criteria commandLangType--a query language type, for Federated, it will be DK_FEDERATED_QL_TYPE params--a name/value pairs list Returns: a query result collection Throws: DKException if "command" argument is null Overrides: evaluate in class dkAbstractDatastore public Object evaluate(dkQuery query) throws DKException, Exception Evaluates a query and returns the result as a dkQueryableCollection. Parameters: query--a given query object Returns: a query result collection Throws: DKException if the "query" input is null or not of federated query type. Overrides: evaluate in class dkAbstractDatastore public Object evaluate(DKCQExpr qe) throws DKException, Exception Evaluates a query. Parameters: qe--a common query expression object Returns: a collection of the results Throws: DKException if common query expression object is invalid Overrides: evaluate in class dkAbstractDatastore public dkResultSetCursor execute(String command, short commandLangType, DKNVPairparams[ ]) throws DKException, Exception Executes a command query of the federated datastore and returns a result set cursor. Parameters: command--a query string that represents the query criteria. commandLangType--a query language type, for Federated, it will be DK_FEDERATED.sub.--QL _TYPE. params[ ]--a name/value pairs list. Returns: a dkResultSetCursor object. Throws: DKException if "command" is null or invalid, or "commandLangType" is not Federated Query type. Overrides: execute in class dkAbstractDatastore public dkResultSetCursor execute(dkQuery query) throws DKException, Exception Executes a command query of the federated datastore and returns a result set cursor. This method takes a Federated query object as an argument. Parameters: query--a federated dkQuery object Returns: a dkResultSetCursor object Throws: DKException if "query" object is null or query.qlType( ) is not DK_FEDERATED_QL_TYPE Overrides: execute in class dkAbstractDatastore public dkResultSetCursor execute(DKCQExpr cqe) throws DKException, Exception Executes a query expression. Parameters: cqe--a common query expression object Returns: resultSetCursor which represents a federated datastore cursor. Throws: DKException if "cqe" object is invalid Overrides: execute in class dkAbstractDatastore public void executeWithCallback(dkQuery query, dkcallback callbackObj) throws DKException, Exception Executes a query with callback function. Parameters: query--a query object callbackObj--a dkCallback object Overrides: executeWithCallback in class dkAbstractDatastore public void executeWithCallback(String command, short commandLangType, DKNVPair params[ ], dkcallback callbackObj) throws DKException, Exception Executes the query with callback function. Parameters: command--a query string commandLang--a query type params--additional query option in name/value pair callbackObj--a dkCallback object Overrides: executeWithCallback in class dkAbstractDatastore public void executeWithCallback(DKCQExpr cqe, dkcallback callbackObj) throws DKException, Exception Executes a query expression with callback function. Parameters: cqe--a common query expression object callbackObj--a dkCallback object Overrides: executeWithCallback in class dkAbstractDatastore public dkQuery createQuery(String command, short commandLangType, DKNVPair params[ ]) throws DKException Creates a federated query object. Parameters: command--a query string that represents the query criteria commandLangType--a query language type, it will be one of the following: DK_CM_TEMPLATE_QL_TYPE DK_CM_TEXT_QL_TYPE DK_CM_IMAGE_QL_TYPE DK_CM_PARAMETRIC_QL_TYPE DK_CM_COMBINED_QL_TYPE params[ ]--a name/value pairs list Returns: a federated dkQuery object Throws: DKException if "command" is null Overrides: createQuery in class dkAbstractDatastore public dkQuery createQuery(DKCQExpr qe) throws DKException Creates a query object. Parameters: cqe--a common query expression object Throws: DKException if "cqe" object is invalid Overrides: createQuery in class dkAbstractDatastore public dkcollection listDataSources( ) throws DKException Lists the available datastore sources that a user can connect to. Returns: a collection of ServerDef objects describing the servers Throws: DKException if internal error occurs from server Overrides: listDataSources in class dkAbstractDatastore public String[ ] listDataSource( )throws DKException Gets a list of datasource names. Returns: an array of datasource names Throws: DKException if error occurs when retrieving datasource names Overrides: listDataSourceNames in class dkAbstractDatastore public void addObject(dkDataObject dataobj) throws DKException, Exception Adds a DDO object. Parameters: ddo--a Federated object to be added. Throws: DKException if error occurs during add Overrides: addObject in class dkAbstractDatastore public void deleteObject(dkDataObject dataobj) throws DKException, Exception Deletes a data object. Parameters: ddo--a federated DDO object to be deleted Throws: DKException if error occurs during delete. Overrides: deleteObject in class dkAbstractDatastore public void retrieveObject(dkDataObject dataobj) throws DKException, Exception Retrieves a data-object. Parameters: ddo--document object to be retrieved. Throws: DKException when retrieve failed. Overrides: retrieveObject in class dkAbstractDatastore public void updateObject(dkDataObject dataobj) throws DKException, Exception Updates a data-object. Parameters: ddo--the data-object to be updated. Throws: DKException if error occurs in the datastore Overrides: updateObject in class dkAbstractDatastore public void commit( ) throws DKException Commits all activities since the last commit. Throws: DKException is thrown since federated datastore does not support transaction scope for now. Overrides: commit in class dkAbstractDatastore public void rollbacks throws DKException Rolls back all activities since the last commit. Throws: DKException is thrown since Federated does not support transaction scope for now. Overrides: rollback in class dkAbstractDatastore public boolean isconnected( ) Checks to see if the datastore is connected Returns: true if connected, false otherwise Overrides: isConnected in class dkAbstractDatastore public DKHandle connections throws Exception Gets the connection handle for the datastore. Returns: the connection handle Overrides: connection in class dkAbstractDatastore public DKHandle handle(String type) throws Exception Gets a datastore handle. Parameters: type--type of datastore handle wanted Returns: a datastore handle Overrides: handle in class dkAbstractDatastore public String userName( ) Gets the user name that user used to logon to the datastore. Returns: the userid that user used to logon Overrides: userName in class dkAbstractDatastore public String datastoreName( ) throws Exception Gets the name of this datastore object. Usually it represents a datastore source's server name. Returns: datastore name Overrides: datastoreName in class dkAbstractDatastore public String datastoreType( ) throws Exception Gets the datastore type for this datastore object. Returns: datastore type Overrides: datastoreType in class dkAbstractDatastore public dkDatastoreDef datastoreDef( ) throws DKException, Exception Gets datastore definition. Returns: the meta-data (dkDatastoreDef) of this datastore Overrides: datastoreDef in class dkAbstractDatastore public dkcollection listEntities( ) throws DKException, Exception Gets a list of federated entities from Federated server. Returns: a collection of dkEntityDef Throws: DKException if error occurs Overrides: listEntities in class dkAbstractDatastore public String[ ] listEntityNames( ) throws DKException, Exception Gets a list of federated entities names from Federated server. Returns: an array of names Throws: DKException if error occurs Overrides: listEntityNames in class dkAbstractDatastore public String[ ] listTextEntityNames( ) throws DKException, Exception Gets a list of federated text search entities names from Federated server. Returns: an array of names Throws: DKException if error occurs public String[ ] listParmEntityNames( ) throws DKException, Exception Gets a list of federated parametric search entities names from Federated server. Returns: an array of names Throws: DKException if error occurs Overrides: listEntityAttrs public dkcollection listEntityAttrs(String entityName) throws DKException, Exception Gets a list of attributes for a given entity name. Parameters: entityName--name of entity to retrieve attributes for Returns: a dkCollection of dkAttrDef objects Throws: DKException if the entity name does not exist Overrides: listEntityAttrs in class dkAbstractDatastore public String[ ] listEntityAttrNames(String entityName) throws DKException, Exception Gets a list of attribute names for a given entity name. Parameters: entityName--name of entity to retrieve attribute names for Returns: an array of attribute names Throws: DKException if the entity name does not exist Overrides: listEntityAttrNames in class dkAbstractDatastore public String registerMapping(DKNVPair sourceMap) throws DKException, Exception Registers a mapping definition to this datastore. Mapping is done by entities. Parameters: sourceMap--source name and mapping, a DKNVPair class with the following possible values: ("BUFFER",): buffer_ref is a reference to a string in memory ("FILE",): file_name is the name of the file containing the mapping ("URL",): URL-address location of the mapping ("LDAP",): LDAP file-name ("SCHEMA",): a reference to a dkSchemaMapping object defining the mapping. Currently, only "SCHEMA" option is supported, others may be added later. Returns: the name of the mapping definition. Overrides: registerMapping in class dkbstractDatastore See Also: unRegisterMapping public void unRegisterMapping(String mappingName) throws DKException, Exception Unregisters mapping information from this datastore. Parameters: mappingname--name of the mapping information Overrides: unRegisterMapping in class dkAbstractDatastore See Also: registerMapping public String[ ] listMappingNames( ) throws DKException, Exception Gets the list of the registered mappings for this datastore. Returns: an array of registered mapping objects' names. The array length would be zero if there is no mapping registered. Overrides: listMappingNames in class dkAbstractDatastore See Also: registerMapping public dkSchemaMapping getMapping(String mappingName) throws DKException, Exception Gets mapping information from this datastore. Parameters: mappingName--name of the mapping information Returns: the schema mapping object Overrides: getMapping in class dkAbstractDatastore See Also: registerMapping public synchronized dkextension getExtension(String extensionName) throws DKException, Exception Gets the extension object from a given extension name. Parameters: extensionname--name of the extension object. Returns: extension object. Overrides: getextension in class dkAbstractDatastore public synchronized void addExtension(String extensionName, dkExtension extensionObj) throws DKException, Exception Adds a new extension object. Parameters: extensionName--name of new extension object extensionObj--the extension object to be set Overrides: add Extension in class dkAbstractDatastore public synchronized void removeExtension(String extensionName) throws DKException, Exception Removes an existing extension object. Parameters: extensionName--name of extension object to be removed Overrides: removeExtension in class dkAbstractDatastore public synchronized String[ ] listExtensionNames( ) throws DKException, Exception Gets the list of extension objects' names. Returns: an array of extension objects' names Overrides: listExtensionNames in class dkAbstractDatastore public DKDDO createDDO(String objectType, int Flags) throws DKException, Exception Creates a new DDO with object type, properties and attributes set for a given backend server. Parameters: objectType--the object type Flags--to indicate various options and to specify more detailed characteristics of the DDO to create. For example, it may be a directive to create a document DDO, a folder, etc. Returns: a new DDO of the given object type with all the properties and attributes set, so that the user only needs to set the attribute values Overrides: createDDO in class dkAbstractDatastore public dkcollection listSearchTemplates( ) throws DKException, Exception Gets a list search templates from a federated server. Returns: a DKSequentialCollection of search templates Throws: DKException if internal datastore error occurs public String[ ] listSearchTemplateNames( ) throws DKException, Exception Gets a list search templates' names from a federated server. Returns: an array of search template names Throws: DKException if internal datastore error occurs public dkSearchTemplate getSearchTemplate(String templateName) throws DKException, Exception Gets a search template information from a given template name. Returns: dkSearchTemplate object. Throws: DKException if internal datastore error occurs public void destroy( ) throws DKException, Exception Destroys datastore--datastore cleanup if needed Overrides: destroy in class dkAbstractDatastore public synchronized string addRemoveCursor (dkResultSetCursor iCurt int action) throws DKException, Exception public dkDatastore datastoreByServerName (String dsType, String dsName) throws DKException, Exception Gets a reference to the specified datastore. The datastore must be connected, otherwise it will return null even if one is found. First, it will look in the free connection pool. If none found, it will look under the connection pool held by active cursors. public void changePassword (String serverName, String user Id, String oldPwd, String newPwd) throws DKException, Exception Changes the password of a given user Id for a specified server. Administrator only function. Parameters: userid--the user--id oldPwd--the old password newPwd--the new password public void requestConnection (String serverName, String userId, Stringpasswd, String connectString) throws DKException, Exception Requests a connection to a particular server with the given userid, password & connectString. Parameters: userId--the user Id passwd--the password connectString--the connect string to logon public void excludeServer (Sting serverName, String templateName) throws DKException, Exception Requests the named server to be skipped for the named search template. Parameters: serverName--a back end server name templateName--a search template name public boolean isServerExcluded (String serverName, String templateName) throws DKException, Exception, java.rmi. RemoteException Checks if the given server is in the excluded list for the named search template. Parameters: serverName--a back end server name templateName--a search template name Returns: true or false public String[ ] listExcludedServers(String templateName) throws DKException, Exception Lists all the excluded servers for the named search template Parameters: s--templateName--a search template name Returns: an array of server names that were excluded during search public void clearExcludedServers(String templateName) throws DKException, Exception Clears all the excluded servers for the named search template Parameters: s--templateName--a search template name The following is sample syntax of a federated query string. However, it is to be understood that other syntax, including other parameters, may be used for the federated query string without departing from the scope of the invention.
PARAMETRIC_SEARCH=([ENTITY=entity_name,]
[MAX_RESULTS=maximum_results,]
[COND=(conditional_expression)]
[;...]
);
[OPTION=([CONTENT=yes_no]
)]
[and_or
TEXT_SEARCH=(COND=(text_search_expression)
);
[OPTION=([SEARCH_INDEX={search_index_name .vertline. (index_list) };]
[MAX_RESULTS=maximum_results;]
[TIME_LIMIT=time_limit]
)]
]
[and_or
IMAGE_SEARCH=(COND=(image_search_expression)
);
[OPTION=([SEARCH_INDEX={search_list) };]
[MAX_RESULTS=maximum_results;]
)]
]
There are several mechanisms for users to submit federated queries for execution. For example, users can create a federated query string and pass it to a federated query object and then invoke an execute or evaluate method on that object to trigger the query processing. Alternatively, a user can pass the federated query string to the execute or evaluate method in the federated datastore to process the query directly. The query string will be parsed into a federated query canonical form (query expression), which is essentially a datastore neutral representation of the query. In case the input query comes from a graphical user interface (GUI) based application, the query does not need to be parsed and the corresponding canonical form can be directly constructed. The query canonical form is the input for the federated query processor module. This module will perform the following tasks: Query translation. Translates the query canonical form into several native queries that corresponds to each native datastore associated to this federated datastore. The translation information is obtained from the schema mapping. Data conversion. Converts data in the query into a native data type for each of the associated native datastores. This process uses the mapping and conversion mechanisms described in the schema mapping. Data filtering. Filters only the relevant data during the construction of native queries. Each native query is submitted to the corresponding native datastore for execution. Initially, the results returned are cursors to the data in each datastore. The end-result of an initial query is a federated result set cursor object, which is a virtal collection (i.e., at this time, data has not actually been retrieved) of cursors to objects in each of the native datastores. The user can retrieve the actual data using a fetch. When a fetch is issued for data, the data is returned by the native datastores to the federated query results processor module, which will do the following: Data conversion. Converts data from the native type into a federated type according to the mapping information. Data filtering. Filters the results to include only the requested data Result merging. Merges the results from several native datastores into a federated collection. The federated result set cursor object provides the facility to separate query results according to the source native datastores. To do such a processing, the user/application may either use the federated cursor to fetch data or a native datastore cursor to fetch data from a particular datastore. A FederatedQuery represents and executes queries across heterogeneous datastores. This query can be a combination of a DL parametric query, OnDemand query, and other query types involving supported datastores. To retrieve data from each datastore, the federated datastore delegates the query processing task to each of the native datastores.
DKFederatedQuery.java
package com.ibm.mm.sdk.common.DKFederatedQuery
public class DKFederatedQuery
extends Object
implements dkQuery, DKConstant, DKMessageId, Serializable
{
public DKFederatedQuery(dkDatastore creator,
String queryString)
public DKFederatedQuery(dkDatastore creator,
public DKFederatedQuery(DKFederatedQuery fromQuery)
public void prepare(DKNVPair params[ ]) throws DKException, Exception
public void execute(DKNVPair params[ ]) throws DKException, Exception
public int status( )
public Object result( ) throws DKException, Exception
public dkResultSetCursor resultSetCursor( ) throws DKException,
Exception
public short qlType( )
public String queryString( )
public dkDatastore getDatastore( )
public void setDatastore(dkDatastore ds) throws DKException, Exception
public String getName( )
public void setName(String name)
public int numberOfResults( )
};
The following methods are part of the federated query class: public DKFederatedQuery(dkDatastore creator, String queryString) Constructs a Federated query. Parameters: creator--datastore queryString--a query string public DKFederatedQuery(dkDatastore creator, DKCQExpr queryExpr) Constructs a Federated query Parameters: creator--datastore queryExpr--a query expression public DKFederatedQuery(DKFederatedQueryfromQuery) Constructs a Federated query from a Federated query object. Parameters: fromQuery--Federated query public voidprepare(DKNVPair params[ ]) throws DKException, Exception Prepares a query. Parameters: params--additional prepare query option in name/value pair public void execute(DKNVPair params[ ]) throws DKException, Exception Executes a query. Parameters: params--additional query option in name/value pair public int status( ) Gets query status. Returns: query status public Object result( ) throws DKException, Exception Gets query result. Returns: query result in a DKResults object public dkResultSetCursor resultSetCursor( ) throws DKException, Exception Gets query result. Returns: query result in a dkResultSetCursor object public short qlType( ) Gets query type. Returns: query type public String querystring( ) Gets query string Returns: query string public dkDatastore getDatastore( ) Gets the reference to the owner datastore object. Returns: the dkDatastore object public void setDatastore(dkDatastore ds) throws DKException, Exception Sets the reference to the owner datastore object. Parameters: ds--a datastore public String getName( ) Gets query name. Returns: name of this query public void setName(String name) Sets query name. Parameters: name--new name to be set to this query object public int numberOfResults( ) Gets the number of query results. Returns: number of query results 3. Digital Library Datastore DKDatastoreDL is a specific version of dkDatastore used to implement the Digital Library/Visual Info datastore. It provides Documents, Parts and Folders storage and retrieval mechanisms, as well as search and other document processing capabilities supported by Digital Library. An example class definition for DKDatastoreDL is set forth below.
DKDatastoreDL
package com.ibm.mm.sdk.server.DKDatastoreDL
public class DKDatastoreDL
extends dkAbstractDatastore
implements DKConstantDL, DKMessageIdDL
{
public DKDatastoreDL() throws DKException, Exception
public DKDatastoreDL(String configuration) throws DKException,
Exception
public void connect(String datastore_name,
String user_name,
String authentication,
String connect_string) throws DKException, Exception
public void disconnect() throws DKException, Exception
public Object getOption(int option) throws DKException, Exception
public void setOption(int option,
Object value) throws DKException, Exception
public Object evaluate(String command,
short commandLangType,
DKNVPair params[]) throws DKException, Exception
public Object evaluate(dkQuery query) throws DKException, Exception
public Object evaluate(DKCQExpr qe) throws DKException, Exception
public dkResultSetCursor execute(String command,
short commandLangType,
DKNVPair params[]) throws DKException, Exception
public dkResultSetCursor execute(dkQuery query) throws DKException,
Exception
public dkResultSetCursor execute(DKCQExpr cqe) throws DKException,
Exception
public void executeWithCallback(dkQuery query,
dkCallback callbackObj) throws DKException, Exception
public void executeWithCallback(String command,
short commandLangType,
DKNVPair params[],
dkCallback callbackObj) throws DKException, Exception
public void executeWithCallback(DKCQExpr qe,
dkCallback callbackObj) throws DKException, Exception
public dkQuery createQuery(String command,
short commandLangType,
DKNVPair params[]) throws DKException, Exception
public dkQuery createQuery(DKCQExpr qe) throws DKException, Exception
public void addObject(dkDataObject ddo) throws DKException, Exception
public void deleteObject(dkDataObject ddo) throws DKException,
Exception
public void retrieveObject(dkDataObject ddo) throws DKException,
Exception
public void updateObject(dkDataObject ddo) throws DKException,
Exception
public void moveObject(dkDataObject ddo,
String entityName) throws DKException, Exception
public void startTransaction() throws DKException, Exception
public void commit() throws DKException, Exception
public void rollback() throws DKException, Exception
public boolean isConnected() throws Exception
public String datastoreName() throws Exception
public String datastoreType() throws Exception
public DKHandle connection() throws Exception
public DKHandle handle(String type) throws Exception
public DKHandle transactionConnection() throws DKException, Exception
public String userName() throws Exception
public dkCollection listDataSources() throws DKException, Exception
public String[] listDataSourceNames() throws DKException, Exception
public Object listServers() throws DKException, Exception
public Object listSchema() throws DKUsageError
public Object listSchemaAttributes(String schemaEntry) throws
DKusageError,
DKDatastoreAccessError
public dkCollection listEntities() throws DKException, Exception
public String[] listEntityNames() throws DKException, Exception
public dkCollection listEntityAttrs(String entityName) throws
DKException, Exception
public String[] listEntityAttrNames(String entityName) throws
DKException, Exception
public void wakeUpService(String searchEngine) throws DKException,
Exception
public void invokeSearchEngine(String searchEngine,
String searchIndex) throws DKException, Exception
public dkDatastoreDef datastoreDef()
public DKWorkFlowServiceDL createWorkFlowService() throws DKException,
Exception
public String registerMapping(DKNVPair sourceMap) throws DKException,
Exception
public void unRegisterMapping(String mappingName) throws DKException,
Exception
public String[] listMappingNames() throws DKException, Exception
public dkschemaMapping getMapping(String mappingName) throws
DKException,
Exception
public synchronized dkExtension getExtension(String extensionName)
throws
DKException, Exception
public synchronized void addExtension(String extensionName,
dkExtension extensionObj) throws DKException, Exception
public synchronized void removeExtension(String extensionName) throws
DKException,
Exception
public synchronized String[] listExtensionNames() throws DKException,
Exception
public DKDDO createDDO(String objectType,
int Flags) throws DKException, Exception
public void destroy() throws DKException, Exception
public boolean isCheckedOut(dkDataObject dobj) throws DKUsageError,
DKDatastoreAccessError
public String checkedOutUserid(dkDataObject dobj) throws DKUsageError,
DKDatastoreAccessError
public void unlockCheckedOut(dkDataObject dobj) throws DKUsageError,
DKDatastoreAccessError
public void checkOut(dkDataObject dobj) throws DKUsageError,
DKDatastoreAccessError
public void checkln(dkDataObject dobj) throws DKUsageError,
DKDatastoreAccessError
public void changePassword(String userId,
String oldPwd,
String newPwd) throws DKException, Exception
public synchronized dkXDO retrieveFormOverlay(String objid) throws
DKException,
Exception
public DKCQExpr translate(DKCQExpr cqe) throws DKException, Exception
}
The following methods are part of the DKDatastoreDL class: public DKDatastoreDL( ) throws DKException, Exception Constructs the datastore and initializes the datastore. public DKDatastoreDL(String configuration) throws DKException, Exception Constructs the datastore and initializes the datastore. public void connect(String datastore_name, String user_name, String authentication, String connect_string) throws DKException, Exception Connects to a datastore. Parameters: datastore_name--the datastore name used for connection user_name--the user name used for connection authentication--the authentication used for connection connect_string--the connect sting used for connection. This is used to provide additional connection options. Overrides: connect in class dkAbstracDatastore public void disconnect( ) throws DKException, Exception Disconnects from a datastore. Overrides: disconnect in class dkAbstractDatastore public Object getOption(int option) throws DKException, Exception Gets a datastore option. Parameters: option--the option identifier Returns: an option value Overrides: getOption in class dkAbstractDatastore public void setOption(int option, Object value) throws DKException, Exception Sets a datastore option. Parameters: option--the option identifier value--the option value Overrides: setOption in class dkAbstractDatastore public Object evaluate(String command, short commandLangType, DKNVPair params[ ]) throws DKException, Exception Evaluates the query. Parameters: command--a query string commandlang--a query type params--additional query option in name/value pair Returns: a collection of the results Overrides: evaluate in class dkAbstractDatastore public Object evaluate(dkquery query) throws DKException, Exception Evaluates the query. Parameters: query--a query object Returns: a collection of the results Overrides: evaluate in class dAbstractDatastore public Object evaluate(DKCQExpr qe) throws DKException, Exception Evaluates the query. Parameters: qe--a common query expression object Returns: a collection of the results Overrides: evaluate in class dkAbstractDatastore public dkResultSetCursor execute(String command, short commandLangType, DKNVPairparams[ ]) throws DKException, Exception Executes the query. Parameters: command--a query sting commandlang--a query type params--additional query option in name/value pair Returns: resultSetCursor which represents a datastore cursor. Overrides: execute in class dkAbstractDatastore public dkResultSetCursor execute(dkQuery query) throws DKException, Exception Executes the query. Parameters: query--a query object Returns: resultSetCursor which represents a datastore cursor. Overrides: execute in class dkAbstractDatastore public dkResultSetCursor execute(DKCQExpr cqe) throws DKException, Exception Executes a query expression and returns a result set cursor Parameters: cqe--a common query expression object Returns: resultSetCursor which represents a datastore cursor. Overrides: execute in class dkAbstractDatastore public void executeWithCallback(dkQuery query, dkcallback callbackObj) throws DKException, Exception Executes the query with callback function. Parameters: qo--a query object callbackObj--a dkCallback object Overrides: executeWithCallback in class dkAbstractDatastore public void executeWithCallback(String command, short commandLangType, DKNVAPair params[ ], dkcallback callbackObj) throws DKException, Exception Executes the query with callback function. Parameters: command--a query string commandLang--a query type params--additional query option in name/value pair callbackObj--a dkCallback object Overrides: executeWithCallback in class dkAbstractDatastore public void executeWithCallback(DKCQExpr qe, dkcallback callbackObj) throws DKException, Exception Executes the query with callback function. Parameters: qe--a common query expression object callbackObj--a dkCallback object Overrides: executeWithCallback in class dkAbstractDatastore public dkQuery createQuery(String command, short commandLangType, DKNVPair params[ ]) throws DKException, Exception Creates a query object. Parameters: command--a query string commandlang--a query type params--additional query option in name/value pair Returns: a query object Overrides: createQuery in class dkAbstractDatastore public dkQuery createQuery(DKCQExpr qe) throws DKException, Exception Creates a query object. Parameters: qe--a common query expression object Overrides: createQuery in class dkAbstractDatastore public void addObject(dkDataObject ado) throws DKException, Exception Adds this data-object to the DL datastore. Parameters: ddo--the data-object to be added to this datastore Overrides: addObject in class dkAbstractDatastore See Also: add public void deleteObject(dkDataObject ddo) throws DKException, Exception Deletes this data-object from this datastore. Parameters: ddo--the data-object to be deleted from this datastore Overrides: deleteObject in class dkAbstractDatastore See Also: del public void retrieveObject(dkDataObject ddo) throws DKException, Exception Retrieves the data-object from this datastore. Parameters: ddo--the data-object to be retrieved from this datastore Overrides: retrieveObject in class dkAbstractDatastore See Also: retrieve public void updateObject(dkDataObject ddo) throws DKException, Exception Updates the data-object in this datastore. Parameters: ddo--the data-object to be updated in this datastore Overrides: updateObject in class dkAbstractDatastore See Also: update public void moveObject(dkDataObject ddo, String entityName) throws DKException, Exception Moves the data-object from one index class to another in this datastore. Parameters: ddo--the data-object to be move in this datastore entityName--new entity name to move this data-object to public void startTransaction( ) throws DKException, Exception Starts a transaction public void commit( ) throws DKException, Exception Commits a datastore transaction Overrides: commit in class dkAbstractDatastore public void rollback( ) throws DKException, Exception Rolls back a datastore transaction Overrides: rollback in class dkAbstractDatastore public boolean isconnected( ) throws Exception Checks to see if the datastore is connected. Returns: true if connected Overrides: isConnected in class dkAbstractDatastore public String datastoreName( ) throws Exception Gets the name of this datastore object. Usually it represents a datastore source's server name. Returns: datastore name Overrides: datastoreName in class dkAbstracDatastore public String datastoreType( ) throws Exception Gets the datastore type for this datastore object Returns: datastore type Overrides: datastoreType in class dkAbstractDatastore public DKHandle connection( ) throws Exception Gets the connection handle for a datastore Returns: connection handle Overrides: connection in class dkAbstractDatastore public DKHandle handle(String type) throws Exception Gets a datastore handle Parameters: type--type of datastore handle wanted Returns: a datastore handle Overrides: handle in class dkAbstractDatastore public DKHandle transactionConnection( ) throws DKException, Exception Gets the transaction handle for a datastore Returns: transaction handle public String userName( ) throws Exception Gets the user name for this datastore object Returns: user name Overrides: userName in class dkAbstractDatastore public dkCollection listDataSources( ) throws DKException, Exception List the available datastore sources that can be used to connect with. Returns: a collection of server definitions Overrides: listDataSources in class dkAbstractDatastore public String[ ] listDataSourceNames( ) throws DKException, Exception Lists the available datastore source names that can be used to connect with. Returns: an array of server names Overrides: listDataSourceNames in class dkAbstractDatastore public Object listServers( ) throws DKException, Exception Lists the available datastore sources that can be used to connect with. Note: listservers( ) is deprecated. Replace by listDataSources. Returns: a collection of server definitions Overrides: listServers in class dkAbstractDatastore See Also: listDataSources public Object listschema( ) throws DKUsageError Lists the entities that belong to this datastore. Note: listschema( ) is deprecated. Replace by listentities. Returns: an object that contains the schema Overrides: listSchema in class dkAbstractDatastore See Also: listEntities public Object listSchemaAttributes(String schemaEntry)throwsDKUsageError, DKDatastoreAccessError Lists the attributes that belong to a schema Note: listSchemaAttributes( ) is deprecated. Replace by listEntityAttributes. Parameters: schemaEntry--the name of the schema Returns: an object that contains the attributes that belong to this schema Overrides: listSchemaAttributes in class dkAbstractDatastore See Also: listEntityAttrs public dkCollection listEntities( ) throws DKException, Exception Gets a list of entities from persistent datastore Returns: a collection of entity defs Throws: DKException if error occurs Overrides: listEntities in class dkAbstractDatastore public String[ ] listEntityNames( ) throws DKException, Exception Gets a list of entity names from persistent datastore Returns: an array of entity names Throws: DKException if error occurs Overrides: listEntityNames in class dkAbstractDatastore public dkcollection listEntityAttrs(String entityName) throws DKException, Exception Gets a list of attributes for a given entity name. Parameters: entityName--name of entity to retrieve attributes for Returns: a dkCollection of dkAttrDef objects Throws: DKException if the entity name does not exist Overrides: listEntityAttrs in class dkAbstractDatastore public String[ ] listEntityAttrNames(String entityName) throws DKException, Exception Gets a list of attribute names for a given entity name. Parameters: entityName--name of entity to retrieve attribute names for Returns: an array of attribute names Throws: DKException if the entity name does not exist Overrides: listEntityAttrNames in class dkAbstractDatastore public void wake UpService(String searchEngine) throws DKException, Exception Wakes up a user exit to process search index request. Note: wakeUpService( ) is deprecated. Replace by invokeSearchEngine. Parameters: searchengine--search engine name (SM) See Also: invokeSearchEngine public void invokeSearchEngine(String searchEngine, String searchIndex) throws DKException, Exception Invokes a user exit to process search index request. Parameters: searchEngine--search engine name (ie SM or QBIC) searchIndex--search index (ie TM-TMINDEX or QBICDB-QBICCAT-QBICSRV) public dkDatastoreDef datastoreDef( ) Gets datastore definition Returns: the meta-data (dkDatastoreDef) of this datastore Overrides: datastoreDef in class dkAbstractDatastore public DKWorkFlowServiceDL createWorkFlowService( ) throws DKException, Exception Gets work flow service Returns: the a work flow service for this datastore public String registerMapping(DKNVPair sourceMap) throws DKException, Exception Registers a mapping definition to this datastore. Mapping is done by entities. Parameters: sourceMap--source name and mapping, a DKNVPair class with the following possible values: ("BUFFER",): buffer_ref is a reference to a string in memory ("FILE",): file_name is the name of the file containing the mapping ("URL",): URL-address location of the mapping ("LDAP",): LDAP file-name "SCHEMA",): a reference to a dkSchemaMapping object defining the mapping. Currently, only "SCHEMA" option is supported, others may be added later. Returns: the name of the mapping definition. Overrides: registerMapping in class dkAbstractDatastore See Also: unRegisterMapping public void unRegisterMapping(String mappingName) throws DKException, Exception Unregisters mapping information from this datastore. Parameters: mappingName--name of the mapping information Overrides: unRegisterMapping in class dkAbstractDatastore See Also: registerMapping public String[ ] listMappingNames( ) throws DKException, Exception Gets the list of the registered mappings from this datastore. Returns: an array of registered mapping objects' names Overrides: listMappingNames in class dkAbstractDatastore See Also: registerMapping public dkSchemaMapping getMapping(String mappingName) throws DKException, Exception Gets a mapping information from this datastore. Parameters: mappingName--name of the mapping information Returns: the schema mapping object Overrides: getMapping in class dkAbstractDatastore See Also: registerMapping public synchronized dkExtension getExtension(String extensionName) throws DKException, Exception Gets the extension object from a given extenstion name. Parameters: extensionname--name of the extension object. Returns: extension object. Overrides: getextension in class dkAbstractDatastore public synchronized void addExtension(String extensionName, dkExtension extensionObj) throws DKException, Exception Adds a new extension object. Parameters: extensionname--name of new extension object extensionObj--the extension object to be set Overrides: addextension in class dkAbstractDatastore public synchronized void removeExtension(String extensionName) throws DKException, Exception Removes an existing extension object Parameters: extensionName--name of extension object to be removed Overrides: removeExtension in class dkAbstractDatastore public synchronized String[ ] listExtensionNames( ) throws DKException, Exception Gets the list of extension objects' names Returns: an array of extension objects' names Overrides: listExtensionNames in class dkAbstractDatastore public DKDDO createDDO(String objectType, int Flags) throws DKException, Exception Creates a new DDO with object type, properties and attributes set for a given backend server. Parameters: objectType--the object type user wants to create Flags--to indicate various options to specify more detailed characteristics of the DDO to create. For example, it may be a directive to create a document DDO, a folder, etc. Returns: a new DDO of the given object type with all the properties and attributes set, so that the user only need to set the attribute values Overrides: createDDO in class dkAbstractDatastore public void destroy( ) throws DKException, Exception Destroys datastore--datastore cleanup if needed Overrides: destroy in class dkAbstractDatastore public boolean isCheckedOut(dkDataObject dobj) throws DKUsageError, DKDatastoreAccessError Checks whether a document or folder item is checked out from datastore Parameters: dobj--data object (document or folder item) Returns: a boolean indicating if it is checked out or not public String checkedOutUserid(dkDataObject dobj) throws DKUsageError, DKDatastoreAccessError Lists the userid who checked out the document or folder Parameters: dobj--data object (document or folder item) Returns: a userid or empty string (i.e., not checked out) public void unlockCheckedOut(dkDataObject dobj) throws DKUsageError, DKDatastoreAccessError Unlocks the checked-out document or folder item Parameters: dobj--data object (document or folder item) public void checkOut(dkDataObject dobj) throws DKUsageError, DKDatastoreAccessError Checks out document or folder item from datastore Parameters: dobj--data object (document or folder item) public void checkln(dkDataObject dobj) throws DKUsageError, DKDatastoreAccessError Checks in document or folder item from datastore Parameters: dobj--data object (document or folder item) public void changePassword(String userId, String oldPwd, String newPwd) throws DKException, Exception Changes LS user password Overrides: changepassword in class dkAbstractDatastore public synchronized dkXDO retrieveFormOverlay(String objid) throws DKException, Exception Retrieves the form overlay object Parameters: id--the id string to retrieve the object Returns: the form overlay xdo object public void moveObject (dkDataObject ddo, String entityName) throws DKException, Exception Moves the data object from one index class to another. Parameters: ddo--data object to be moved entityName--target index class for this data object public DKCQExpr translate(DKCQExpr cqe) throws DKException, Exception Translates a query expression into a native query expression processable by this datastore. Parameters: cqe--the input compound query expression Returns: a translated query expression or null if the expression is invalid 4. OBIC Datastore DKDatastoreQBIC is a specific version of dkDatastore used to implement the QBIC datastore. An example class definition for DKDatastoreQBIC is set forth below.
DKDatastoreQBIC
package com.ibm.mm.sdk.server.DKDatastOreQBIC
public class DKDatastoreQBIC
extends dkAbstractDatastore
implements DKCorstantDL, DKMessageIdDL
{
public DKDatastOreQBIC() throws DKException, Exception
public DKDatastoreQBIC(String configuration) throws DKException,
Exception
public void connect(String datastore_name,
String user_name,
String authentication,
String connect_string) throws DKException, Exception
public void disconnect() throws DKException, Exception
public Object getOption(int option) throws DKException, Exception
public void setOption(int option,
Object value) throws DKException, Exception
public Object evaluate(String command,
short commandLangType,
DKNVPair params[]) throws DKException, Exception
public Object evaluate(dkQuery query) throws DKException, Exception
public Object evaluate(DKCQExpr qe) throws DKException, Exception
public dkResultSetCursor execute(String command,
short commandLangType,
DKNVPair params[]) throws DKException, Exception
public dkResultSetCursor execute(dkQuery query) throws DKException,
Exception
public dkResultSetCursor execute(DKCQExpr qe) throws DKException,
Exception
public void executeWithCallback(dkQuery query,
dkCallback callbackObj) throws DKException, Exception
public void executewithCallback(String command,
short commandLangType,
DKNVPair params[],
dkCallback callbackObj) throws DKException, Exception
public void executeWithCallback(DKCQExpr qe,
dkCallback callbackObj) throws DKException, Exception
public dkQuery createQuery(String command,
short commandLangType,
DKNVPair params[]) throws DKException, Exception
public dkQuery createQuery(DKCQExpr qe) throws DKException, Exception
public void addObject(dkDataObject ddo) throws DKException, Exception
public void deleteObject(dkDataObject ddo) throws DKException,
Exception
public void retrieveObject(dkDataObject ddo) throws DKException,
Exception
public void updateObject(dkDataObject ddo) throws DKException,
Exception
public void commit() throws DKException, Exception
public void rollback() throws DKException, Exception
public boolean isConnected() throws Exception
public String datastoreName() throws Exception
public String datastoreType() throws Exception
public DKHandle connection() throws Exception
public DKHandle handle(String type) throws Exception
public String userName() throws Exception
public dkCollection listDataSources() throws DKException, Exception
public String[] listDataSourceNames() throws DKException, Exception
public Object listServers() throws DKException, Exception
public Object listSchema() throws DKException, Exception
public Object listSchemaAttributes(String schemaEntry) throws
DKException, Exception
public dkCollection listEntities() throws DKException, Exception
public String[] listEntityNames() throws DKException, Exception
public dkCollection listEntityAttrs(String entityName) throws
DKException, Exception
public String[] listEntityAttrNames(String entityName) throws
DKException, Exception
public void destroy() throws DKException, Exception
public void createDatabase(String database_name) throws DKException,
Exception
public void deleteDatabase(Suing database_name) throws DKException,
Exception
public void createCatalog(String database_name,
String catalog_name) throws DKException, Exception
public void deleteCatalog(String database_name,
String catalog_name) throws DKException, Exception
public void openCatalog(String database_name,
String catalog_name) throws DKException, Exception
public void closeCatalog() throws DKException, Exception
public void addColorFeature() throws DKException, Exception
public void addDrawFeature() throws DKException, Exception
public void addColorHistogramFeature() throws DKException, Exception
public void addTextureFeature() throws DKException, Exception
public void addFeature(int featureSelection,
boolean bReCatalog) throws DKException, Exception
public void removeColorFeature() throws DKException, Exception
public void removeDrawFeature() throws DKException, Exception
public void removeColorHistogramFeature() throws DKException, Exception
public void removeTextureFeature() throws DKException, Exception
public void processImages(DKImageRecordQBIC imageList[],
int count) throws DKException, Exception
public synchronized void queueImages(DKImageRecordQBIC imageList[],
int count) throws DKException, Exception
public void processImageQueue() throws DKException, Exception
public void reCatalogImages(int featureSelectionList) throws
DKException, Exception
public Object listDatabases() throws DKException, Exception
public Object listCatalogs() throws DKException, Exception
public Object listCatalogs(String database_name) throws DKException,
Exception
public Object listFeatures() throws DKException, Exception
public Object listColorImages() throws DKException, Exception
public Object listHistogramImages() throws DKException, Exception
public Object listDrawImages() throws DKException, Exception
public Object listTextureImages() throws DKException, Exception
public String databaseName() throws DKException, Exception
public String catalogName() throws DKException, Exception
public String getLibServerName() throws DKException, Exception
public dkDatastoreDef datastoreDef() throws DKException, Exception
public String registerMapping(DKNVPair sourceMap) throws DKException,
Exception
public void unRegisterMapping(String mappingName) throws DKException,
Exception
public String[] listMappingNames() throws DKException, Exception
public dkSchemaMapping getMapping(String mappingName) throws
DKException,
Exception
public synchronized dkExtension getExtension(String extensionName)
throws
DKException, Exception
public synchronized void addExtension(String extensionName,
dkExtension extensionObj) throws DKException,
Exception
public synchronized void removeExtension(String extensionName) throws
DKException,
Exception
public synchronized String[] listExtensionNames() throws DKException,
Exception
public DKDDO createDDO(String objectType,
int Flags) throws DKException, Exception
}
The following methods are part of the DKDatastoreQBIC class: public DKDatastoreQBICO throws DKException, Exception Constructs the datastore and initializes the datastore. public DKDatastoreQBIC(String configuration) throws DKException, Exception Constructs the datastore and initializes the datastore. public void connect(String datastore_name, String user_name, String authentication, String connect_string) throws DKException, Exception Connects to a datastore. Parameters: datastore_nane--the datastore name used for connection user_name--the user name used for connection authentication--the authentication used for connection connect_string--the connect string used for connection. This is used to provide additional connection options. Overrides: connect in class dkAbstractDatastore public void disconnect( ) throws DKException, Exception Disconnects to a datastore. Overrides: disconnect in class dkAbstractDatastore public Object getOption(int option) throws DKException, Exception Gets a datastore option. Parameters: option--the option identifier Returns: an option value Overrides: getOption in class dkAbstractDatastore public void setOption(int option, Object value) throws DKException, Exception Sets a datastore option. Parameters: option--the option identifier value--the option value Overrides: setOption in class dkAbstractDatastore public Object evaluate(String command, short commandLangType, DKNVPair params[ ]) throws DKException, Exception Evaluates the query. Parameters: command--a query string commandLang--a query type params--additional query option in name/value pair Returns: a collection of the results Overrides: evaluate in class dkAbstractDatastore public Object evaluate(dkQuery query) throws DKException, Exception Evaluates the query. Parameters: query--a query object Returns: a collection of the results Overrides: evaluate in class dkAbstractDatastore public Object evaluate(DKCQExpr qe) throws DKException, Exception Evaluates the query. Parameters: qe--a common query expression object Returns: a collection of the results Overrides: evaluate in class ckAbstractDatastore public dkResultSetCursor execute(String command, short commandLangType, DKNVPairparams[ ]) throws DKException, Exception Executes the query. Parameters: command--a query string commandLang--a query type params--additional query option in name/value pair Returns: resultSetCursor which represents a datastore cursor. Overrides: execute in class dkAbstractDatastore public dkResultSetCursor execute(dkQuery query) throws DKException, Exception Executes the query. Parameters: query--a query object Returns: resultSetCursor which represents a datastore cursor. Overrides: execute in class dkAbstractDatastore public dkResultSetCursor execute(DKCQExpr qe) throws DKException, Exception Executes the query. Parameters: qe--a common query expression object Returns: resultSetCursor which represents a datastore cursor. Overrides: execute in class dkAbstractDatastore public void executeWithCallback(dkQuery query, dkcallback callbackObj) throws DKException, Exception Executes the query with callback function. Parameters: qo--a query object callbackObj--a dkCallback object Overrides: executeWithCallback in class dkAbstractDatastore public void executeWithCallback(String command, short commandLangType, DKNVPair params[ ], dkCallback callbackObj) throws DKException, Exception Executes the query with callback function. Parameters: command--a query string commandLang--a query type params--additional query option in name/value pair callbackObj--a dkCallback object Overrides: executeWithCallback in class dkAbstractDatastore public void executeWithCallback(DKCQExpr qe, dkcallback callbackObj) throws DKException, Exception Executes the query with callback function. Parameters: qe--a common query expression object callbackObj--a dkCallback object Overrides: executeWithCallback in class dkAbstractDatastore public dkQuery createQuery(String command, short commandLangType, DKNVPairparams[ ]) throws DKException, Exception Creates a query object. Parameters: command--a query string commandLang--a query type params--additional query option in name/value pair Returns: a query object Overrides: createQuery in class dkAbstractDatastore public dkQuery createQuery(DKCQExpr qe) throws DKException, Exception Creates a query object. Parameters: qe--a common query expression object Overrides: createQuery in class dkAbstractDatastore public void addObject(dkDataObject ddo) throws DKException, Exception Adds this ddo to this datastore. Parameters: ddo--the ddo to be added to this Datastore Overrides: addObject in class dkAbstractDatastore public void deleteObject(dkDataObject ddo) throws DKException, Exception Deletes this ddo from this datastore. Parameters: ddo--the ddo to be deleted from this Datastore Overrides: deleteObject in class dkAbstractDatastore public void retrieveObject(dkDataObject ddo) throws DKException, Exception Retrieves this ddo from this datastore. Parameters: ddo--the ddo to be retrieved from this Datastore Overrides: retrieveObject in class dkAbstractDatastore public void updateObject(dkDataObject ddo) throws DKException, Exception Updates this ddo in this datastore. Parameters: ddo--the ddo to be updated in this Datastore Overrides: updateObject in class dkAbstractDatastore public void commit( ) throws DKException, Exception Commits a datastore transaction Overrides: commit in class dkAbstractDatastore public void rollback( ) throws DKException, Exception Rolls back a datastore transaction Overrides: rollback in class dkAbstractDatastore public boolean isconnected( ) throws Exception Checks to see if the datastore is connected. Returns: true if connected Overrides: is Connected in class dkAbstractDatastore public String datastoreName( ) throws Exception Gets the name of his datastore object. Usually it represents a datastore source's server name. Returns: datastorename Overrides: datastorename in class dkAbstractDatastore public String datastoreType() throws Exception Gets the datastore type for this datastore object Returns: datastore type Overrides: datastoreType in class dkAbstractDatastore public DKHandle connection( ) throws Exception Gets the connection handle for a Datastore Returns: connection handle Overrides: connection in class dkAbstractDatastore public DKHandle handle(String type) throws Exception Gets a datastore handle Parameters: type--type of datastore handle wanted Returns: a datastore handle Overrides: handle in class dkAbstractDatastore public String userName( ) throws Exception Gets the user name for this datastore object Returns: | ||||||
