SMILA (incubation) API documentation

org.eclipse.smila.binarystorage.persistence
Class BinaryPersistence

java.lang.Object
  extended by org.eclipse.smila.binarystorage.persistence.BinaryPersistence
Direct Known Subclasses:
EFSBinaryPersistence, IOBinaryPersistence, JPABinaryPersistence

public abstract class BinaryPersistence
extends java.lang.Object

Abstract binary persistence class. This class shall be extended by all concrete binary storage implementation classes.

Author:
mcimpean

Constructor Summary
BinaryPersistence()
           
 
Method Summary
abstract  void cleanup()
          Release resources and performs cleanup actions.
abstract  void deleteBinary(java.lang.String key)
          Delete binary data by key from binary storage.
abstract  long fetchSize(java.lang.String key)
          Fetch record size.
abstract  byte[] loadBinaryAsByteArray(java.lang.String key)
          Fetch binary data by key from binary storage.
abstract  java.io.InputStream loadBinaryAsInputStream(java.lang.String key)
          Fetch binary data by key from binary storage.
abstract  void storeBinary(java.lang.String key, byte[] content)
          Store binary data in binary storage.
abstract  void storeBinary(java.lang.String key, java.io.InputStream stream)
          Store binary data in binary storage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryPersistence

public BinaryPersistence()
Method Detail

storeBinary

public abstract void storeBinary(java.lang.String key,
                                 java.io.InputStream stream)
                          throws BinaryStorageException
Store binary data in binary storage.

Parameters:
key - String - unique identifier inside of binary storage
stream - InputStream - binary data input stream
Throws:
BinaryStorageException - - in case of any exception occurs

storeBinary

public abstract void storeBinary(java.lang.String key,
                                 byte[] content)
                          throws BinaryStorageException
Store binary data in binary storage.

Parameters:
key - String - unique identifier inside of binary storage
content - byte[] - binary content
Throws:
BinaryStorageException - - in case of any exception occurs

loadBinaryAsByteArray

public abstract byte[] loadBinaryAsByteArray(java.lang.String key)
                                      throws BinaryStorageException
Fetch binary data by key from binary storage.

Parameters:
key - String - unique identifier inside of binary storage
Returns:
byte[] - binary data
Throws:
BinaryStorageException - - in case of any exception occurs

loadBinaryAsInputStream

public abstract java.io.InputStream loadBinaryAsInputStream(java.lang.String key)
                                                     throws BinaryStorageException
Fetch binary data by key from binary storage.

Parameters:
key - String - unique identifier inside of binary storage
Returns:
InputStream - binary input stream
Throws:
BinaryStorageException - - in case of any exception occurs

deleteBinary

public abstract void deleteBinary(java.lang.String key)
                           throws BinaryStorageException
Delete binary data by key from binary storage.

Parameters:
key - String - unique identifier inside of binary storage
Throws:
BinaryStorageException - - in case of any exception occurs

fetchSize

public abstract long fetchSize(java.lang.String key)
                        throws BinaryStorageException
Fetch record size.

Parameters:
key - String - unique identifier inside of binary storage
Returns:
long - size of record
Throws:
BinaryStorageException - - in case of any exception occurs

cleanup

public abstract void cleanup()
                      throws BinaryStorageException
Release resources and performs cleanup actions.

Throws:
BinaryStorageException - in case of any exception

SMILA (incubation) API documentation