public class CopyAttachmentCmdImpl extends TaskCommandImpl implements CopyAttachmentCmd
This class makes a copy of the attachment object as specified by org_attachmentobj_id
.
A new attachment object will be created and the new attachment object_id
will be returned.
The copy made will be a field by field copy including the timecreated
,
timeupated
and markfordelete
fields. The reserved field will be copied from
the original attachment object to the new attachment object.
If the attachmentURL
is the same as the org_attachment_id
in the
attachment table, the content of the attachment is stored in BLOB
. It will be copied into
the new attachment table as BLOB
as well.
If the attachmentURL
is not the same as the attachment_id
, the
attachment is stored on the file system as specified in the attachmentURL
. The file will
be opened as specified in the attachmentURL
in the original attachment object.
A new unique file name will be generated, and the file content will be copied into the new file. The
new filename will be the attachmenturl
of the new attachment object.
Note that when the attachment object is deleted during DBClean
, a log of the
attachmenturl
will be generated if the attachment is stored on the file system. It is up
to the user to delete the file.
This class does not provide access control checking. The command writer should implement his/her own access control checking and make sure the caller is authorized to make a copy of the attachment object.
defaultCommandClassName, NAME
Constructor and Description |
---|
CopyAttachmentCmdImpl() |
Modifier and Type | Method and Description |
---|---|
java.lang.Long |
getAttachmentId()
This method gets the
attachmentobj_id of the attachment object in the database table
that is a duplication of the original attachment. |
java.lang.Long |
getOrg_attachmentobj_id()
This method gets the
org_attachmentobj_id . |
boolean |
performAccessCheck()
This method performs access control checking to control who can view the attachment.
|
void |
performExecute()
This method contains the main business logic of this command.
|
void |
setOrg_attachmentobj_id(java.lang.Long org_attachmentobj_id)
This method sets the
org_attachmentobj_id . |
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
public java.lang.Long getAttachmentId()
attachmentobj_id
of the attachment object in the database table
that is a duplication of the original attachment.getAttachmentId
in interface CopyAttachmentCmd
Long
object that represents the attachmentobj_id
.public void performExecute() throws ECException
performExecute
in interface ECCommand
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class AbstractECTargetableCommand
ECException
public boolean performAccessCheck()
performAccessCheck
in interface CopyAttachmentCmd
boolean
value.public java.lang.Long getOrg_attachmentobj_id()
org_attachmentobj_id
.getOrg_attachmentobj_id
in interface CopyAttachmentCmd
Long
object that represents the org_attachmentobj_id
.public void setOrg_attachmentobj_id(java.lang.Long org_attachmentobj_id)
org_attachmentobj_id
.setOrg_attachmentobj_id
in interface CopyAttachmentCmd
org_attachmentobj_id
- This is the org_attachmentobj_id
to set