|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.obsearch.ambient.AbstractAmbient<O,I>
I
- The index that we want to create with this ambient.public abstract class AbstractAmbient<O extends OB,I extends Index<O>>
An Ambient is the class that surrounds the index, its metadata and the storage devices. It helps to serialize the index and put the serialized data in an appropiate location. This is how you use an ambient: 1) Create the Index you want to use. 2) Create the Ambient that holds the storage device you want to use and pass the Index to it. 3) Forget about the Ambient, when you want to freeze the index, use the Ambient to freeze the index so that metadata is stored properly. 4) When you have closed the index and you want to use it back again, call the ambient and it will de-serialize the index and leave it ready for you to use it. Sub-classes of this class, create ambients for different storage devices.
Field Summary | |
---|---|
protected OBStoreFactory |
fact
Factory that creates storage devices for the index. |
Fields inherited from interface net.obsearch.ambient.Ambient |
---|
METADATA_FILENAME |
Constructor Summary | |
---|---|
protected |
AbstractAmbient(File directory)
Constructor to be used after a freeze took place. |
protected |
AbstractAmbient(I index,
File directory)
|
Method Summary | |
---|---|
void |
close()
Close all the internally used resources. |
protected abstract OBStoreFactory |
createFactory(File factoryDirectory)
Creates the factory in the given folder. |
void |
freeze()
Freezes the index and stores the metadata of the index (the index itself) in the DB. |
OBStoreFactory |
getFactory()
Returns the factory (if the user wants to create some storages for personal use). |
I |
getIndex()
Returns the index. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected OBStoreFactory fact
Constructor Detail |
---|
protected AbstractAmbient(I index, File directory) throws AlreadyFrozenException, FileNotFoundException, OBStorageException, NotFrozenException, IllegalAccessException, InstantiationException, OBException, IOException
index
- An index whose isFrozen() == false.directory
- The directory in which everything will be stored.
AlreadyFrozenException
- if the given index is already frozen.
FileNotFoundException
OBStorageException
NotFrozenException
IllegalAccessException
InstantiationException
OBException
IOException
protected AbstractAmbient(File directory) throws FileNotFoundException, OBStorageException, NotFrozenException, IllegalAccessException, InstantiationException, OBException, IOException
directory
- We will load the database from here.
FileNotFoundException
- if no metadata is found
OBStorageException
NotFrozenException
IllegalAccessException
InstantiationException
OBException
IOException
Method Detail |
---|
public void close() throws OBException
Ambient
close
in interface Ambient<O extends OB,I extends Index<O>>
OBException
public I getIndex()
Ambient
getIndex
in interface Ambient<O extends OB,I extends Index<O>>
public void freeze() throws IOException, AlreadyFrozenException, IllegalIdException, IllegalAccessException, InstantiationException, OBStorageException, OutOfRangeException, OBException, PivotsUnavailableException
Ambient
freeze
in interface Ambient<O extends OB,I extends Index<O>>
PivotsUnavailableException
IOException
AlreadyFrozenException
IllegalIdException
IllegalAccessException
InstantiationException
OBStorageException
OutOfRangeException
OBException
Index.freeze()
protected abstract OBStoreFactory createFactory(File factoryDirectory) throws OBStorageException
factoryDirectory
- The location where the factory will work.
OBStorageException
- if something goes wrong with the DB.public OBStoreFactory getFactory()
Ambient
getFactory
in interface Ambient<O extends OB,I extends Index<O>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |