org.openrdf.store.blob
Interface BlobVersion

All Known Implementing Classes:
DiskBlobVersion, FileBlobVersion

public interface BlobVersion

Set of BlobObject modifications that were or will be saved together to this BlobStore.

Author:
James Leigh

Method Summary
 void commit()
          Makes the changes to the open blobs in this BlobVersion available to others.
 boolean erase()
          Reverts all committed changes to blobs from this BlobVersion.
 String[] getModifications()
          Blobs that have been modified in this version.
 BlobObject open(String uri)
          Opens a BlobObject for reading or writing if this BlobVersion has not be committed.
 void prepare()
          Prevents any further changes to the store from other threads until commit() or rollback() is called from this thread.
 void rollback()
          Aborts all uncommitted changes to blobs, restoring the initial state of this BlobVersion.
 

Method Detail

getModifications

String[] getModifications()
                          throws IOException
Blobs that have been modified in this version.

Throws:
IOException

open

BlobObject open(String uri)
                throws IOException,
                       IllegalStateException
Opens a BlobObject for reading or writing if this BlobVersion has not be committed. Opens a read-only BlobObject using this version if this BlobVersion is closed.

Throws:
IllegalStateException - if this BlobVersion has been committed and the blob is not listed in getModifications().
IOException

prepare

void prepare()
             throws IOException
Prevents any further changes to the store from other threads until commit() or rollback() is called from this thread. Checks that the blobs read or written in this BlobVersion were not changed in another BlobVersion since they were opened.

Throws:
IOException - if a blob opened in this BlobVersion had since changed.

commit

void commit()
            throws IOException
Makes the changes to the open blobs in this BlobVersion available to others. This method can only be called at most once for a given BlobVersion; once this method is called this state is closed and only the modified blobs can be opened.

Throws:
IOException - if a blob opened in this BlobVersion had since changed.

rollback

void rollback()
              throws IOException
Aborts all uncommitted changes to blobs, restoring the initial state of this BlobVersion.

Throws:
IOException

erase

boolean erase()
              throws IOException
Reverts all committed changes to blobs from this BlobVersion.

Returns:
true if all blobs of this version were removed successfully.
Throws:
IOException


Copyright © 2004-2011 James Leigh Services Inc.. All Rights Reserved.