|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The Storage interface defines methods to store and retrieve objects fields to and from a media (it could be a database, simples files ...)
Method Summary | |
void |
addToList(OID cid,
long position,
Object value)
Insert a value into an existing List. |
void |
addToList(OID cid,
Object value)
Add a value at the end of a list. |
boolean |
addToSet(OID cid,
Object value)
Add an object to a Set. |
void |
bindOIDToName(OID oid,
String name)
Bind an existing object to a logical name to that it can be found later on. |
void |
clearList(OID cid)
Remove all objects from a list. |
void |
clearMap(OID cid)
Remove all objects from a set. |
void |
clearSet(OID cid)
Remove all objects from a set. |
void |
close()
Closes the storage. |
void |
commit()
Commit started transaction |
OID |
createObject(String className)
Create an object in the storage. |
void |
deleteName(String name)
Delete a name from the storage. |
void |
deleteObject(OID oid)
Delete an object from the storage. |
String |
getClassID(OID oid)
Get the class ID of a given object. |
OID |
getCollectionID(OID oid,
CollectionItem collection)
Get the ID of a collection |
Object |
getField(OID oid,
FieldItem field)
Get the value of a field. |
StorageField[] |
getFields(OID oid,
ClassItem cl,
FieldItem[] fields)
Get the values of several fields. |
Object |
getFromMap(OID cid,
Object key)
Get the value associated to a key from a Map. |
String |
getId()
Returns the id of the storage |
long |
getIndexInList(OID cid,
Object value)
Get the smallest index of an element in a List. |
long |
getLastIndexInList(OID cid,
Object value)
Get the highest index of an element in a List. |
List |
getList(OID cid)
Get a List from the storage. |
List |
getList(OID oid,
CollectionItem collection)
Get a List from the storage. |
Object |
getListItem(OID cid,
long index)
Get an element from a list |
long |
getListSize(OID cid)
Get the number of objects contained in a list |
Map |
getMap(OID cid)
Get the elements of a Map. |
Map |
getMap(OID oid,
CollectionItem collection)
Describe getMap method here. |
long |
getMapSize(OID cid)
Get the number of objects contained in a map |
Map |
getNameCounters()
Gets the name counters used to generate new names. |
String |
getNameFromOID(OID oid)
Get the name of an object from its oid. |
Collection |
getObjects(ClassItem cl)
Get all instances of a class, or all objects if cl == null. |
OID |
getOIDFromName(String name)
Get the ID of an object from its name. |
Collection |
getRootObjects()
Get OIDs of all root objects. |
List |
getSet(OID cid)
Get the elements of a Set. |
List |
getSet(OID oid,
CollectionItem collection)
Get the elements of a Set. |
long |
getSetSize(OID cid)
Get the number of objects contained in a set |
boolean |
listContains(OID cid,
Object value)
Say if a List contains an object. |
boolean |
mapContainsKey(OID cid,
Object key)
Says if a Map contains a key. |
boolean |
mapContainsValue(OID cid,
Object value)
Says if a Map contains a value. |
String |
newName(String className)
Generate a new name for an instance. |
Object |
putInMap(OID cid,
Object key,
Object value)
Put an element in a Map. |
void |
removeField(OID oid,
FieldItem field,
Object value)
Remove a field from an existing object. |
void |
removeFromList(OID cid,
long position)
Remove a value from an existing list. |
void |
removeFromList(OID cid,
Object value)
Remove the first value from an existing list. |
Object |
removeFromMap(OID cid,
Object key)
Remove a key from a Map. |
boolean |
removeFromSet(OID cid,
Object value)
Remove an element from a Set. |
void |
rollback()
Rollback started transaction |
boolean |
setContains(OID cid,
Object value)
Say if a set contains an object. |
void |
setField(OID oid,
FieldItem field,
Object value)
Initialize the value of an object's field. |
void |
setId(String id)
Sets the id of the storage |
void |
setListItem(OID cid,
long index,
Object value)
Set the value of a list element. |
void |
startTransaction()
Starts a transaction |
void |
updateField(OID oid,
FieldItem field,
Object value)
Update a field value. |
void |
updateNameCounters(Map counters)
Sets the name counters used to generate new names. |
Method Detail |
public String getId()
public void setId(String id)
public OID createObject(String className) throws Exception
className
- a String
value
Exception
- if an error occurspublic void deleteObject(OID oid) throws Exception
oid
- the ID of the object to delete
Exception
- if an error occurspublic void setField(OID oid, FieldItem field, Object value) throws Exception
oid
- the ID of the object that will contain the fieldfield
- the field to setvalue
- the value of the field
Exception
- if an error occurspublic void updateField(OID oid, FieldItem field, Object value) throws Exception
oid
- the ID of the object that already contains the fieldfield
- the field to updatevalue
- the new value of the field
Exception
- if an error occurspublic Object getField(OID oid, FieldItem field) throws Exception
oid
- the ID of the object that contains the fieldfield
- the field to retrieve
Exception
- if an error occurspublic StorageField[] getFields(OID oid, ClassItem cl, FieldItem[] fields) throws Exception
oid
- the ID of object to retrievecl
- the class of the objectfields
- the fields to retrieve
Exception
- if an error occurspublic OID getCollectionID(OID oid, CollectionItem collection) throws Exception
oid
- the oid of he object that owns the collectioncollection
- the collection
Exception
- if an error occurspublic List getList(OID oid, CollectionItem collection) throws Exception, IndexOutOfBoundsException
oid
- the ID of the object that contains the vectorcollection
- the collection to retrieve
Exception
- if an error occurs
IndexOutOfBoundsException
public List getList(OID cid) throws Exception
cid
- the ID of the List
Exception
- if an error occurspublic Object getListItem(OID cid, long index) throws Exception
cid
- the ID of the Listindex
- the index of the element
Exception
- if an error occurspublic long getListSize(OID cid) throws Exception
cid
- the ID of the list
Exception
- if an error occurspublic boolean listContains(OID cid, Object value) throws Exception
cid
- the ID of the Listvalue
- the object to look for in the list
Exception
- if an error occurspublic void addToList(OID cid, long position, Object value) throws Exception
cid
- the ID of the Listposition
- the position where to insert the valuevalue
- the value to insert
Exception
- if an error occurspublic void addToList(OID cid, Object value) throws Exception
cid
- the ID of the Listvalue
- the value to add
Exception
- if an error occurspublic void setListItem(OID cid, long index, Object value) throws Exception
cid
- the ID of the Listindex
- the index of the element to setvalue
- the value
Exception
- if an error occurspublic void removeFromList(OID cid, long position) throws Exception
cid
- the ID the Listposition
- the position of the element to remove
Exception
- if an error occurspublic void removeFromList(OID cid, Object value) throws Exception
cid
- the ID the Listvalue
- the value to remove
Exception
- if an error occurspublic void clearList(OID cid) throws Exception
cid
- the ID of the list to clear
Exception
- if an error occurspublic long getIndexInList(OID cid, Object value) throws Exception
cid
- the ID of the Listvalue
- the value
Exception
- if an error occurspublic long getLastIndexInList(OID cid, Object value) throws Exception
cid
- the ID of the Listvalue
- the value
Exception
- if an error occurspublic List getSet(OID oid, CollectionItem collection) throws Exception
oid
- the ID of the object that contains the Setcollection
- the collection
Exception
- if an error occurspublic List getSet(OID cid) throws Exception
cid
- the ID of the Set
Exception
- if an error occurspublic long getSetSize(OID cid) throws Exception
cid
- the ID of the list
Exception
- if an error occurspublic boolean addToSet(OID cid, Object value) throws Exception
cid
- the ID of the Setvalue
- the value to add
Exception
- if an error occurspublic boolean removeFromSet(OID cid, Object value) throws Exception
cid
- the ID of the Setvalue
- the value to add
Exception
- if an error occurspublic void clearSet(OID cid) throws Exception
cid
- the ID of the set to clear
Exception
- if an error occurspublic boolean setContains(OID cid, Object value) throws Exception
cid
- the ID of the Setvalue
- the value
Exception
- if an error occurspublic Map getMap(OID oid, CollectionItem collection) throws Exception
getMap
method here.
oid
- an OID
valuecollection
- a CollectionItem
value
Map
value
Exception
- if an error occurspublic Map getMap(OID cid) throws Exception
cid
- the ID of the Set
Exception
- if an error occurspublic long getMapSize(OID cid) throws Exception
cid
- the ID of the list
Exception
- if an error occurspublic Object putInMap(OID cid, Object key, Object value) throws Exception
cid
- the ID of the Mapkey
- the keyvalue
- the value
Exception
- if an error occurspublic Object getFromMap(OID cid, Object key) throws Exception
cid
- the ID of the Mapkey
- the key
Exception
- if an error occurspublic boolean mapContainsKey(OID cid, Object key) throws Exception
cid
- the ID of the Mapkey
- the key to search
Exception
- if an error occurspublic boolean mapContainsValue(OID cid, Object value) throws Exception
cid
- the ID of the Mapvalue
- the value to search
Exception
- if an error occurspublic Object removeFromMap(OID cid, Object key) throws Exception
cid
- the ID the Mapkey
- the key to remove
Exception
- if an error occurspublic void clearMap(OID cid) throws Exception
cid
- the ID of the set to clear
Exception
- if an error occurspublic void removeField(OID oid, FieldItem field, Object value) throws Exception
oid
- the ID of the object that contains the fieldfield
- the ID of the field to removevalue
- Deprecated
Exception
public String newName(String className) throws Exception
className
- the className of the instance for which to generate a name
Exception
public Map getNameCounters() throws Exception
Exception
updateNameCounters(Map)
public void updateNameCounters(Map counters) throws Exception
counters
- a Map associating counter names to a Long
value. The value is the next value to be used. A counter is
updated only if the suplied value is greater than the current
value.
Exception
getNameCounters()
public OID getOIDFromName(String name) throws Exception
name
- the candidate object name
Exception
public String getNameFromOID(OID oid) throws Exception
oid
- the candidate object oid
Exception
public void bindOIDToName(OID oid, String name) throws Exception
This method allows the user to create persistence roots.
oid
- an existing object IDname
- the name that is given to it
Exception
public void deleteName(String name) throws Exception
name
- the name to remove
Exception
public String getClassID(OID oid) throws Exception
oid
- the object's class ID
Exception
- if an error occurspublic Collection getRootObjects() throws Exception
Exception
- if an error occurspublic Collection getObjects(ClassItem cl) throws Exception
cl
- the class
Exception
public void close()
public void startTransaction() throws Exception
Exception
public void commit() throws Exception
Exception
public void rollback() throws Exception
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |