com.ibm.mm.sdk.server

Class DKDatastoreICM

  • java.lang.Object
    • com.ibm.mm.sdk.server.DKDatastoreICM
    • Constructor Detail

      • DKDatastoreICM

        public DKDatastoreICM()
                       throws DKException,
                              java.lang.Exception
        Throws:
        DKException
        java.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.Exception
        Description copied from interface: dkDatastore
        Establishes 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:
        connect in interface dkDatastore
        Parameters:
        serverName - the name of the datastore to connect to
        userName - the username for authentication
        password - the password or authentication credentials
        objectStoreName - additional connection parameters (implementation-specific)
        Throws:
        DKException - if the connection fails due to invalid credentials or datastore errors
        java.lang.Exception - if an unexpected error occurs during connection
      • connect

        public void connect()
                     throws DKException,
                            java.lang.Exception
        Connects to the datastore using the configuration already provided to the underlying CM8DocumentService (e.g. loaded from a properties file). Use this overload when the connection details are pre-configured.
        Throws:
        DKException
        java.lang.Exception
      • isConnected

        public boolean isConnected()
      • datastoreName

        public java.lang.String datastoreName()
                                       throws java.lang.Exception
        Description copied from interface: dkDatastore
        Returns the name of the currently connected datastore.
        Specified by:
        datastoreName in interface dkDatastore
        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:
        DKException
        java.lang.Exception
      • deleteObject

        public void deleteObject(dkDataObject ddo)
                          throws DKException,
                                 java.lang.Exception
        Description copied from interface: dkDatastore
        Deletes a data object from the datastore.

        This method permanently removes the specified object from the datastore. The operation cannot be undone.

        Specified by:
        deleteObject in interface dkDatastore
        Parameters:
        ddo - the data object to delete
        Throws:
        DKException - if the delete operation fails
        java.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: dkDatastore
        Deletes 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:
        deleteObject in interface dkDatastore
        Parameters:
        ddo - the data object to delete
        option - deletion options (implementation-specific)
        Throws:
        DKException - if the delete operation fails
        java.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.Exception
        Description copied from interface: dkDatastore
        Destroys 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:
        destroy in interface dkDatastore
        Throws:
        DKException - if the destroy operation fails
        java.lang.Exception - if an unexpected error occurs during destruction
      • createDDO

        public DKDDO createDDO(java.lang.String className,
                               int semanticType)
                        throws DKException,
                               java.lang.Exception
        Throws:
        DKException
        java.lang.Exception
      • createQuery

        public dkQuery createQuery(java.lang.String command,
                                   short commandLangType,
                                   DKNVPair[] params)
                            throws DKException,
                                   java.lang.Exception
        Description copied from interface: dkQueryManager
        Creates 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:
        createQuery in interface dkQueryManager
        Parameters:
        command - the query command string
        commandLangType - 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 fails
        java.lang.Exception - if an unexpected error occurs during query creation
      • evaluate

        public java.lang.Object evaluate(java.lang.String query,
                                         short queryLanguageID,
                                         DKNVPair[] params)
                                  throws DKUsageError,
                                         DKException,
                                         java.lang.Exception
        Description copied from interface: dkQueryEvaluator
        Evaluates 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:
        evaluate in interface dkQueryEvaluator
        Parameters:
        query - the query string to evaluate
        queryLanguageID - 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 fails
        java.lang.Exception - if an unexpected error occurs during evaluation
        DKUsageError
      • executeCount

        public long executeCount(java.lang.String query,
                                 short queryLanguageID,
                                 DKNVPair[] queryOptions)
                          throws DKException,
                                 java.lang.Exception
        Executes 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 fails
        java.lang.Exception - if an unexpected error occurs
      • 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 fails
        java.lang.Exception - for other errors
      • listEntities

        public dkCollection listEntities()
                                  throws DKException,
                                         java.lang.Exception
        Description copied from interface: dkDatastore
        Lists 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:
        listEntities in interface dkDatastore
        Returns:
        a collection of entity definitions
        Throws:
        DKException - if the list operation fails
        java.lang.Exception - if an unexpected error occurs
      • listEntityAttrNames

        public java.lang.String[] listEntityAttrNames(java.lang.String entityName)
                                               throws DKException,
                                                      java.lang.Exception
        Throws:
        DKException
        java.lang.Exception
Copyright © 2024 IBM Corporation

Copyright © 2024 IBM Corporation. All rights reserved.