|
Enterprise Information Portal APIs |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.mm.sdk.common.dkAbstractDataObjectBase | +--com.ibm.mm.sdk.common.dkDataObject | +--com.ibm.mm.sdk.common.DKDDOBase | +--com.ibm.mm.sdk.common.DKDDO | +--com.ibm.mm.sdk.common.dkResource
dkResource: a common abstract class user to represent resources and provides a generic interface to resource object functions. It can represent a simle LOB (large object) or a more complex type defined by user, such as video stream, audio, large text, etc. A resource object consists of a content, usually a LOB (large object), and the meta-data or attributes describing the content. Applications are expected to subclass dkResource to implement more specific resource types. Currently, this class library provides the following subclasses:
Fields inherited from interface com.ibm.mm.sdk.common.DKConstant |
For details, see the class or interface |
Fields inherited from interface com.ibm.mm.sdk.common.DKMessageId |
For details, see the class or interface |
Constructor Summary | |
dkResource(dkDatastore ds,
java.lang.String objectType)
Constructs a resource object for a given object type and the datastore associated with it. |
|
dkResource(dkDatastore ds,
java.lang.String objectType,
short initialSize)
Constructs a resource object for a given object type, with an initial number of data-items and the datastore associated with it. |
Method Summary | |
void |
add()
Adds or stores the content and meta-data of this resource object into the persistent store. |
void |
add(java.lang.String aFullFileName)
Adds or stores the content and meta-data of this resource object into the persistent store with an input file. |
void |
addExtension(java.lang.String extensionName,
dkExtension extensionObj)
Add the extension to this resource object. |
abstract dkXDO |
cloneSkeleton()
Clone this resource with its persistent-identifier only, that is, with its data content set to empty. |
abstract boolean |
compareData(dkXDO aXDO)
Compares the content of this object with the content of another resource object. |
abstract void |
copyData(dkXDO aXDO)
Replaces the content of this object with the content of another resource object. |
void |
del()
Deletes this resource from the persistent store. |
void |
del(boolean flush)
Deletes this resource from the persistent store and apply the specified option. |
boolean |
equals(dkXDOBase aXDOBase)
Check if this resource is equal to the given resource Each subclass must override this method to provide a specific implemntation appropriate for it. |
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 content of this resource to the specified file |
java.lang.String |
getContentType()
Gets the content type of this object. |
dkExtension |
getExtension(java.lang.String extensionName)
Gets the extension object with the given name. |
java.lang.String |
getMimeType()
Gets the MIME type of this object. |
java.lang.String |
getOpenHandler()
Gets the current program name of the executable handler for this object's instance. |
java.lang.Object |
getOption(int option)
Gets the value of a specified option The subclass need to override the behaviour of the default implementation of this method. |
int |
getRank()
Gets the ranking value of a query. |
abstract boolean |
isContentChanged()
Checks if the content of this resource in-memory has changed |
abstract boolean |
isNull()
Checks if the content of this resource is null. |
boolean |
isOpenSynchronous()
Checks the synchronization property of the current executable handler program. |
abstract boolean |
isSet()
Checks if the content of this resource is set |
int |
length()
Gets the length of this resource content in memory The subclass need to override the behaviour of the default implementation of this method. |
boolean |
notEqual(dkXDOBase aXDOBase)
Check if this resource is not equal to the given resource Each subclass must override this method to provide a specific implemntation appropriate for it. |
void |
open()
Unloads the object's content to a client file with a system generated name and then synchronously invoke a default handler against the file. |
void |
open(java.lang.String afileName)
Unloads the object's content to the given file name and then synchronously invoke a default handler against the file. |
short |
protocol()
Returns the protocol supported by this object. |
void |
removeExtension(java.lang.String extensionName)
Removes the extension object with the given name. |
void |
retrieve()
Retrieves the meta-data and the content from the persistent store. |
void |
retrieve(java.lang.String aFullFileName)
Retrieves the meta-data and the content from the persistent store to memory, but streams the content directly into the specified filename. |
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 to the given byte array value. |
abstract void |
setContentFromClientFile(java.lang.String afileName)
Replaces the content of this resource in memory with the content obtained from the specified filename. |
void |
setContentType(java.lang.String contentType)
Sets the content type for this 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 instance. |
void |
setMimeType(java.lang.String mimeType)
Sets the MIME type for this object. |
abstract void |
setNull()
Sets the content of this resource to null. |
void |
setOption(int option,
java.lang.Object value)
Sets the value from the specified option. |
void |
setRank(int aRank)
Sets the ranking value of a query. |
int |
size()
Gets the actual size of this resource content in the persistent store. |
void |
update()
Updates the meta-data and content of this resource in the persistent store from the value in-memory. |
void |
update(java.lang.String aFullFileName)
Updates the meta-data and content of this resource in the persistent store, but updates the content directly from the content from the specified file name. |
Methods inherited from class com.ibm.mm.sdk.common.DKDDO |
add, add, del, del, fromXML, fromXML, getDatastore, retrieve, retrieve, setDatastore, toXML, update, update |
Methods inherited from class com.ibm.mm.sdk.common.dkDataObject |
getPid, getPidObject, setPid, setPidObject |
Methods inherited from class com.ibm.mm.sdk.common.dkAbstractDataObjectBase |
getParent, getRootObject, setParent, setRootObject |
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.dkXDO |
datastore, getDatastore, getPid, getPidObject, setDatastore, setPid, setPidObject |
Methods inherited from interface com.ibm.mm.sdk.common.dkDataObjectBase |
getObjectType, getParent, getRootObject, setParent, setRootObject |
Constructor Detail |
public dkResource(dkDatastore ds, java.lang.String objectType)
ds
- a datastore object.objectType
- an object-type. Usually it is the entity name
defined in this datastore and represented by this class.public dkResource(dkDatastore ds, java.lang.String objectType, short initialSize)
ds
- a datastore object.objectType
- an object-type. Usually it is the entity name
defined in this datastore and represented by this class.initialSize
- the number of data-items initially allocated
in this object.Method Detail |
public abstract void setNull()
setNull
in interface dkXDOBase
public abstract boolean isNull()
isNull
in interface dkXDOBase
true
if the content is null;
false
otherwise.public boolean equals(dkXDOBase aXDOBase) throws DKException
equals
in interface dkXDOBase
aXDOBase
- an instance of dkXDOBasetrue
if these resources are equal
false
otherwise.DKException,
- Exception If error occurredpublic boolean notEqual(dkXDOBase aXDOBase) throws DKException
notEqual
in interface dkXDOBase
aXDOBase
- an instance of dkXDOBasetrue
if these resources are equal
false
otherwise.DKException,
- Exception If error occurredpublic void add() throws DKException, java.lang.Exception
If the content is not available, then only the meta-data is created. The content can be added later.
Note:DKUsageError exception thrown if method is not implemented
add
in interface dkXDO
add
in class DKDDO
DKException,
- Exception If error occurredpublic void add(java.lang.String aFullFileName) throws DKException, java.lang.Exception
If the content is stored directly from the input file into the persistent store.
Note:DKUsageError exception thrown if method is not implemented
add
in interface dkXDO
aFullFileName
- a fully qualified path and file name, The default
is in the current directoryDKException,
- Exception If error occurredpublic void retrieve() throws DKException, java.lang.Exception
retrieve
in interface dkXDO
retrieve
in class DKDDO
DKException,
- Exception If error occurredpublic void retrieve(java.lang.String aFullFileName) throws DKException, java.lang.Exception
retrieve
in interface dkXDO
aFullFileName
- a fully qualified path and file name, The default
is in the current directoryDKException,
- Exception If error occurredpublic void update() throws DKException, java.lang.Exception
Note:DKUsageError exception thrown if method is not implemented
update
in interface dkXDO
update
in class DKDDO
DKException,
- Exception If error occurredpublic void update(java.lang.String aFullFileName) throws DKException, java.lang.Exception
Note:DKUsageError exception thrown if method is not implemented
update
in interface dkXDO
aFullFileName
- a fully qualified path and file name, The default
is in the current directoryDKException,
- Exception If error occurredpublic void del() throws DKException, java.lang.Exception
Note:DKUsageError exception thrown if method is not implemented
del
in interface dkXDO
del
in class DKDDO
DKException,
- Exception If error occurredpublic void del(boolean flush) throws DKException, java.lang.Exception
Note:DKUsageError exception thrown if method is not implemented
del
in interface dkXDO
flush
- if true the memory content will be flush, if false
and content is not set, the object will be retrieved before delete it.
The default is to flush.DKException,
- Exception If error occurredpublic abstract void getContentToClientFile(java.lang.String afileName, int fileOption) throws DKException, java.lang.Exception
getContentToClientFile
in interface dkXDO
afileName
- a fully qualified path with file name,
default is current directory(if no path)fileOption
- DKException,
- Exception If error occurredpublic abstract void setContentFromClientFile(java.lang.String afileName) throws DKException
setContentFromClientFile
in interface dkXDO
afileName
- a fully qualified path with file name, if
no path, the default is in the current directoryDKException
- If error occurredpublic abstract boolean isContentChanged()
isContentChanged
in interface dkXDO
true
if the content is changed;
false
otherwise.public abstract boolean isSet()
isSet
in interface dkXDO
true
if the content is set;
false
otherwise.public abstract void copyData(dkXDO aXDO) throws DKException, java.lang.Exception
copyData
in interface dkXDO
aXDO
- the other XDO objectDKException,
- Exception If error occurredpublic abstract boolean compareData(dkXDO aXDO) throws DKException, java.lang.Exception
compareData
in interface dkXDO
aXDO
- the other XDO objectDKException,
- Exception If object type is differentpublic short protocol()
protocol
in interface dkXDOBase
protocol
in class DKDDO
public int size() throws DKException, java.lang.Exception
Note:DKUsageError exception thrown if method is not implemented
size
in interface dkXDO
public int length() throws DKException, java.lang.Exception
Note:DKUsageError exception thrown if method is not implemented
length
in interface dkXDO
public abstract dkXDO cloneSkeleton() throws DKUsageError, java.lang.Exception
cloneSkeleton
in interface dkXDO
public int getAffiliatedType() throws DKException, java.lang.Exception
getAffiliatedType
in interface dkXDO
public void setAffiliatedType(int affiliatedType) throws DKException, java.lang.Exception
Note:DKUsageError exception thrown if method is not implemented
setAffiliatedType
in interface dkXDO
affiliatedType
- the affiliated typegetAffiliatedType()
public java.lang.String getMimeType() throws DKException, java.lang.Exception
getMimeType
in interface dkXDO
public void setMimeType(java.lang.String mimeType) throws DKException, java.lang.Exception
Note:DKUsageError exception thrown if method is not implemented
setMimeType
in interface dkXDO
mimeType
- the MIME typegetMimeType()
public java.lang.String getContentType() throws DKException, java.lang.Exception
getContentType
in interface dkXDO
public void setContentType(java.lang.String contentType) throws DKException, java.lang.Exception
Note:DKUsageError exception thrown if method is not implemented
setContentType
in interface dkXDO
contentType
- the content typegetContentType()
public void addExtension(java.lang.String extensionName, dkExtension extensionObj) throws DKException, java.lang.Exception
Note:DKUsageError exception thrown if method is not implemented
addExtension
in interface dkXDO
extensionName
- the extension nameextensionObj
- a source extension objectDKException,
- Exception If error occurred#removeExtension(java.lang.String,com.ibm.mm.sdk.common.dkExtension)
public void removeExtension(java.lang.String extensionName) throws DKException
Note:DKUsageError exception thrown if method is not implemented
removeExtension
in interface dkXDO
extensionName
- the extension nameDKException
- If error occurredaddExtension(java.lang.String,com.ibm.mm.sdk.common.dkExtension)
public dkExtension getExtension(java.lang.String extensionName) throws DKException, java.lang.Exception
Note:DKUsageError exception thrown if method is not implemented
getExtension
in interface dkXDO
extensionName
- the extension nameDKException,
- Exception If error occurredaddExtension(java.lang.String,com.ibm.mm.sdk.common.dkExtension)
public abstract byte[] getContent() throws DKException, java.lang.Exception
getContent
in interface dkXDO
DKException,
- Exception If a problem is encountered.public abstract void setContent(byte[] aByteArr) throws DKException
setContent
in interface dkXDO
aByteArr
- a byte arrayDKException
- If a problem is encountered.public java.lang.Object getOption(int option) throws DKException, java.lang.Exception
Note:DKUsageError exception thrown if method is not implemented
getOption
in interface dkXDO
option
- a specified optionDKException,
- Exception If a problem is encountered.public void setOption(int option, java.lang.Object value) throws DKException, java.lang.Exception
Note:DKUsageError exception thrown if method is not implemented
setOption
in interface dkXDO
option
- a specified optionvalue
- an object contains the option valueDKException,
- Exception If a problem is encountered.public void setRank(int aRank)
setRank
in interface dkXDO
aRank
- a ranking valuepublic int getRank()
getRank
in interface dkXDO
public void open() throws DKException, java.lang.Exception
Note:DKUsageError exception thrown if method is not implemented
open
in interface dkXDOBase
DKException,
- Exception If error occurredpublic void open(java.lang.String afileName) throws DKException, java.lang.Exception
Note:DKUsageError exception thrown if method is not implemented
open
in interface dkXDOBase
afileName
- a provided file nameDKException,
- Exception If error occurredopen()
public void setInstanceOpenHandler(java.lang.String ahandler, boolean newSynchronousFlag)
setInstanceOpenHandler
in interface dkXDOBase
ahandler
- the handler program name to view the content. It could
be simply a text editor or a specific viewer for this content type.newSynchronousFlag
- true
for synchronous process;
false
otherwise.setClassOpenHandler(java.lang.String,boolean)
public void setClassOpenHandler(java.lang.String ahandler, boolean newSynchronousFlag)
setClassOpenHandler
in interface dkXDOBase
ahandler
- the handler program name to view the content. It could
be simply a text editor or a specific viewer for this content type.ahandler
- the handler program name to view the contentnewSynchronousFlag
- true
for synchronous process;
false
otherwise.setInstanceOpenHandler(java.lang.String,boolean)
public java.lang.String getOpenHandler()
getOpenHandler
in interface dkXDOBase
setInstanceOpenHandler(java.lang.String,boolean)
public boolean isOpenSynchronous()
isOpenSynchronous
in interface dkXDOBase
setInstanceOpenHandler(java.lang.String,boolean)
,
setClassOpenHandler(java.lang.String,boolean)
public java.lang.String getClassName() throws DKException, java.lang.Exception
getClassName
in interface dkXDO
public void setClassName(java.lang.String className) throws DKException, java.lang.Exception
setClassName
in interface dkXDO
className
- the class name
|
EIP Java APIs | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |