Enterprise Information Portal APIs

com.ibm.mm.sdk.server
Class DKDatastoreDB2

java.lang.Object
  |
  +--com.ibm.mm.sdk.server.dkAbstractDatastore
        |
        +--com.ibm.mm.sdk.server.DKDatastoreDB2
All Implemented Interfaces:
DKConstant, DKConstantDB2, dkDatastore, dkDatastoreIntDB2, DKMessageId, DKMessageIdDB2, dkQueryEvaluator, dkQueryManager

public class DKDatastoreDB2
extends dkAbstractDatastore
implements dkDatastoreIntDB2, DKConstantDB2, DKMessageIdDB2

DKDatastoreDB2 is the specific version of dkDatastore to implement the DB2 datastore.


Fields inherited from interface com.ibm.mm.sdk.common.DKConstantDB2
    For details, see the class or interface
 
Fields inherited from interface com.ibm.mm.sdk.common.DKConstant
    For details, see the class or interface
 
Fields inherited from interface com.ibm.mm.sdk.common.DKMessageIdDB2
    For details, see the class or interface
 
Fields inherited from interface com.ibm.mm.sdk.common.DKMessageId
    For details, see the class or interface
 
Constructor Summary
DKDatastoreDB2()
          Constructs the datastore and initializes the datastore.
DKDatastoreDB2(java.lang.String configuration)
          Constructs the datastore and initializes the datastore.
 
Method Summary
 void addExtension(java.lang.String extensionName, dkExtension extensionObj)
          Adds a new extension object.
 void addObject(dkDataObject ddo)
          Adds this data-object to the DL datastore.
 void commit()
          Commits a datastore transaction
 void connect(java.lang.String datastore_name, java.lang.String user_name, java.lang.String authentication, java.lang.String connect_string)
          Connects to a datastore.
 DKHandle connection()
          Gets the connection handle for a datastore
 DKDDO createDDO(java.lang.String objectType, int Flags)
          Creates a new DDO with object type, properties and attributes set for a given backend server.
 dkQuery createQuery(DKCQExpr qe)
          Creates a query object.
 dkQuery createQuery(java.lang.String command, short commandLangType, DKNVPair[] params)
          Creates a query object.
 dkDatastoreDef datastoreDef()
          Get datastore definition
 java.lang.String datastoreName()
          Gets the name of this datastore object.
 java.lang.String datastoreType()
          Gets the datastore type for this datastore object
 void deleteObject(dkDataObject ddo)
          Deletes this data-object from this datastore.
 void destroy()
          datastore destroy - datastore cleanup if needed
 void disconnect()
          Disconnects from a datastore.
 DKHandle environment()
          Gets the environment handle for a datastore
 java.lang.Object evaluate(DKCQExpr qe)
          evaluates the query.
 java.lang.Object evaluate(dkQuery query)
          evaluates the query.
 java.lang.Object evaluate(java.lang.String command, short commandLangType, DKNVPair[] params)
          evaluates the query.
 dkResultSetCursor execute(DKCQExpr cqe)
          executes a query expression and returns a result set cursor
 dkResultSetCursor execute(dkQuery query)
          executes the query.
 dkResultSetCursor execute(java.lang.String command, short commandLangType, DKNVPair[] params)
          executes the query.
 void executeWithCallback(DKCQExpr qe, dkCallback callbackObj)
          execute the query with callback function.
 void executeWithCallback(dkQuery query, dkCallback callbackObj)
          execute the query with callback function.
 void executeWithCallback(java.lang.String command, short commandLangType, DKNVPair[] params, dkCallback callbackObj)
          execute the query with callback function.
 int getCallbkCnt()
           
 dkExtension getExtension(java.lang.String extensionName)
          Gets the extension object from a given extenstion name.
 dkSchemaMapping getMapping(java.lang.String mappingName)
          Gets a mapping information from this datastore.
 java.lang.Object getOption(int option)
          Gets a datastore option.
 int getRSCCnt()
           
 DKHandle handle(java.lang.String type)
          Gets a datastore handle
 boolean isConnected()
          Checks to see if the datastore is connected.
 java.lang.String[] listDataSourceNames()
          List the available datastore source names that can be used to connect with.
 dkCollection listDataSources()
          List the available datastore sources that can be used to connect with.
 dkCollection listEntities()
          Gets a list of entities from persistent datastore
 java.lang.String[] listEntityAttrNames(java.lang.String entityName)
          Gets a list of attribute names for a given entity name.
 dkCollection listEntityAttrs(java.lang.String entityName)
          Gets a list of attributes for a given entity name.
 java.lang.String[] listEntityNames()
          Gets a list of entity names from persistent datastore
 java.lang.String[] listExtensionNames()
          Gets the list of extension objects' names
 java.lang.String[] listMappingNames()
          Gets the list of the registered mappings from this datastore.
 java.lang.Object listSchema()
          Deprecated. Replace by listEntities
 java.lang.Object listSchemaAttributes(java.lang.String schemaEntry)
          Deprecated. Replace by listEntityAttributes
 java.lang.Object listServers()
          Deprecated. Replace by listDataSources
 java.lang.String registerMapping(DKNVPair sourceMap)
          Registers a mapping definition to this datastore.
 void removeExtension(java.lang.String extensionName)
          Remove an existing extension object
 void retrieveObject(dkDataObject ddo)
          Retrieves the data-object from this datastore.
 void rollback()
          Rollback a datastore transaction
 void setOption(int option, java.lang.Object value)
          Sets a datastore option.
 void unRegisterMapping(java.lang.String mappingName)
          Unregisters mapping information from this datastore.
 void updateObject(dkDataObject ddo)
          Updates the data-object in this datastore.
 java.lang.String userName()
          Gets the user name for this datastore object
 
Methods inherited from class com.ibm.mm.sdk.server.dkAbstractDatastore
addObject, addObject, addObjects, addObjects, addObjects, changePassword, clearCache, clearCache, deleteObject, deleteObject, deleteObjects, deleteObjects, deleteObjects, evaluate, execute, executeWithCallback, listAvailableServices, listSearchableEntities, listSearchableEntityNames, listSearchTemplateNames, listSearchTemplates, retrieveObject, retrieveObject, retrieveObjects, retrieveObjects, retrieveObjects, serviceMgr, startTransaction, updateObject, updateObject, updateObjects, updateObjects, updateObjects
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.mm.sdk.common.dkDatastore
addObject, addObject, addObjects, addObjects, addObjects, changePassword, clearCache, clearCache, deleteObject, deleteObject, deleteObjects, deleteObjects, deleteObjects, evaluate, execute, executeWithCallback, listAvailableServices, listSearchableEntities, listSearchableEntityNames, listSearchTemplateNames, listSearchTemplates, retrieveObject, retrieveObject, retrieveObjects, retrieveObjects, retrieveObjects, serviceMgr, startTransaction, updateObject, updateObject, updateObjects, updateObjects, updateObjects
 

Constructor Detail

DKDatastoreDB2

public DKDatastoreDB2()
               throws DKException,
                      java.lang.Exception
Constructs the datastore and initializes the datastore.

DKDatastoreDB2

public DKDatastoreDB2(java.lang.String configuration)
               throws DKException,
                      java.lang.Exception
Constructs the datastore and initializes the datastore.
Method Detail

connect

public void connect(java.lang.String datastore_name,
                    java.lang.String user_name,
                    java.lang.String authentication,
                    java.lang.String connect_string)
             throws DKException,
                    java.lang.Exception
Connects to a datastore.
Specified by:
connect in interface dkDatastore
Overrides:
connect in class dkAbstractDatastore
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.

disconnect

public void disconnect()
                throws DKException,
                       java.lang.Exception
Disconnects from a datastore.
Specified by:
disconnect in interface dkDatastore
Overrides:
disconnect in class dkAbstractDatastore

getOption

public java.lang.Object getOption(int option)
                           throws DKException,
                                  java.lang.Exception
Gets a datastore option.
Specified by:
getOption in interface dkDatastore
Overrides:
getOption in class dkAbstractDatastore
Parameters:
option - the option identifier
Returns:
an option value

setOption

public void setOption(int option,
                      java.lang.Object value)
               throws DKException,
                      java.lang.Exception
Sets a datastore option.
Specified by:
setOption in interface dkDatastore
Overrides:
setOption in class dkAbstractDatastore
Parameters:
option - the option identifier
value - the option value

evaluate

public java.lang.Object evaluate(java.lang.String command,
                                 short commandLangType,
                                 DKNVPair[] params)
                          throws DKException,
                                 java.lang.Exception
evaluates the query.
Specified by:
evaluate in interface dkDatastore
Overrides:
evaluate in class dkAbstractDatastore
Parameters:
command - a query string
commandLang - a query type
params - additional query option in name/value pair
Returns:
a collection of the results

evaluate

public java.lang.Object evaluate(dkQuery query)
                          throws DKException,
                                 java.lang.Exception
evaluates the query.
Specified by:
evaluate in interface dkDatastore
Overrides:
evaluate in class dkAbstractDatastore
Parameters:
query - a query object
Returns:
a collection of the results

evaluate

public java.lang.Object evaluate(DKCQExpr qe)
                          throws DKException,
                                 java.lang.Exception
evaluates the query.
Specified by:
evaluate in interface dkDatastore
Overrides:
evaluate in class dkAbstractDatastore
Parameters:
qe - a common query expression object
Returns:
a collection of the results

execute

public dkResultSetCursor execute(java.lang.String command,
                                 short commandLangType,
                                 DKNVPair[] params)
                          throws DKException,
                                 java.lang.Exception
executes the query.
Specified by:
execute in interface dkDatastore
Overrides:
execute in class dkAbstractDatastore
Parameters:
command - a query string
commandLang - a query type
params - additional query option in name/value pair
Returns:
resultSetCursor which represents a datastore cursor.

execute

public dkResultSetCursor execute(dkQuery query)
                          throws DKException,
                                 java.lang.Exception
executes the query.
Specified by:
execute in interface dkDatastore
Overrides:
execute in class dkAbstractDatastore
Parameters:
query - a query object
Returns:
resultSetCursor which represents a datastore cursor.

execute

public dkResultSetCursor execute(DKCQExpr cqe)
                          throws DKException,
                                 java.lang.Exception
executes a query expression and returns a result set cursor
Specified by:
execute in interface dkDatastore
Overrides:
execute in class dkAbstractDatastore
Parameters:
cqe - a common query expression object
Returns:
resultSetCursor which represents a datastore cursor.

executeWithCallback

public void executeWithCallback(dkQuery query,
                                dkCallback callbackObj)
                         throws DKException,
                                java.lang.Exception
execute the query with callback function.
Specified by:
executeWithCallback in interface dkDatastore
Overrides:
executeWithCallback in class dkAbstractDatastore
Parameters:
query - a query object
callbackObj - a dkCallback object

executeWithCallback

public void executeWithCallback(java.lang.String command,
                                short commandLangType,
                                DKNVPair[] params,
                                dkCallback callbackObj)
                         throws DKException,
                                java.lang.Exception
execute the query with callback function.
Specified by:
executeWithCallback in interface dkDatastore
Overrides:
executeWithCallback in class dkAbstractDatastore
Parameters:
command - a query string
commandLang - a query type
params - additional query option in name/value pair
callbackObj - a dkCallback object

executeWithCallback

public void executeWithCallback(DKCQExpr qe,
                                dkCallback callbackObj)
                         throws DKException,
                                java.lang.Exception
execute the query with callback function.
Specified by:
executeWithCallback in interface dkDatastore
Overrides:
executeWithCallback in class dkAbstractDatastore
Parameters:
qe - a common query expression object
callbackObj - a dkCallback object

createQuery

public dkQuery createQuery(java.lang.String command,
                           short commandLangType,
                           DKNVPair[] params)
                    throws DKException,
                           java.lang.Exception
Creates a query object.
Specified by:
createQuery in interface dkDatastore
Overrides:
createQuery in class dkAbstractDatastore
Parameters:
command - a query string
commandLang - a query type
params - additional query option in name/value pair
Returns:
a query object

createQuery

public dkQuery createQuery(DKCQExpr qe)
                    throws DKException,
                           java.lang.Exception
Creates a query object.
Specified by:
createQuery in interface dkDatastore
Overrides:
createQuery in class dkAbstractDatastore
Parameters:
qe - a common query expression object

addObject

public void addObject(dkDataObject ddo)
               throws DKException,
                      java.lang.Exception
Adds this data-object to the DL datastore.
Specified by:
addObject in interface dkDatastore
Overrides:
addObject in class dkAbstractDatastore
Parameters:
ddo - the data-object to be added to this datastore
See Also:
DKDDO.add()

retrieveObject

public void retrieveObject(dkDataObject ddo)
                    throws DKException,
                           java.lang.Exception
Retrieves the data-object from this datastore.
Specified by:
retrieveObject in interface dkDatastore
Overrides:
retrieveObject in class dkAbstractDatastore
Parameters:
ddo - the data-object to be retrieved from this datastore
See Also:
DKDDO.retrieve()

updateObject

public void updateObject(dkDataObject ddo)
                  throws DKException,
                         java.lang.Exception
Updates the data-object in this datastore.
Specified by:
updateObject in interface dkDatastore
Overrides:
updateObject in class dkAbstractDatastore
Parameters:
ddo - the data-object to be updated in this datastore
See Also:
DKDDO.update()

deleteObject

public void deleteObject(dkDataObject ddo)
                  throws DKException,
                         java.lang.Exception
Deletes this data-object from this datastore.
Specified by:
deleteObject in interface dkDatastore
Overrides:
deleteObject in class dkAbstractDatastore
Parameters:
ddo - the data-object to be deleted from this datastore
See Also:
DKDDO.del()

commit

public void commit()
            throws DKException,
                   java.lang.Exception
Commits a datastore transaction
Specified by:
commit in interface dkDatastore
Overrides:
commit in class dkAbstractDatastore

rollback

public void rollback()
              throws DKException,
                     java.lang.Exception
Rollback a datastore transaction
Specified by:
rollback in interface dkDatastore
Overrides:
rollback in class dkAbstractDatastore

isConnected

public boolean isConnected()
                    throws java.lang.Exception
Checks to see if the datastore is connected.
Specified by:
isConnected in interface dkDatastore
Overrides:
isConnected in class dkAbstractDatastore
Returns:
true if connected

datastoreName

public java.lang.String datastoreName()
                               throws java.lang.Exception
Gets the name of this datastore object. Usually it represents a datastore source's server name.
Specified by:
datastoreName in interface dkDatastore
Overrides:
datastoreName in class dkAbstractDatastore
Returns:
datastore name

datastoreType

public java.lang.String datastoreType()
                               throws java.lang.Exception
Gets the datastore type for this datastore object
Specified by:
datastoreType in interface dkDatastore
Overrides:
datastoreType in class dkAbstractDatastore
Returns:
datastore type

connection

public DKHandle connection()
                    throws java.lang.Exception
Gets the connection handle for a datastore
Specified by:
connection in interface dkDatastore
Overrides:
connection in class dkAbstractDatastore
Returns:
connection handle

environment

public DKHandle environment()
                     throws java.lang.Exception
Gets the environment handle for a datastore
Specified by:
environment in interface dkDatastoreIntDB2
Returns:
environment handle

handle

public DKHandle handle(java.lang.String type)
                throws java.lang.Exception
Gets a datastore handle
Specified by:
handle in interface dkDatastore
Overrides:
handle in class dkAbstractDatastore
Parameters:
type - type of datastore handle wanted
Returns:
a datastore handle

userName

public java.lang.String userName()
                          throws java.lang.Exception
Gets the user name for this datastore object
Specified by:
userName in interface dkDatastore
Overrides:
userName in class dkAbstractDatastore
Returns:
user name

listDataSources

public dkCollection listDataSources()
                             throws DKException,
                                    java.lang.Exception
List the available datastore sources that can be used to connect with.
Specified by:
listDataSources in interface dkDatastore
Overrides:
listDataSources in class dkAbstractDatastore
Returns:
a collection of server definitions

listDataSourceNames

public java.lang.String[] listDataSourceNames()
                                       throws DKException,
                                              java.lang.Exception
List the available datastore source names that can be used to connect with.
Specified by:
listDataSourceNames in interface dkDatastore
Overrides:
listDataSourceNames in class dkAbstractDatastore
Returns:
an array of server names

listServers

public java.lang.Object listServers()
                             throws DKException,
                                    java.lang.Exception
Deprecated. Replace by listDataSources

List the available datastore sources that can be used to connect with.
Specified by:
listServers in interface dkDatastore
Overrides:
listServers in class dkAbstractDatastore
Returns:
a collection of server definitions
See Also:
listDataSources()

listSchema

public java.lang.Object listSchema()
                            throws DKUsageError
Deprecated. Replace by listEntities

List the entities that belong to this datastore
Specified by:
listSchema in interface dkDatastore
Overrides:
listSchema in class dkAbstractDatastore
Returns:
an object that contains the schema
See Also:
listEntities()

listSchemaAttributes

public java.lang.Object listSchemaAttributes(java.lang.String schemaEntry)
                                      throws DKUsageError,
                                             DKDatastoreAccessError
Deprecated. Replace by listEntityAttributes

List the attributes that belong to a schema.
Specified by:
listSchemaAttributes in interface dkDatastore
Overrides:
listSchemaAttributes in class dkAbstractDatastore
Parameters:
schemaEntry - the name of the schema.
Returns:
an object that contains the attributes that belong to this schema
See Also:
listEntityAttrs(java.lang.String)

listEntities

public dkCollection listEntities()
                          throws DKException,
                                 java.lang.Exception
Gets a list of entities from persistent datastore
Specified by:
listEntities in interface dkDatastore
Overrides:
listEntities in class dkAbstractDatastore
Returns:
a collection of entity defs
Throws:
DKException - if error occurs

listEntityNames

public java.lang.String[] listEntityNames()
                                   throws DKException,
                                          java.lang.Exception
Gets a list of entity names from persistent datastore
Specified by:
listEntityNames in interface dkDatastore
Overrides:
listEntityNames in class dkAbstractDatastore
Returns:
an array of entity names
Throws:
DKException - if error occurs

listEntityAttrs

public dkCollection listEntityAttrs(java.lang.String entityName)
                             throws DKException,
                                    java.lang.Exception
Gets a list of attributes for a given entity name.
Specified by:
listEntityAttrs in interface dkDatastore
Overrides:
listEntityAttrs in class dkAbstractDatastore
Parameters:
entityName - name of entity to retrieve attributes for
Returns:
a dkCollection of dkAttrDef objects
Throws:
DKException - if the entity name does not exist

listEntityAttrNames

public java.lang.String[] listEntityAttrNames(java.lang.String entityName)
                                       throws DKException,
                                              java.lang.Exception
Gets a list of attribute names for a given entity name.
Specified by:
listEntityAttrNames in interface dkDatastore
Overrides:
listEntityAttrNames in class dkAbstractDatastore
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

datastoreDef

public dkDatastoreDef datastoreDef()
Get datastore definition
Specified by:
datastoreDef in interface dkDatastore
Overrides:
datastoreDef in class dkAbstractDatastore
Returns:
the meta-data (dkDatastoreDef) of this datastore

registerMapping

public java.lang.String registerMapping(DKNVPair sourceMap)
                                 throws DKException,
                                        java.lang.Exception
Registers a mapping definition to this datastore. Mapping is done by entities.
Specified by:
registerMapping in interface dkDatastore
Overrides:
registerMapping in class dkAbstractDatastore
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.
    See Also:
    unRegisterMapping(java.lang.String)

unRegisterMapping

public void unRegisterMapping(java.lang.String mappingName)
                       throws DKException,
                              java.lang.Exception
Unregisters mapping information from this datastore.
Specified by:
unRegisterMapping in interface dkDatastore
Overrides:
unRegisterMapping in class dkAbstractDatastore
Parameters:
mappingName - name of the mapping information
See Also:
registerMapping(com.ibm.mm.sdk.common.DKNVPair)

listMappingNames

public java.lang.String[] listMappingNames()
                                    throws DKException,
                                           java.lang.Exception
Gets the list of the registered mappings from this datastore.
Specified by:
listMappingNames in interface dkDatastore
Overrides:
listMappingNames in class dkAbstractDatastore
Returns:
an array of registered mapping objects' names
See Also:
registerMapping(com.ibm.mm.sdk.common.DKNVPair)

getMapping

public dkSchemaMapping getMapping(java.lang.String mappingName)
                           throws DKException,
                                  java.lang.Exception
Gets a mapping information from this datastore.
Specified by:
getMapping in interface dkDatastore
Overrides:
getMapping in class dkAbstractDatastore
Parameters:
mappingName - name of the mapping information
Returns:
the schema mapping object
See Also:
registerMapping(com.ibm.mm.sdk.common.DKNVPair)

getExtension

public dkExtension getExtension(java.lang.String extensionName)
                         throws DKException,
                                java.lang.Exception
Gets the extension object from a given extenstion name.
Specified by:
getExtension in interface dkDatastore
Overrides:
getExtension in class dkAbstractDatastore
Parameters:
extensionName - name of the extension object.
Returns:
extension object.

addExtension

public void addExtension(java.lang.String extensionName,
                         dkExtension extensionObj)
                  throws DKException,
                         java.lang.Exception
Adds a new extension object.
Specified by:
addExtension in interface dkDatastore
Overrides:
addExtension in class dkAbstractDatastore
Parameters:
extensionName - name of new extension object
extensionObj - the extension object to be set

removeExtension

public void removeExtension(java.lang.String extensionName)
                     throws DKException,
                            java.lang.Exception
Remove an existing extension object
Specified by:
removeExtension in interface dkDatastore
Overrides:
removeExtension in class dkAbstractDatastore
Parameters:
extensionName - name of extension object to be removed

listExtensionNames

public java.lang.String[] listExtensionNames()
                                      throws DKException,
                                             java.lang.Exception
Gets the list of extension objects' names
Specified by:
listExtensionNames in interface dkDatastore
Overrides:
listExtensionNames in class dkAbstractDatastore
Returns:
an array of extension objects' names

createDDO

public DKDDO createDDO(java.lang.String objectType,
                       int Flags)
                throws DKException,
                       java.lang.Exception
Creates a new DDO with object type, properties and attributes set for a given backend server.
Specified by:
createDDO in interface dkDatastore
Overrides:
createDDO in class dkAbstractDatastore
Parameters:
objectType - the object type you want to create
Flags - to indicate various options to specify more detailed characteristics of the DDO to create. Valid values are: DK_CM_ITEM - to create an item DDO. If no flag is supplied (Flags equals zero) the default will be DK_CM_ITEM.
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

destroy

public void destroy()
             throws DKException,
                    java.lang.Exception
datastore destroy - datastore cleanup if needed
Specified by:
destroy in interface dkDatastore
Overrides:
destroy in class dkAbstractDatastore

getRSCCnt

public int getRSCCnt()

getCallbkCnt

public int getCallbkCnt()

EIP Java APIs

(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.