SMILA 1.0 API documentation

org.eclipse.smila.binarystorage
Interface BinaryStorageService

All Known Implementing Classes:
BinaryStorageServiceImpl

public interface BinaryStorageService

Binary storage service interface.

Author:
mcimpean

Method Summary
 byte[] fetchAsByte(java.lang.String id)
          Fetch an already persisted attachment through (BinaryStorageService.storeRecordAttachment) from binary storage as byte array.
 java.io.InputStream fetchAsStream(java.lang.String id)
          Fetch an already persisted attachment through (BinaryStorageService.storeRecordAttachment) from binary storage as InputStream.
 long fetchSize(java.lang.String id)
          Fetch size of persisted attachment.
 void remove(java.lang.String id)
          Removes folder&file structure from the binary storage, based on the passed key.
 void store(java.lang.String id, byte[] blob)
          Save the attachment byte array content in the binary storage location.
 void store(java.lang.String id, java.io.InputStream stream)
          Save the attachment stream in the binary storage location.
 

Method Detail

store

void store(java.lang.String id,
           java.io.InputStream stream)
           throws BinaryStorageException
Save the attachment stream in the binary storage location.

Parameters:
id - String - calculated key (attachment id) from blackboard service based on record Id and file name. The key will serve to identify (persistence scope) current folder & file inside of binary storage.
stream - InputStream - attachment stream
Throws:
BinaryStorageException - in case of any exception

store

void store(java.lang.String id,
           byte[] blob)
           throws BinaryStorageException
Save the attachment byte array content in the binary storage location.

Parameters:
id - String - calculated key (attachment id) from blackboard service based on record Id and file name. The key will serve to identify (persistence scope) current folder & file inside of binary storage.
blob - byte[] - file content to be stored in binary storage
Throws:
BinaryStorageException - in case of any exception

fetchAsByte

byte[] fetchAsByte(java.lang.String id)
                   throws BinaryStorageException
Fetch an already persisted attachment through (BinaryStorageService.storeRecordAttachment) from binary storage as byte array.

Parameters:
id - String - calculated key (attachment id) from blackboard service based on record Id and file name. The key value passed by the Blackboard service shall be identically with the same one, passed one step previously (through the createStorageFile service) in order to get exactly the same file content.
Returns:
byte[] - file content
Throws:
BinaryStorageException - in case of any exception

fetchAsStream

java.io.InputStream fetchAsStream(java.lang.String id)
                                  throws BinaryStorageException
Fetch an already persisted attachment through (BinaryStorageService.storeRecordAttachment) from binary storage as InputStream.

Parameters:
id - String - calculated key (attachment id) from blackboard service based on record Id and file name. The key value passed by the Blackboard service shall be identically with the same one, passed one step previously (through the createStorageFile service) in order to get exactly the same file content.
Returns:
InputStream - file content
Throws:
BinaryStorageException - in case of any exception

remove

void remove(java.lang.String id)
            throws BinaryStorageException
Removes folder&file structure from the binary storage, based on the passed key.

Parameters:
id - String - calculated key (attachment id) from blackboard service based on record Id and file name.
Throws:
BinaryStorageException - in case of any exception

fetchSize

long fetchSize(java.lang.String id)
               throws BinaryStorageException
Fetch size of persisted attachment.

Parameters:
id -
Returns:
int - attachment size
Throws:
BinaryStorageException - in case of any exception

SMILA 1.0 API documentation