|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.karmasphere.share.persist.Persistent
com.karmasphere.share.persist.PersistentContainer<T>
public abstract class PersistentContainer<T extends PersistentRecord>
A persistent container.
A container "contains" a set of PersistentRecords
of type T. A container may be uniquely identified on a node
by its type and name.
hashCode() and equals(Object) therefore
consider only the advert type and keyname.
Each container has a version and delta number. Modifications to either the container metadata or the records will cause an increment of the delta number. Periodically, the container will be committed, which causes the version to be incremented and the delta to be reset.
Each record in the container
may be uniquely identified by its container and its
PersistentRecord.getPersistenceKey().
| Constructor Summary | |
|---|---|
PersistentContainer(String keyname,
int version,
int delta)
|
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
|
abstract String |
getAdvertType()
Returns the 'advert type' for this container class. |
int |
getDelta()
Returns the delta number of this container. |
String |
getKeyname()
Returns the keyname of this container. |
int |
getVersion()
Returns the version number of this container. |
int |
hashCode()
|
int |
nextDelta()
Atomically increments the delta number of this container. |
int |
nextVersion()
Atomically increments the version number of this container. |
void |
setDelta(int delta)
Sets the delta number of this container. |
void |
setKeyname(String keyname)
Sets the keyname of this container. |
void |
setVersion(int version)
Sets the version number of this container. |
String |
toString()
Returns a simple String representation of this Persistent. |
protected void |
toStringDetails(StringBuilder buf)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PersistentContainer(String keyname,
int version,
int delta)
| Method Detail |
|---|
public abstract String getAdvertType()
public void setKeyname(String keyname)
getAdvertType(),
getKeyname()public String getKeyname()
getAdvertType(),
setKeyname(String)public void setVersion(int version)
public int getVersion()
public int nextVersion()
public void setDelta(int delta)
public int getDelta()
public int nextDelta()
public int hashCode()
hashCode in class Objectpublic boolean equals(Object o)
equals in class Objectprotected void toStringDetails(StringBuilder buf)
public String toString()
Persistent
toString in class Persistent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||