|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AttachmentDataDao
This interface defines the methods for classes acting as a DAO at the level of data storage for Attachments.
Method Summary | |
---|---|
void |
afterMigrationFrom()
Perform any tasks necessary after Attachment data has been moved from this data store to another. |
java.io.InputStream |
getDataForAttachment(Attachment attachment)
Grabs the AttachmentData object for an Attachment |
AttachmentDataStorageType |
getStorageType()
Returns the storage type. |
boolean |
isAttachmentPresent(Attachment attachment)
Check that an attachment exists |
void |
moveAttachment(Attachment attachment,
Attachment oldAttachment,
ContentEntityObject newContent)
Moves an attachment to a new file name or content object |
void |
moveDataForAttachmentVersion(Attachment sourceAttachmentVersion,
Attachment targetAttachmentVersion)
Moves the attachment data from one AbstractVersionedEntityObject.getVersion() to the other. |
void |
prepareForMigrationTo()
Prepare the data store for a migration from another type of data store. |
void |
removeDataForAttachment(Attachment attachment,
ContentEntityObject originalContent)
Removes all attachment data for the given attachment. |
void |
removeDataForAttachmentVersion(Attachment attachmentVersion,
ContentEntityObject originalContent)
Removes the attachment data for the given attachment version. |
void |
replaceDataForAttachment(Attachment attachment,
java.io.InputStream data)
Sets the data for attachment This method will overwrite any existing data for the attachment. |
void |
saveDataForAttachment(Attachment attachment,
java.io.InputStream data)
Saves data to the attachment data store |
void |
saveDataForAttachmentVersion(Attachment attachment,
Attachment previousVersion,
java.io.InputStream data)
Saves data to the attachment data store, for an attachment that has been updated. |
Method Detail |
---|
java.io.InputStream getDataForAttachment(Attachment attachment) throws AttachmentDataNotFoundException
attachment
- the Attachment representing the data
java.lang.IllegalArgumentException
- if attachment is null
AttachmentDataNotFoundException
- if no data was foundvoid removeDataForAttachment(Attachment attachment, ContentEntityObject originalContent)
attachment
- the latest version of the attachment for which the data should be removedoriginalContent
- the content the attachment belongs to
java.lang.IllegalArgumentException
- if attachment is nullvoid removeDataForAttachmentVersion(Attachment attachmentVersion, ContentEntityObject originalContent)
attachmentVersion
- the version of the attachment for which the data should be removedoriginalContent
- the content the attachment belongs to
java.lang.IllegalArgumentException
- if attachment is nullvoid moveDataForAttachmentVersion(Attachment sourceAttachmentVersion, Attachment targetAttachmentVersion)
AbstractVersionedEntityObject.getVersion()
to the other.
This method will overwrite any existing data for the target attachment version.
sourceAttachmentVersion
- the attachmenttargetAttachmentVersion
-
java.lang.IllegalArgumentException
- if the Attachment.getContent()
differsmoveAttachment(Attachment, Attachment, ContentEntityObject)
void saveDataForAttachment(Attachment attachment, java.io.InputStream data)
attachment
- the Attachment the data belongs todata
- the InputStream to be written
java.lang.IllegalArgumentException
- if attachment is null
java.lang.IllegalArgumentException
- if data is null
AttachmentDataStreamSizeMismatchException
- if bytes read from the data stream does not match Attachment.getFileSize()
.void saveDataForAttachmentVersion(Attachment attachment, Attachment previousVersion, java.io.InputStream data)
attachment
- the new version of the attachmentpreviousVersion
- the previous version of the attachmentdata
- the InputStream representing the data
AttachmentDataStreamSizeMismatchException
- if bytes read from the data stream does not match Attachment.getFileSize()
.void replaceDataForAttachment(Attachment attachment, java.io.InputStream data)
attachment
- Attachment the data belongs todata
- the data to be saved
AttachmentDataStreamSizeMismatchException
- if bytes read from the data stream does not match Attachment.getFileSize()
.boolean isAttachmentPresent(Attachment attachment)
attachment
- the Attachment to be checkedvoid moveAttachment(Attachment attachment, Attachment oldAttachment, ContentEntityObject newContent)
attachment
- the Attachment to be movedoldAttachment
- the original version of the attachmentnewContent
- the new content the Attachment belongs to
java.lang.IllegalArgumentException
- if attachment is null
java.lang.IllegalArgumentException
- if newFileName is null
java.lang.IllegalArgumentException
- if newContent is nullvoid prepareForMigrationTo()
java.lang.RuntimeException
- if there was a problemvoid afterMigrationFrom()
Implementations may circumvent hibernate, so should only be called when nobody else can see the attachment data.
java.lang.RuntimeException
- if there was a problemAttachmentDataStorageType getStorageType()
The client code should be storage agnostic in general. Thus this method should only be used in rare cases in order to hide operations which are known to be not implemented for the specific type.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |