| Summary: | Record/Blackboard: Introduce an interface for Attachment | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Juergen Schumacher <juergen.schumacher> |
| Component: | Smila | Assignee: | Juergen Schumacher <juergen.schumacher> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | igor.novakovic |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
|
Description
Juergen Schumacher
I've committed a first version. Please review and feel free to discuss (though I will not be able to do changes before Jan 5th 2012 ;-) To adapt your code, it should be sufficient to replace invocations of record.getAttachment() and blackboard.getAttachment() by calls to record.getAttachmentsAsBytes(...) or blackboard.getAttachmentAsBytes(...) respectively. Additionally, you cannot call setAttachment(name, (byte[]) null)) anymore, it will throw an AttachmentException (a RuntimeException). Use setAttachment(new StoredAttachment(name(, size)?)) to denote that an attachment is stored in a persistence service instead of in-memory. Also, blackboard.getRecord(id).getAttachmentAsBytes() will throw an AttachmentException now if the attachment content is in BinaryStorage (instead of returning as before). Use blackboard.getAttachmentAsBytes(id, name). We can implement a subclass of StoredAttachment later, that will be able to retrieve the content from BinaryStorage on-demand (so that attachments in BinStorage or other persistence services can be supported without having to use the blackboard). No objections so far, so I'll close this thing for now. |