Index

dkDatastoreDef

Purpose:

A dkDatastoreDef provides a generic interface to access and manipulate datastore metadata, such as the creation and deletion of tables or index-classes, columns or attributes, listing them, and so forth. This class contains dkDatastoreAdmin class which implements datastore administrative functions, for example, managing user ID, access control, and other non-metadata related functions.

dkDatastoreDef should be subclassed to provide a specific implementation for the target datastore. For example:

Class summary:

class dkDatastoreDef
 {
   public:
      virtual ~dkDatastoreDef();
      dkDatastore* getDatastore();
      void setDatastore(dkDatastore* ds);
      DKString  datastoreName() const;
      DKString  datastoreType() const;
      virtual dkEntityDef* createEntity();
      virtual dkEntityDef* getEntity(const char* entityName);
      virtual dkEntityDef* retrieveEntity(const char* entityName);
      virtual dkCollection* listEntities();
      virtual dkCollection* listEntities(long options);
      virtual dkCollection* listEntities(const DKNVPair* options, long arraySize);
      virtual DKString* listEntityNames(long& arraySize);
      virtual DKString* listEntityNames(long options, long& arraySize);
      virtual DKString* listEntityNames(const DKNVPair* options, long optionArraySize, long& arraySize);
      virtual dkCollection* listSearchableEntities();
      virtual dkCollection* listSearchableEntities(long option);
      virtual dkCollection* listSearchableEntities(const DKNVPair* options, long arraySize);
      virtual DKString* listSearchableEntityNames(long& arraySize);
      virtual DKString* listSearchableEntityNames(long options, long& arraySize);
      virtual DKString* listSearchableEntityNames(const DKNVPair* options, long optionArraySize, long& arraySize);
      virtual dkCollection* listEntityAttrs(const char* entityName);
      virtual DKString* listEntityAttrNames(const char* entityName,
                                            long& arraySize);
      virtual dkCollection* listSearchTemplates();
      virtual DKString* listSearchTemplateNames(long& arraySize);
      virtual void add(dkEntityDef* entityDef);
      virtual void del(dkEntityDef* entityDef);
      virtual void deleteEntity(const char* entityName);
      virtual dkDatastoreAdmin* datastoreAdmin();
      virtual void clearCache();
 };

Members:

Member functions

setDatastore
Sets the reference to the owner datastore object.
void setDatastore(dkDatastore* ds);

getDatastore
Gets the reference to the owner datastore object.
dkDatastore* getDatastore();

datastoreName
 DKString  datastoreName() const;

Gets the name of the owner datastore object.

datastoreType
Gets the type of the owner datastore object.
DKString  datastoreType() const;

createEntity
Creates a proper new entity for this datastore. Returns a dkEntityDef object.
virtual dkEntityDef* createEntity();

getEntity
Gets the dkEntityDef object for the given entity name from the datastore definition.
Note:
DKUsageError exception thrown if method is not implemented.

Exceptions
DKException -- An error occurs in the datastore.

virtual dkEntityDef* getEntity(const char* entityName);

Note:
DKUsageError exception thrown if method is not implemented.

retrieveEntity
Retrieves the dkEntityDef object for the given entity name from the datastore definition.

Exceptions
DKException -- An error occurs in the datastore.

virtual dkEntityDef* retrieveEntity(const char* entityName);

Note:
DKUsageError exception thrown if method is not implemented.

listEntities
Gets the list of entities defined in this datastore. Returns a collection of dkEntityDef objects.

Exceptions
DKException -- An error occurs in the datastore.

 virtual dkCollection* listEntities();

listEntities
Gets the list of entities defined in this datastore. Returns a collection of dkEntityDef objects.

Exceptions
DKException -- An error occurs in the datastore.

virtual dkCollection* listEntities(long options);
virtual dkCollection* listEntities(const DKNVPair* options,	 long arraySize);

Note:
DKUsageError exception thrown if method is not implemented.

listEntityNames
Gets the list of entity names defined in this datastore. Returns an array of entity names which dimension equals to arraySize.

Exceptions
DKException -- An error occurs in the datastore.

 virtual DKString* listEntityNames(long& arraySize);

listEntityNames
Gets the list of entity names defined in this datastore. Returns an array of entity names which dimension equals to arraySize.

Exceptions
DKException -- An error occurs in the datastore.

virtual DKString* listEntityNames(long options, long& arraySize);
virtual DKString* listEntityNames(const DKNVPair* options, long optionArraySize, long& arraySize);

Note:
DKUsageError exception thrown if method is not implemented.

listEntityAttrs
Gets the list of attributes for a given entity name. Returns a dkCollection of dkAttrDef objects.

Exceptions
DKException -- An error occurs in the datastore.

 virtual dkCollection* listEntityAttrs(const char* entityName);

listEntityAttrNames
Gets the list of attribute names for a given item type name.

Exceptions
DKException -- An error occurs in the datastore.

virtual DKString* listEntityAttrNames(const char* entityName, long& arraySize);

listSearchTemplates
Gets a list of search templates from persistent datastore .

Exceptions
DKException -- An error occurs in the datastore.

virtual dkCollection* listSearchTemplates();

Note:
DKUsageError exception thrown if method is not implemented.

listSearchTemplateNames
Gets a list of search template names from persistent datastore .

Exceptions
DKException -- An error occurs in the datastore.

virtual DKString* listSearchTemplateNames(long& arraySize);

Note:
DKUsageError exception thrown if method is not implemented.

add
Adds the definition of the given item type to the persistent datastore.

Exceptions

DKException
If the item type object is invalid or an error occurs in the server.
virtual void add(dkEntityDef* entityDef);

Note:
DKUsageError exception thrown if method is not implemented.

del
Deletes the definition of the given item type from the persistent datastore.

Exceptions

DKException
If the item type object is invalid or does not exist in the server.
virtual void del(dkEntityDef* entityDef);

Note:
DKUsageError exception thrown if method is not implemented.

deleteEntity
Deletes the definition of the given item type from the persistent datastore.

Exceptions

DKException
If the item type object is invalid or does not exist in the server.
virtual void deleteEntity(const char* entityName);

Note:
DKUsageError exception thrown if method is not implemented.

datastoreAdmin
Gets a datastore administration object from the Content Manager datastore. This object implements administration functions, for example, creating or deleting users, and so forth.

Exceptions
DKException -- An error occurs in the datastore.

virtual dkDatastoreAdmin* datastoreAdmin();

Note:
DKUsageError exception thrown if method is not implemented.

listSearchableEntities
Gets a list of searchable entities from the persistent datastore. Usually all entities are searchable, except entities from certain datastore types.
virtual dkCollection* listSearchableEntities(long option);
virtual dkCollection* listSearchableEntities(const DKNVPair* options, long arraySize);

Note:
Default behavior will call dkDatastoreDef.listEntities.

listSearchableEntityNames
Gets a list of searchable entity names from the persistent datastore, and returns the list as an array of entity names.
virtual DKString* listSearchableEntityNames(long options, long& arraySize);
virtual DKString* listSearchableEntityNames(const DKNVPair* options, long optionArraySize, long& arraySize);

Note:
Default behavior will call dkDatastoreDef.listEntityNames.

clearCache
Clears the cache.
virtual void clearCache();

Note:
DKUsageError exception thrown if method is not implemented.

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