|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeStorage
This class implements Storage using Btree files. Almost all implementation is in BtreeDatabase, which see.
Nested Class Summary |
Nested classes inherited from class org.netbeans.mdr.persistence.Storage |
Storage.EntryType |
Constructor Summary | |
BtreeStorage(java.lang.String name)
Create a BtreeStorage object. |
Method Summary | |
void |
close()
close the btree repository. |
void |
commitChanges()
Save all objects changed since this method was last call. |
void |
create(boolean replace,
ObjectResolver resolver)
Create btree repository |
MultivaluedIndex |
createMultivaluedIndex(java.lang.String name,
Storage.EntryType keyType,
Storage.EntryType valueType,
boolean unique)
Create index that hold a set of values for each key. |
MultivaluedOrderedIndex |
createMultivaluedOrderedIndex(java.lang.String name,
Storage.EntryType keyType,
Storage.EntryType valueType,
boolean unique)
Create index that holds sorted set of values for each key. |
SinglevaluedIndex |
createSinglevaluedIndex(java.lang.String name,
Storage.EntryType keyType,
Storage.EntryType valueType)
Create index that holds exactly one value for each key. |
boolean |
delete()
delete the btree repository. |
void |
dropIndex(java.lang.String name)
Delete index. |
boolean |
exists()
determine if the btree currently exists |
Index |
getIndex(java.lang.String name)
Retrieve index by name. |
byte[] |
getMOFIDData(MOFID mofid)
|
MofidGenerator |
getMofidGenerator()
Return the MOFID generator for this repository |
java.util.Map |
getMofidMap()
Return the map of MOFID UUIDs we know about |
MultivaluedIndex |
getMultivaluedIndex(java.lang.String name)
Retrieve index by name. |
MultivaluedOrderedIndex |
getMultivaluedOrderedIndex(java.lang.String name)
Retrieve index by name. |
java.lang.String |
getName()
Return our name |
SinglevaluedIndex |
getPrimaryIndex()
Return the primary index (the BtreeDatabase) |
long |
getSerialNumber()
|
SinglevaluedIndex |
getSinglevaluedIndex(java.lang.String name)
Retrieve index by name. |
java.lang.String |
getStorageId()
Returns storage id |
java.lang.String |
numberToStorageId(int number)
Resolves external storage number coded by an integer. |
void |
objectStateChanged(java.lang.Object key)
Notify the Storage that state of the object was changed. |
void |
objectStateWillChange(java.lang.Object key)
Notify the Storage that state of the object will be changed. |
void |
open(boolean createIfNoExist,
ObjectResolver resolver)
Open a btree MDR |
MOFID |
readMOFID(java.io.InputStream inputStream)
Reads a MOFID from Storage, must be called in the streamable read context. |
MOFID |
readMOFIDData(java.io.InputStream in)
|
java.lang.Object |
resolveObject(MOFID key)
Delegates resolving of external mof ids on the object resolver. |
void |
rollBackChanges()
Discard all changes since commitChanges() method was last called. |
void |
shutDown()
Shutdowns btree databes (i.e. |
int |
storageIdToNumber(java.lang.String storageId)
Maps an external storage prefix to integer. |
boolean |
supportsMultipleStorableIndexes()
Returns true if the storage supports more than one index with type Entrytype.STREAMABLE |
void |
writeMOFID(java.io.OutputStream outputStream,
MOFID mofId)
Writes a MOFID into Storage, must be called in the streamable write context. |
void |
writeMOFIDData(java.io.OutputStream out,
MOFID mofid)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BtreeStorage(java.lang.String name)
name
- the name of the btree. This will be the base name
for the btree filesMethod Detail |
public java.lang.String getName()
getName
in interface Storage
public java.lang.String getStorageId()
getStorageId
in interface Storage
public long getSerialNumber()
getSerialNumber
in interface Storage
public boolean exists()
exists
in interface Storage
public boolean delete() throws StorageException
delete
in interface Storage
StorageException
public void create(boolean replace, ObjectResolver resolver) throws StorageException
create
in interface Storage
replace
- whether to replace an existing repository
StorageException
- on any error creating the repositorypublic void open(boolean createIfNoExist, ObjectResolver resolver) throws StorageException
open
in interface Storage
createIfNoExist
- whether to create the repository if it
doesn't exist
StorageException
- on any error opening or creating
the repositorypublic void close() throws StorageException
close
in interface Storage
StorageException
public SinglevaluedIndex getPrimaryIndex() throws StorageException
getPrimaryIndex
in interface Storage
StorageException
public SinglevaluedIndex createSinglevaluedIndex(java.lang.String name, Storage.EntryType keyType, Storage.EntryType valueType) throws StorageException
createSinglevaluedIndex
in interface Storage
name
- name of the indexkeyType
- type of keys in the indexvalueType
- type of values in the index
StorageException
public MultivaluedOrderedIndex createMultivaluedOrderedIndex(java.lang.String name, Storage.EntryType keyType, Storage.EntryType valueType, boolean unique) throws StorageException
createMultivaluedOrderedIndex
in interface Storage
name
- name of the indexkeyType
- type of keys in the indexvalueType
- type of values in the indexunique
- true if values associated with one key do not contain duplicates
StorageException
public MultivaluedIndex createMultivaluedIndex(java.lang.String name, Storage.EntryType keyType, Storage.EntryType valueType, boolean unique) throws StorageException
createMultivaluedIndex
in interface Storage
name
- name of the indexkeyType
- type of keys in the indexvalueType
- type of values in the indexunique
- true if values associated with one key do not contain duplicates
StorageException
public Index getIndex(java.lang.String name) throws StorageException
getIndex
in interface Storage
name
- name of the index
StorageException
public SinglevaluedIndex getSinglevaluedIndex(java.lang.String name) throws StorageException
getSinglevaluedIndex
in interface Storage
name
- name of the index
StorageException
public MultivaluedIndex getMultivaluedIndex(java.lang.String name) throws StorageException
getMultivaluedIndex
in interface Storage
name
- name of the index
StorageException
public MultivaluedOrderedIndex getMultivaluedOrderedIndex(java.lang.String name) throws StorageException
getMultivaluedOrderedIndex
in interface Storage
name
- name of the index
StorageException
public void dropIndex(java.lang.String name) throws StorageException
dropIndex
in interface Storage
name
- name of the index
StorageException
public void objectStateWillChange(java.lang.Object key) throws StorageException
objectStateWillChange
in interface Storage
key
- key of object that will be changed
StorageException
public void objectStateChanged(java.lang.Object key) throws StorageException
objectStateChanged
in interface Storage
key
- key of object that was changed
StorageException
public void commitChanges() throws StorageException
commitChanges
in interface Storage
StorageException
public void rollBackChanges() throws StorageException
rollBackChanges
in interface Storage
StorageException
public void shutDown() throws StorageException
shutDown
in interface Storage
StorageException
public boolean supportsMultipleStorableIndexes()
Entrytype.STREAMABLE
Entrytype.STREAMABLE
public void writeMOFID(java.io.OutputStream outputStream, MOFID mofId) throws StorageException
Storage
writeMOFID
in interface Storage
StorageException
public final void writeMOFIDData(java.io.OutputStream out, MOFID mofid) throws StorageException
StorageException
public final byte[] getMOFIDData(MOFID mofid) throws StorageException
StorageException
public MOFID readMOFID(java.io.InputStream inputStream) throws StorageException
Storage
readMOFID
in interface Storage
StorageException
public final MOFID readMOFIDData(java.io.InputStream in) throws StorageException
StorageException
public MofidGenerator getMofidGenerator()
public java.util.Map getMofidMap()
public int storageIdToNumber(java.lang.String storageId) throws StorageException
StorageException
public java.lang.String numberToStorageId(int number) throws StorageException
StorageException
public java.lang.Object resolveObject(MOFID key) throws StorageException
StorageException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |