|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.buildforge.services.common.dbo.DBObject
public abstract class DBObject
Everything that is a persistant object should implement this interface. This class also provides several convenience methods that check for or report common error conditions.
Although there are exceptions, a DBObject generally corresponds to a single row in the Build Forge schema and provides an abstraction for accessing or manipulating it.
Constructor Summary | |
---|---|
DBObject()
|
Method Summary | |
---|---|
APIException |
badId()
Returns an exception indicating that this object has an invalid id. |
APIException |
badName()
Returns an exception indicating that this object has an invalid name. |
void |
checkDead()
Verifies that this object is not live. |
void |
checkLive()
Verifies that this object is live. |
APIException |
collision(java.lang.String field,
int value)
Returns an exception indicating that this object would cause a data collision on the specified field. |
APIException |
collision(java.lang.String field,
java.lang.String value)
Returns an exception indicating that this object would cause a data collision on the specified field. |
abstract DBObject |
fromArray(java.lang.Object[] data)
Deserialize the database object's settings from a request array. |
abstract java.lang.String |
getTypeKey()
Retrieve the key that should be used to look up the display name for a data type. |
abstract boolean |
isLive()
Checks whether or not the object is live. |
abstract java.lang.Object[] |
toArray()
Serializes this database object as an array of objects. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DBObject()
Method Detail |
---|
public abstract java.lang.String getTypeKey()
public abstract boolean isLive()
public final void checkDead() throws APIException
isLive()
. If it is not live, then no action is taken; otherwise,
an exception is thrown.
APIException
- if the object is livepublic final void checkLive() throws APIException
isLive()
. If it is live, then no action is taken; otherwise,
an exception is thrown.
APIException
- if the object is not livepublic final APIException badId()
public final APIException badName()
public final APIException collision(java.lang.String field, java.lang.String value)
field
- the field that would cause the collision (indirect)value
- the value of the field that collides
public final APIException collision(java.lang.String field, int value)
field
- the field that would cause the collision (indirect)value
- the value of the field that collides
public abstract java.lang.Object[] toArray()
Protocol
, all supported
protocols transfer database objects in this form.
public abstract DBObject fromArray(java.lang.Object[] data) throws APIException
toArray()
.
data
- the object list that renders this object
APIException
- if there is something wrong with the
serialized data that interferes with the reconstruction of
the object. The most obvious reason for this would be if
the serialized array contains the wrong number of fields
or otherwise does not match the serialized form for this
type of database object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |