Index

DKPid

Purpose:

Persistent identifier (PID) provides a unique identifier to locate the persistent data of data objects in a set of known datastores. A dkDataObject needs to have a PID in order to store its data persistently.

Class summary:

class DKPid
{
  public:
    DKPid();
    DKPid(long idStringCount);
    DKPid(const char* fromPidString);
    DKPid(const DKPid& fromPid);
    virtual ~DKPid();
 
    DKPid& operator= (const DKPid& fromPid);
 
    virtual DKString getDatastoreType() const;
    virtual void    setDatastoreType(const char * fromDatastoreType);
    virtual DKString getDatastoreName() const;
    virtual void    setDatastoreName(const char * fromDatastoreName);
 
    virtual DKString getId() const;
    virtual void    setId(const char* fromId);
 
    virtual DKString getIdString();
    virtual void    setIdString(const char* idStr);
 
    virtual DKString getPrimaryId();
    virtual void    setPrimaryId(const char* primaryId);
 
    virtual DKString pidString();
 
    virtual DKString getObjectType() const;
    virtual void    setObjectType(const char * fromObjectType);
 
    virtual DKBoolean isSet() const;
 
    virtual long getIdStringCount();
    virtual void setIdStringCount(long idStringCount);
 
    virtual DKString getIdString(long index);
    virtual void setIdString(long index, const char* idStringItem);
    virtual DKPid*  clone();
    virtual DKString  pidType() const;
};

Members:

Constructors and destructor
    DKPid();
    DKPid(long idStringCount);
    DKPid(const char* fromPidString);
    DKPid(const DKPid& fromPid);
    virtual ~DKPid();
 

The first two constructors construct a persistent identifier (PID) object. The third constructor constructs a PID from a PID string representation. The fourth constructor constructs a PID from another PID.

Parameters

idStringCount
The string ID count.

fromPidString
The PID string, a string obtained by calling the pidString method in PID.

fromPid
The other PID.

Member functions

operator=
Assignment operator.
DKPid& operator= (const DKPid& fromPid);

getDatastoreType
Gets the datastore type from this persistent identifier (PID).
virtual DKString getDatastoreType() const;

setDatastoreType
Sets the datastore type from this persistent identifier (PID).
virtual void setDatastoreType(const char * fromDatastoreType);

getDatastoreName
Gets datastore name from this persistent identifier (PID).
virtual DKString getDatastoreName() const;

setDatastoreName
Sets datastore name of this persistent identifier (PID).
virtual void setDatastoreName(const char * fromDatastoreName);

getId
getId has been deprecated and replaced by getPrimaryId.
virtual DKString getId() const;

setId
setId has been deprecated and replaced by setPrimaryId.
virtual void setId(const char* fromId);

getIdString
Gets the datastore-specific persistent ID of the owner data-object. This ID contains information to locate the persistent data (of the owner data object) in the datastore.
virtual DKString getIdString();

setIdString
Gets the datastore-specific persistent ID of the owner data-object. The user should also set the item ID whenever the ID string is set.

Parameters
idStr -- The datastore persistent ID.

virtual void setIdString(const char* idStr);

getPrimaryId
Gets the datastore specific primary persistent ID.
virtual DKString getPrimaryId();

setPrimaryId
Sets the datastore specific primary persistent ID.
virtual void setPrimaryId(const char* primaryId);

pidString
Returns a string representation of this PID. This string is of internal format and not to be parsed by users. This string can be used as an input parameter to reconstruct the PID (using the proper constructor).
virtual DKString pidString();

getObjectType
Gets the type of the data-object owning this PID.
virtual DKString getObjectType() const;

setObjectType
Sets the type of the data-object owning this PID.

Parameters
fromObjectType -- The object type.

virtual void setObjectType(const char * fromObjectType);

isSet
Returns TRUE if all components of this PID are set to their intended values.
virtual DKBoolean isSet() const;

getIdStringCount
Gets the ID string count.
virtual long getIdStringCount();

setIdStringCount
Sets the ID string count.
virtual void setIdStringCount(long idStringCount);

getIdString
Gets the ID string by index (0 to n-1).

Parameters
index -- The index of a part of the ID string.

virtual DKString getIdString(long index);

setIdString
Sets the ID string by index (0 to n-1).

Parameters
index -- The index of a part of the ID string.
idStringItem -- A part of the ID string.

virtual void setIdString(long index, const char* idStringItem);

clone
Returns a copy of the PID.
virtual DKPid* clone();

pidType
Gets the PID type.
virtual DKString  pidType() const;

Exceptions:

DKUsageError -- The following are possible error messages:

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