org.openrdf.store.blob.disk
Class DiskBlobVersion

java.lang.Object
  extended by org.openrdf.store.blob.disk.DiskBlobVersion
All Implemented Interfaces:
BlobVersion

public class DiskBlobVersion
extends Object
implements BlobVersion


Constructor Summary
protected DiskBlobVersion(DiskBlobStore store, String version, File file)
           
 
Method Summary
protected  void addOpenBlobs(Collection<String> set)
           
 void commit()
          Makes the changes to the open blobs in this BlobVersion available to others.
 boolean equals(Object obj)
           
 boolean erase()
          Reverts all committed changes to blobs from this BlobVersion.
protected  File getDirectory()
           
 String[] getModifications()
          Blobs that have been modified in this version.
protected  String getVersion()
           
 int hashCode()
           
protected  boolean isClosed()
           
protected  boolean isObsolete()
           
 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 BlobVersion.commit() or BlobVersion.rollback() is called from this thread.
protected  Lock readLock()
           
 void rollback()
          Aborts all uncommitted changes to blobs, restoring the initial state of this BlobVersion.
 String toString()
           
protected  boolean unwatch(String uri, DiskListener listener)
           
protected  void watch(String uri, DiskListener listener)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiskBlobVersion

protected DiskBlobVersion(DiskBlobStore store,
                          String version,
                          File file)
                   throws IOException
Throws:
IOException
Method Detail

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getModifications

public String[] getModifications()
                          throws IOException
Description copied from interface: BlobVersion
Blobs that have been modified in this version.

Specified by:
getModifications in interface BlobVersion
Throws:
IOException

open

public BlobObject open(String uri)
Description copied from interface: BlobVersion
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.

Specified by:
open in interface BlobVersion

prepare

public void prepare()
             throws IOException
Description copied from interface: BlobVersion
Prevents any further changes to the store from other threads until BlobVersion.commit() or BlobVersion.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.

Specified by:
prepare in interface BlobVersion
Throws:
IOException - if a blob opened in this BlobVersion had since changed.

commit

public void commit()
            throws IOException
Description copied from interface: BlobVersion
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.

Specified by:
commit in interface BlobVersion
Throws:
IOException - if a blob opened in this BlobVersion had since changed.

rollback

public void rollback()
Description copied from interface: BlobVersion
Aborts all uncommitted changes to blobs, restoring the initial state of this BlobVersion.

Specified by:
rollback in interface BlobVersion

erase

public boolean erase()
              throws IOException
Description copied from interface: BlobVersion
Reverts all committed changes to blobs from this BlobVersion.

Specified by:
erase in interface BlobVersion
Returns:
true if all blobs of this version were removed successfully.
Throws:
IOException

isClosed

protected boolean isClosed()

addOpenBlobs

protected void addOpenBlobs(Collection<String> set)

isObsolete

protected boolean isObsolete()
                      throws IOException
Throws:
IOException

getDirectory

protected File getDirectory()

getVersion

protected String getVersion()

watch

protected void watch(String uri,
                     DiskListener listener)

unwatch

protected boolean unwatch(String uri,
                          DiskListener listener)

readLock

protected Lock readLock()


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