Package com.oss.asn1

Interface ObjectStorage<T>

Type Parameters:
T - type of objects in this object storage.
All Superinterfaces:
Serializable, Storage
All Known Implementing Classes:
OSSObjectStorage

public interface ObjectStorage<T> extends Storage
The ObjectStorage interface extends the Storage interface to include additional methods for accessing and modifying the contents, that is an array of Objects.
Since:
ASN.1/Java 1.4 beta A
  • Method Details

    • getReader

      ObjectReader<T> getReader() throws StorageException
      Get the ObjectReader to read individual objects from the the storage. Your implementation is responsible for preventing concurrent read and write accesses to the contents. When the read access is not permitted for some reason (say, when the canRead() returns false), a StorageException is thrown.
      Returns:
      the instance of ObjectReader to read the contents of the storage.
      Throws:
      StorageException - if the contents of the storage is not readable.
    • getWriter

      ObjectWriter<T> getWriter(boolean append) throws StorageException
      Get the ObjectWriter to modify the contents of the storage. Your implementation is responsible for preventing concurrent read and write accesses to the contents. When the append parameter is false, the current contents of the storage is reset. Otherwise, the objects that are written to the ObjectWriter, are appended at the end of the existing value. If the write access is not permitted for some reason (say, when the canWrite() returns false), a StorageException is thrown.
      Parameters:
      append - false when overwriting the existing value, true when appending to the existing value.
      Returns:
      the instance of the ObjectWriter to write the contents of the storage.
      Throws:
      StorageException - if the contents of the storage is not writable.