Class DKDatastoreICM
- java.lang.Object
-
- com.ibm.mm.sdk.server.DKDatastoreICM
-
- All Implemented Interfaces:
- dkDatastore, dkDatastoreIntICM, dkQueryEvaluator, dkQueryManager
public class DKDatastoreICM extends java.lang.Object implements dkDatastore, dkDatastoreIntICM
CM8 Datastore - Mimics IBM CM8 datastore connection API, internally connects to FileNet P8.
-
-
Constructor Summary
Constructors Constructor and Description DKDatastoreICM()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcheckIn(dkDataObject item)voidcheckOut(dkDataObject item)voidconnect()Connects to the datastore using the configuration already provided to the underlyingCM8DocumentService(e.g.voidconnect(java.lang.String serverName, java.lang.String userName, java.lang.String password, java.lang.String objectStoreName)Establishes a connection to the datastore.DKDDOcreateDDO(java.lang.String className, int semanticType)DKDDOcreateDDO(java.lang.String className, java.lang.String semanticType)DKDDOcreateDDOFromPID(DKPidICM pid)DKDDOcreateDDOFromPID(java.lang.String pidString)dkQuerycreateQuery(java.lang.String command, short commandLangType, DKNVPair[] params)Creates a query object from a command string.java.lang.StringdatastoreName()Returns the name of the currently connected datastore.voiddeleteObject(dkDataObject ddo)Deletes a data object from the datastore.voiddeleteObject(dkDataObject ddo, int option)Deletes a data object from the datastore with the specified options.voiddestroy()Destroys the datastore connection and releases all resources.voiddisconnect()Disconnects from the datastore and releases all associated resources.java.lang.Objectevaluate(java.lang.String query, short queryLanguageID, DKNVPair[] params)Evaluates a query and returns the results.dkResultSetCursorexecute(java.lang.String query, short queryLanguageID, DKNVPair[] queryOptions)longexecuteCount(java.lang.String query, short queryLanguageID, DKNVPair[] queryOptions)Executes a count query and returns the number of results.CM8DocumentServicegetDocumentService()com.filenet.api.core.ObjectStoregetObjectStore()DKDDOgetRootFolder()java.lang.StringgetUserName()booleanisConnected()dkCollectionlistDataSources()Lists available data sources (ObjectStores) from the FileNet P8 domain.dkCollectionlistEntities()Lists all entity types (class definitions) available in the datastore.java.lang.String[]listEntityAttrNames(java.lang.String entityName)dkCollectionlistEntityAttrs(java.lang.String entityName)java.lang.StringuserName()
-
-
-
Constructor Detail
-
DKDatastoreICM
public DKDatastoreICM() throws DKException, java.lang.Exception- Throws:
DKExceptionjava.lang.Exception
-
-
Method Detail
-
connect
public void connect(java.lang.String serverName, java.lang.String userName, java.lang.String password, java.lang.String objectStoreName) throws DKException, java.lang.ExceptionDescription copied from interface:dkDatastoreEstablishes a connection to the datastore.This method authenticates the user and establishes a session with the specified datastore. The connection must be established before any other datastore operations can be performed.
- Specified by:
connectin interfacedkDatastore- Parameters:
serverName- the name of the datastore to connect touserName- the username for authenticationpassword- the password or authentication credentialsobjectStoreName- additional connection parameters (implementation-specific)- Throws:
DKException- if the connection fails due to invalid credentials or datastore errorsjava.lang.Exception- if an unexpected error occurs during connection
-
connect
public void connect() throws DKException, java.lang.ExceptionConnects to the datastore using the configuration already provided to the underlyingCM8DocumentService(e.g. loaded from a properties file). Use this overload when the connection details are pre-configured.- Throws:
DKExceptionjava.lang.Exception
-
isConnected
public boolean isConnected()
-
getDocumentService
public CM8DocumentService getDocumentService()
-
datastoreName
public java.lang.String datastoreName() throws java.lang.ExceptionDescription copied from interface:dkDatastoreReturns the name of the currently connected datastore.- Specified by:
datastoreNamein interfacedkDatastore- Returns:
- the datastore name, or null if not connected
- Throws:
java.lang.Exception- if an error occurs retrieving the datastore name
-
getUserName
public java.lang.String getUserName() throws java.lang.Exception- Throws:
java.lang.Exception
-
userName
public java.lang.String userName() throws java.lang.Exception- Throws:
java.lang.Exception
-
createDDO
public DKDDO createDDO(java.lang.String className, java.lang.String semanticType) throws DKException, java.lang.Exception
- Throws:
DKExceptionjava.lang.Exception
-
createDDOFromPID
public DKDDO createDDOFromPID(DKPidICM pid) throws DKException, DKUsageError, java.lang.Exception
- Throws:
DKExceptionDKUsageErrorjava.lang.Exception
-
createDDOFromPID
public DKDDO createDDOFromPID(java.lang.String pidString) throws DKException, DKUsageError, java.lang.Exception
- Throws:
DKExceptionDKUsageErrorjava.lang.Exception
-
disconnect
public void disconnect() throws DKException, java.lang.ExceptionDescription copied from interface:dkDatastoreDisconnects from the datastore and releases all associated resources.After calling this method, the datastore connection is closed and no further operations can be performed until
dkDatastore.connect(java.lang.String, java.lang.String, java.lang.String, java.lang.String)is called again.- Specified by:
disconnectin interfacedkDatastore- Throws:
DKException- if the disconnection failsjava.lang.Exception- if an unexpected error occurs during disconnection
-
deleteObject
public void deleteObject(dkDataObject ddo) throws DKException, java.lang.Exception
Description copied from interface:dkDatastoreDeletes a data object from the datastore.This method permanently removes the specified object from the datastore. The operation cannot be undone.
- Specified by:
deleteObjectin interfacedkDatastore- Parameters:
ddo- the data object to delete- Throws:
DKException- if the delete operation failsjava.lang.Exception- if an unexpected error occurs during deletion
-
deleteObject
public void deleteObject(dkDataObject ddo, int option) throws DKException, java.lang.Exception
Description copied from interface:dkDatastoreDeletes a data object from the datastore with the specified options.This method permanently removes the specified object from the datastore using the provided deletion options.
- Specified by:
deleteObjectin interfacedkDatastore- Parameters:
ddo- the data object to deleteoption- deletion options (implementation-specific)- Throws:
DKException- if the delete operation failsjava.lang.Exception- if an unexpected error occurs during deletion
-
getObjectStore
public com.filenet.api.core.ObjectStore getObjectStore()
-
destroy
public void destroy() throws DKException, java.lang.ExceptionDescription copied from interface:dkDatastoreDestroys the datastore connection and releases all resources.This method performs cleanup operations and should be called when the datastore is no longer needed. After calling this method, the datastore instance should not be used.
- Specified by:
destroyin interfacedkDatastore- Throws:
DKException- if the destroy operation failsjava.lang.Exception- if an unexpected error occurs during destruction
-
checkIn
public void checkIn(dkDataObject item) throws DKException, java.lang.Exception
- Throws:
DKExceptionjava.lang.Exception
-
checkOut
public void checkOut(dkDataObject item) throws DKException, java.lang.Exception
- Throws:
DKExceptionjava.lang.Exception
-
createDDO
public DKDDO createDDO(java.lang.String className, int semanticType) throws DKException, java.lang.Exception
- Throws:
DKExceptionjava.lang.Exception
-
createQuery
public dkQuery createQuery(java.lang.String command, short commandLangType, DKNVPair[] params) throws DKException, java.lang.Exception
Description copied from interface:dkQueryManagerCreates a query object from a command string.This method constructs a query object that can be executed against the datastore. The query is specified using a command string in the given query language, with optional parameters for customization.
- Specified by:
createQueryin interfacedkQueryManager- Parameters:
command- the query command stringcommandLangType- the query language type (e.g., DK_CM_XQPE_QL_TYPE for XQPE, DK_CM_SQL for SQL)params- optional array of name-value pairs for query parameters- Returns:
- a query object that can be executed
- Throws:
DKException- if query creation failsjava.lang.Exception- if an unexpected error occurs during query creation
-
execute
public dkResultSetCursor execute(java.lang.String query, short queryLanguageID, DKNVPair[] queryOptions) throws DKException, java.lang.Exception
- Throws:
DKExceptionjava.lang.Exception
-
evaluate
public java.lang.Object evaluate(java.lang.String query, short queryLanguageID, DKNVPair[] params) throws DKUsageError, DKException, java.lang.ExceptionDescription copied from interface:dkQueryEvaluatorEvaluates a query and returns the results.This method executes the specified query string using the given query language and optional parameters. The results are returned as a collection of data objects that match the query criteria.
- Specified by:
evaluatein interfacedkQueryEvaluator- Parameters:
query- the query string to evaluatequeryLanguageID- the query language type (e.g., DK_CM_XQPE_QL_TYPE for XQPE, DK_CM_SQL for SQL)params- optional array of name-value pairs for query parameters and options- Returns:
- the query results, typically as a DKResults collection or similar object
- Throws:
DKException- if the query evaluation failsjava.lang.Exception- if an unexpected error occurs during evaluationDKUsageError
-
executeCount
public long executeCount(java.lang.String query, short queryLanguageID, DKNVPair[] queryOptions) throws DKException, java.lang.ExceptionExecutes a count query and returns the number of results. This method mimics IBM Content Manager's DKDatastoreICM.executeCount() method.- Parameters:
query- The SQL query string to execute (typically a SELECT COUNT(*) query)queryLanguageID- The query language identifier (e.g., DK_CM_SQL = 3)queryOptions- Array of name-value pairs for query options (can be null)- Returns:
- The count of results as a long value
- Throws:
DKException- if query execution failsjava.lang.Exception- if an unexpected error occurs
-
getRootFolder
public DKDDO getRootFolder() throws DKException, java.lang.Exception
- Throws:
DKExceptionjava.lang.Exception
-
listDataSources
public dkCollection listDataSources() throws DKException, java.lang.Exception
Lists available data sources (ObjectStores) from the FileNet P8 domain. Returns a collection of DKServerDefICM objects, each containing a separate DKDatastoreICM instance for the corresponding ObjectStore.- Returns:
- dkCollection containing DKServerDefICM objects for each ObjectStore
- Throws:
DKException- if not connected or operation failsjava.lang.Exception- for other errors
-
listEntities
public dkCollection listEntities() throws DKException, java.lang.Exception
Description copied from interface:dkDatastoreLists all entity types (class definitions) available in the datastore.This method returns a collection of entity definitions that describe the available document and folder types in the datastore. Each entity definition includes metadata such as the entity name, type, and attributes.
- Specified by:
listEntitiesin interfacedkDatastore- Returns:
- a collection of entity definitions
- Throws:
DKException- if the list operation failsjava.lang.Exception- if an unexpected error occurs
-
listEntityAttrNames
public java.lang.String[] listEntityAttrNames(java.lang.String entityName) throws DKException, java.lang.Exception- Throws:
DKExceptionjava.lang.Exception
-
listEntityAttrs
public dkCollection listEntityAttrs(java.lang.String entityName) throws DKException, java.lang.Exception
- Throws:
DKExceptionjava.lang.Exception
-
-