org.openrdf.store.blob.disk
Class DiskBlobStore

java.lang.Object
  extended by org.openrdf.store.blob.disk.DiskBlobStore
All Implemented Interfaces:
BlobStore

public class DiskBlobStore
extends Object
implements BlobStore


Constructor Summary
DiskBlobStore(File dir)
           
 
Method Summary
protected  void changed(String version, Collection<String> blobs, File entry, Collection<String> previousVersions)
           
 boolean equals(Object obj)
           
 boolean erase()
          Remove all blobs from all transactions and all the history.
protected  File getDirectory()
           
 String[] getRecentModifications()
          Most recent blobs that have committed modifications.
 int hashCode()
           
protected  void lock()
           
 DiskBlobVersion newVersion()
          Create a new BlobVersion using a generated version ID.
 DiskBlobVersion newVersion(String version)
          Create a new BlobVersion maybe with the given unique ID.
 BlobObject open(String uri)
          Opens a BlobObject for reading or writing.
 DiskBlobVersion openVersion(String version)
          Open a read-only BlobVersion of the blob(s) with this version.
protected  Lock readLock()
           
protected  void removeFromIndex(String erasing)
           
 String toString()
           
protected  void unlock()
           
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

DiskBlobStore

public DiskBlobStore(File dir)
              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

open

public BlobObject open(String uri)
                throws IOException
Description copied from interface: BlobStore
Opens a BlobObject for reading or writing. Any changes to this blob are visible to other blobs of the same uri when a call to the FileObject.delete() returns or a call to the BlobObject.openWriter()'s Writer.close() returns or a call to the FileObject.openOutputStream()'s OutputStream.close() returns.

Specified by:
open in interface BlobStore
Throws:
IOException

newVersion

public DiskBlobVersion newVersion()
                           throws IOException
Description copied from interface: BlobStore
Create a new BlobVersion using a generated version ID.

Specified by:
newVersion in interface BlobStore
Returns:
a new BlobTransaction
Throws:
IOException

newVersion

public DiskBlobVersion newVersion(String version)
                           throws IOException
Description copied from interface: BlobStore
Create a new BlobVersion maybe with the given unique ID. BlobVersion returned from this method using a previously assigned version have undefined consequences.

Specified by:
newVersion in interface BlobStore
Parameters:
version - to uniquely identify new blob versions, this may or may not actually be used
Returns:
a new BlobTransaction
Throws:
IOException

openVersion

public DiskBlobVersion openVersion(String version)
                            throws IOException
Description copied from interface: BlobStore
Open a read-only BlobVersion of the blob(s) with this version. Only blobs with the given version are accessible using the returned BlobVersion.

Specified by:
openVersion in interface BlobStore
Parameters:
version - version of blob to read
Returns:
a closed BlobVersion
Throws:
IOException

getRecentModifications

public String[] getRecentModifications()
                                throws IOException
Description copied from interface: BlobStore
Most recent blobs that have committed modifications. The first identifier in the response is the most recent blob to have been modified. Blobs appear for every recent modification.

Specified by:
getRecentModifications in interface BlobStore
Throws:
IOException

erase

public boolean erase()
              throws IOException
Description copied from interface: BlobStore
Remove all blobs from all transactions and all the history.

Specified by:
erase in interface BlobStore
Returns:
true if the store was successfully deleted.
Throws:
IOException

getDirectory

protected File getDirectory()

watch

protected void watch(String uri,
                     DiskListener listener)

unwatch

protected boolean unwatch(String uri,
                          DiskListener listener)

readLock

protected Lock readLock()

lock

protected void lock()

unlock

protected void unlock()

changed

protected void changed(String version,
                       Collection<String> blobs,
                       File entry,
                       Collection<String> previousVersions)
                throws IOException
Throws:
IOException

removeFromIndex

protected void removeFromIndex(String erasing)
                        throws IOException
Throws:
IOException


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