Enterprise Information Portal APIs

com.ibm.mm.sdk.common
Class dkAbstractXDO

java.lang.Object
  |
  +--com.ibm.mm.sdk.common.dkAbstractXDO
All Implemented Interfaces:
dkDataObjectBase, dkXDO, dkXDOBase, java.io.Serializable
Direct Known Subclasses:
dkBlob, dkClob, dkDBClob

public abstract class dkAbstractXDO
extends java.lang.Object
implements dkXDO, java.io.Serializable

dkAbstractXDO: a common abstract class that can represent a complex UDT(User Defined Type) or LOB(Large Object).

See Also:
Serialized Form

Method Summary
 void add()
          Adds the content object from memory to the datastore
 void add(java.lang.String aFullFileName)
          Adds the content object from existing file to the datastore
 void addExtension(java.lang.String extensionName, dkExtension extensionObj)
          Add the extension object.
abstract  dkXDO cloneSkeleton()
          Clone this XDO with its persistent-id only, that is, with its data content set to empty.
 boolean compareData(dkXDO aXDO)
          Compares the content of this object with the content of the other XDO object
abstract  void copyData(dkXDO aXDO)
          Replaces the content of this object with the content of the other XDO object
 dkDatastore datastore()
          Deprecated. Replace by getDatastore
 void del()
          Deletes the content object from datastore
 void del(boolean flush)
          Deletes the content object from datastore
 boolean equals(dkXDOBase aXDOBase)
          Check if the objects have the same value
 int getAffiliatedType()
          Gets the affiliated type of this object.
 java.lang.String getClassName()
          Gets the class name of this object.
abstract  byte[] getContent()
          Gets the content of this object
abstract  void getContentToClientFile(java.lang.String afileName, int fileOption)
          Copies the lob data of this object to the given file
 java.lang.String getContentType()
          Gets the content type of this object.
 dkDatastore getDatastore()
          Gets the reference to the owner datastore object
 dkExtension getExtension(java.lang.String extensionName)
          Gets the extension object.
 java.lang.String getMimeType()
          Gets the MIME type of this object.
 java.lang.String getOpenHandler()
          Gets the current program name of the handler for this object instance
 java.lang.Object getOption(int option)
          Gets the option value of a specified option
 dkDataObjectBase getParent()
          Gets the parent object
 DKPid getPid()
          Deprecated. Replace by getPidObject()
abstract  DKPid getPidObject()
          Gets a copy of the persistent ID object of this object
 int getRank()
          Gets the ranking value of a query
 dkDataObjectBase getRootObject()
          Gets the root object
abstract  boolean isContentChanged()
          Checks if the part content changed (in memory).
abstract  boolean isNull()
          Checks if the part content is null (in memory).
 boolean isOpenSynchronous()
          Gets the current synchronization property
abstract  boolean isSet()
          Checks if the part content is set (in memory).
 int length()
          Gets the length of this content object in memory
 boolean notEqual(dkXDOBase aXDOBase)
           
 void open()
          Unloads the content object to a client file with a system generated name and then synchronously invoking a default handler against the file.
 void open(java.lang.String afileName)
          Unloads the content object to a file afileName provided by the application and then synchronously invoking a default handler against the file.
 short protocol()
          Returns the protocol supported by this object.
 void removeExtension(java.lang.String extensionName)
          Remove the extension object.
 void retrieve()
          Retrieves the content object from the datastore to the memory buffer
 void retrieve(java.lang.String aFullFileName)
          Retrieves the content object from the datastore to a file name
 void setAffiliatedType(int affiliatedType)
          Sets the affiliated type for this object.
 void setClassName(java.lang.String className)
          Sets the class name of this object.
 void setClassOpenHandler(java.lang.String ahandler, boolean newSynchronousFlag)
          Sets the executable handler program name and whether this handler should be invoked synchronously or asynchronously for this object class
abstract  void setContent(byte[] aByteArr)
          Sets the content of this object with a byte array stream argument
abstract  void setContentFromClientFile(java.lang.String afileName)
          Replaces the lob data of this object with the contents of the file afileName
 void setContentType(java.lang.String contentType)
          Sets the content type for this object.
 void setDatastore(dkDatastore ds)
          Sets the reference to the owner datastore object
 void setInstanceOpenHandler(java.lang.String ahandler, boolean newSynchronousFlag)
          Sets the executable handler program name and whether this handler should be invoked synchronously or asynchronously for this object instant
 void setMimeType(java.lang.String mimeType)
          Sets the MIME type for this object.
abstract  void setNull()
          Sets the part content to null (in memory).
 void setOption(int option, java.lang.Object value)
          Sets the option value to a specified option
 void setParent(dkDataObjectBase parentObject)
          Sets the parent object
 void setPid(DKPid aPid)
          Deprecated. Replace by setPidObject(DKPid aPid)
abstract  void setPidObject(DKPid aPid)
          Sets the pid information of this object with the new provided pid
 void setRank(int aRank)
          Sets the ranking value of a query
 void setRootObject(dkDataObjectBase rootObject)
          Sets the root object
 int size()
          Gets the size of this content object in the datastore
 void update()
          Updates the content object in datastore with the content in memory
 void update(java.lang.String aFullFileName)
          Updates the content object in datastore with a file
 
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.dkDataObjectBase
getObjectType
 

Method Detail

setNull

public abstract void setNull()
Sets the part content to null (in memory).
Specified by:
setNull in interface dkXDOBase

isNull

public abstract boolean isNull()
Checks if the part content is null (in memory).
Specified by:
isNull in interface dkXDOBase
Returns:
true if the object content is null; false otherwise.

equals

public boolean equals(dkXDOBase aXDOBase)
               throws DKException
Check if the objects have the same value
Specified by:
equals in interface dkXDOBase
Parameters:
adkXDOBase - an instance of dkXDOBase
Returns:
true if the objects have the same value false otherwise.
Throws:
DKException, - Exception If error occurred

notEqual

public boolean notEqual(dkXDOBase aXDOBase)
                 throws DKException
Specified by:
notEqual in interface dkXDOBase

setPid

public void setPid(DKPid aPid)
            throws DKUsageError
Deprecated. Replace by setPidObject(DKPid aPid)

Sets the pid information of this object with the new provided pid

Note:DKUsageError exception thrown if method is not implemented

Specified by:
setPid in interface dkXDO
Parameters:
aPid - a DKPid or DKPidXDO object
Throws:
DKUsageError - If provided pid is null
See Also:
setPidObject(DKPid aPid)

getPid

public DKPid getPid()
Deprecated. Replace by getPidObject()

Gets a copy of the persistent ID object of this object
Specified by:
getPid in interface dkXDO
Returns:
a copy of the persistent ID object of this object
See Also:
getPidObject()

getPidObject

public abstract DKPid getPidObject()
Gets a copy of the persistent ID object of this object
Specified by:
getPidObject in interface dkXDO
Returns:
a copy of the persistent ID object of this object

setPidObject

public abstract void setPidObject(DKPid aPid)
                           throws DKException
Sets the pid information of this object with the new provided pid
Specified by:
setPidObject in interface dkXDO
Parameters:
aPid - a DKPid or DKPidXDO object
Throws:
DKException - If provided pid is null

add

public void add()
         throws DKException,
                java.lang.Exception
Adds the content object from memory to the datastore

Note:DKUsageError exception thrown if method is not implemented

Specified by:
add in interface dkXDO
Throws:
DKException, - Exception If error occurred

add

public void add(java.lang.String aFullFileName)
         throws DKException,
                java.lang.Exception
Adds the content object from existing file to the datastore

Note:DKUsageError exception thrown if method is not implemented

Specified by:
add in interface dkXDO
Parameters:
aFullFileName - a fully qualified path and file name, default is current directory
Throws:
DKException, - Exception If error occurred

retrieve

public void retrieve()
              throws DKException,
                     java.lang.Exception
Retrieves the content object from the datastore to the memory buffer
Specified by:
retrieve in interface dkXDO
Throws:
DKException, - Exception If error occurred

retrieve

public void retrieve(java.lang.String aFullFileName)
              throws DKException,
                     java.lang.Exception
Retrieves the content object from the datastore to a file name
Specified by:
retrieve in interface dkXDO
Parameters:
aFullFileName - a fully qualified path and file name, default is current directory
Throws:
DKException, - Exception If error occurred

update

public void update()
            throws DKException,
                   java.lang.Exception
Updates the content object in datastore with the content in memory

Note:DKUsageError exception thrown if method is not implemented

Specified by:
update in interface dkXDO
Throws:
DKException, - Exception If error occurred

update

public void update(java.lang.String aFullFileName)
            throws DKException,
                   java.lang.Exception
Updates the content object in datastore with a file

Note:DKUsageError exception thrown if method is not implemented

Specified by:
update in interface dkXDO
Parameters:
aFullFileName - a fully qualified path and file name, default is current directory
Throws:
DKException, - Exception If error occurred

del

public void del()
         throws DKException,
                java.lang.Exception
Deletes the content object from datastore

Note:DKUsageError exception thrown if method is not implemented

Specified by:
del in interface dkXDO
Throws:
DKException, - Exception If error occurred

del

public void del(boolean flush)
         throws DKException,
                java.lang.Exception
Deletes the content object from datastore

Note:DKUsageError exception thrown if method is not implemented

Specified by:
del in interface dkXDO
Parameters:
flush - if true the memory content will be flush, if false and content is not set, the object will be retreived before delete it. The default is flush.
Throws:
DKException, - Exception If error occurred

getContentToClientFile

public abstract void getContentToClientFile(java.lang.String afileName,
                                            int fileOption)
                                     throws DKException,
                                            java.lang.Exception
Copies the lob data of this object to the given file
Specified by:
getContentToClientFile in interface dkXDO
Parameters:
afileName - a fully qualified path with file name, default is current directory(if no path)
fileOption - 1 will create or overwrite an existing file; 2 will only create file, but will also throw an exception if the file already exists; 3 appends to an existing file
Throws:
DKException, - Exception If error occurred

setContentFromClientFile

public abstract void setContentFromClientFile(java.lang.String afileName)
                                       throws DKException
Replaces the lob data of this object with the contents of the file afileName
Specified by:
setContentFromClientFile in interface dkXDO
Parameters:
afileName - a fully qualified path with file name, default is current directory(if no path)
Throws:
DKException - If error occurred

isContentChanged

public abstract boolean isContentChanged()
Checks if the part content changed (in memory).
Specified by:
isContentChanged in interface dkXDO
Returns:
true if the content object is changed; false otherwise.

isSet

public abstract boolean isSet()
Checks if the part content is set (in memory).
Specified by:
isSet in interface dkXDO
Returns:
true if the content object is set; false otherwise.

copyData

public abstract void copyData(dkXDO aXDO)
                       throws DKException,
                              java.lang.Exception
Replaces the content of this object with the content of the other XDO object
Specified by:
copyData in interface dkXDO
Parameters:
adkXDO - the other XDO object
Throws:
DKException, - Exception If error occurred

compareData

public boolean compareData(dkXDO aXDO)
                    throws DKException,
                           java.lang.Exception
Compares the content of this object with the content of the other XDO object
Specified by:
compareData in interface dkXDO
Parameters:
adkXDO - the other XDO object
Throws:
DKException, - Exception If object type is different

protocol

public short protocol()
Returns the protocol supported by this object.
Specified by:
protocol in interface dkXDOBase
Returns:
the protocol "DK_CM_XDO"

size

public int size()
         throws DKException,
                java.lang.Exception
Gets the size of this content object in the datastore

Note:DKUsageError exception thrown if method is not implemented

Specified by:
size in interface dkXDO
Returns:
a byte length of this content object in the datastore

length

public int length()
           throws DKException,
                  java.lang.Exception
Gets the length of this content object in memory
Specified by:
length in interface dkXDO
Returns:
a byte length of this content object in memory

datastore

public dkDatastore datastore()
Deprecated. Replace by getDatastore

Gets the reference to the owner datastore object
Specified by:
datastore in interface dkXDO
Returns:
the dkDatastore object
See Also:
getDatastore()

getDatastore

public dkDatastore getDatastore()
Gets the reference to the owner datastore object
Specified by:
getDatastore in interface dkXDO
Returns:
the dkDatastore object

setDatastore

public void setDatastore(dkDatastore ds)
Sets the reference to the owner datastore object
Specified by:
setDatastore in interface dkXDO
Parameters:
ds - a dkDatastore

cloneSkeleton

public abstract dkXDO cloneSkeleton()
                             throws DKUsageError,
                                    java.lang.Exception
Clone this XDO with its persistent-id only, that is, with its data content set to empty.
Specified by:
cloneSkeleton in interface dkXDO

getAffiliatedType

public int getAffiliatedType()
                      throws DKException,
                             java.lang.Exception
Gets the affiliated type of this object. An affiliated type could be ANNOTATION, NOTES, etc. The subclass need to override the behaviour of the default implementation of this method.
Specified by:
getAffiliatedType in interface dkXDO
Returns:
the affiliated type for this object, for example: DK_CM_ANNOTATION, DK_CM_NOTE, etc.

setAffiliatedType

public void setAffiliatedType(int affiliatedType)
                       throws DKException,
                              java.lang.Exception
Sets the affiliated type for this object. The subclass need to override the behaviour of the default implementation of this method.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
setAffiliatedType in interface dkXDO
Parameters:
affiliatedType - the affiliated type
See Also:
getAffiliatedType()

getMimeType

public java.lang.String getMimeType()
                             throws DKException,
                                    java.lang.Exception
Gets the MIME type of this object. The subclass need to override the behaviour of the default implementation of this method.
Specified by:
getMimeType in interface dkXDO
Returns:
the MIME type for this object,

setMimeType

public void setMimeType(java.lang.String mimeType)
                 throws DKException,
                        java.lang.Exception
Sets the MIME type for this object. The subclass need to override the behaviour of the default implementation of this method.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
setMimeType in interface dkXDO
Parameters:
mimeType - the MIME type
See Also:
getMimeType()

getContentType

public java.lang.String getContentType()
                                throws DKException,
                                       java.lang.Exception
Gets the content type of this object. A content type could be ASCII, JPG, AVI, GIF, HTML, etc The subclass need to override the behaviour of the default implementation of this method.
Specified by:
getContentType in interface dkXDO
Returns:
the content type for this object,

setContentType

public void setContentType(java.lang.String contentType)
                    throws DKException,
                           java.lang.Exception
Sets the content type for this object. The subclass need to override the behaviour of the default implementation of this method.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
setContentType in interface dkXDO
Parameters:
contentType - the content type
See Also:
getContentType()

addExtension

public void addExtension(java.lang.String extensionName,
                         dkExtension extensionObj)
                  throws DKException,
                         java.lang.Exception
Add the extension object. Do nothing.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
addExtension in interface dkXDO
Parameters:
extensionName - the extension name
extensionObj - a source extension object
Throws:
DKException, - Exception If error occurred

removeExtension

public void removeExtension(java.lang.String extensionName)
                     throws DKException
Remove the extension object.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
removeExtension in interface dkXDO
Parameters:
extensionName - the extension name
Throws:
DKException - If error occurred

getExtension

public dkExtension getExtension(java.lang.String extensionName)
                         throws DKException,
                                java.lang.Exception
Gets the extension object. Default always throws exception. Subclass must write this method.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
getExtension in interface dkXDO
Parameters:
extensionName - the extension name
Returns:
a dkExtension object
Throws:
DKException, - Exception If error occurred

getContent

public abstract byte[] getContent()
                           throws DKException,
                                  java.lang.Exception
Gets the content of this object
Specified by:
getContent in interface dkXDO
Returns:
the content object as a byte array stream
Throws:
DKException, - Exception If object type is different

setContent

public abstract void setContent(byte[] aByteArr)
                         throws DKException
Sets the content of this object with a byte array stream argument
Specified by:
setContent in interface dkXDO
Parameters:
aByteArr - a byte array

getOption

public java.lang.Object getOption(int option)
                           throws DKException,
                                  java.lang.Exception
Gets the option value of a specified option

Note:DKUsageError exception thrown if method is not implemented

Specified by:
getOption in interface dkXDO
Parameters:
option - a specified option
Returns:
the object contains the option value

setOption

public void setOption(int option,
                      java.lang.Object value)
               throws DKException,
                      java.lang.Exception
Sets the option value to a specified option

Note:DKUsageError exception thrown if method is not implemented

Specified by:
setOption in interface dkXDO
Parameters:
option - a specified option
value - an object contains the option value

setRank

public void setRank(int aRank)
Sets the ranking value of a query
Specified by:
setRank in interface dkXDO
Parameters:
aRank - a ranking value

getRank

public int getRank()
Gets the ranking value of a query
Specified by:
getRank in interface dkXDO
Returns:
a ranking value

open

public void open()
          throws DKException,
                 java.lang.Exception
Unloads the content object to a client file with a system generated name and then synchronously invoking a default handler against the file.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
open in interface dkXDOBase
Throws:
DKException, - Exception If error occurred

open

public void open(java.lang.String afileName)
          throws DKException,
                 java.lang.Exception
Unloads the content object to a file afileName provided by the application and then synchronously invoking a default handler against the file.

Note:DKUsageError exception thrown if method is not implemented

Specified by:
open in interface dkXDOBase
Parameters:
afileName - a provided file name
Throws:
DKException, - Exception If error occurred

setInstanceOpenHandler

public void setInstanceOpenHandler(java.lang.String ahandler,
                                   boolean newSynchronousFlag)
Sets the executable handler program name and whether this handler should be invoked synchronously or asynchronously for this object instant
Specified by:
setInstanceOpenHandler in interface dkXDOBase
Parameters:
ahandler - the handler program name to view the content
newSynchronousFlag - true for synchronous process; false otherwise.

setClassOpenHandler

public void setClassOpenHandler(java.lang.String ahandler,
                                boolean newSynchronousFlag)
Sets the executable handler program name and whether this handler should be invoked synchronously or asynchronously for this object class
Specified by:
setClassOpenHandler in interface dkXDOBase
Parameters:
ahandler - the handler program name to view the content
newSynchronousFlag - true for synchronous process; false otherwise.

getOpenHandler

public java.lang.String getOpenHandler()
Gets the current program name of the handler for this object instance
Specified by:
getOpenHandler in interface dkXDOBase
Returns:
the handler program name

isOpenSynchronous

public boolean isOpenSynchronous()
Gets the current synchronization property
Specified by:
isOpenSynchronous in interface dkXDOBase
Returns:
TRUE or FALSE for the handler

getParent

public dkDataObjectBase getParent()
Gets the parent object
Specified by:
getParent in interface dkDataObjectBase
Returns:
the parent object. Returns null if no parent

setParent

public void setParent(dkDataObjectBase parentObject)
Sets the parent object
Specified by:
setParent in interface dkDataObjectBase
Parameters:
parent - the parent object

getRootObject

public dkDataObjectBase getRootObject()
Gets the root object
Specified by:
getRootObject in interface dkDataObjectBase
Returns:
the root object. Returns null if no root

setRootObject

public void setRootObject(dkDataObjectBase rootObject)
Sets the root object
Specified by:
setRootObject in interface dkDataObjectBase
Parameters:
rootObject - the root object

getClassName

public java.lang.String getClassName()
                              throws DKException,
                                     java.lang.Exception
Gets the class name of this object.
Specified by:
getClassName in interface dkXDO
Returns:
the class name

setClassName

public void setClassName(java.lang.String className)
                  throws DKException,
                         java.lang.Exception
Sets the class name of this object.
Specified by:
setClassName in interface dkXDO
Parameters:
className - the class name

EIP Java APIs

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