Class OctObject
Class OctObject
java.lang.Object
|
+----PersistentObject
|
+----OctObject
- public class OctObject
- extends PersistentObject
-
className
-
The Name of the Class that inherits OctObject
-
containers
- Vector which contains all object that are attached as containers
-
contents
- Vector which contains all object that are attached as contents
-
dirty
- Determines whether the object requires saving
-
externalId
- ID generated by the program during dynamic construction
-
objectId
- Unique object Id generated by the data server after a Save()
-
octCell
-
-
octFields
- Number of fields in the OctObject
-
OctObject()
-
Constructor of an OctObject
Initializes internal data structures
Never gets called explicitly
-
AddAttachTo(OctObject)
- Add the obj to the containers Vector
Should only be called internally or by the system
-
Attach(OctObject)
- Add the obj to the contents Vector
Returns OCT.OK
-
AttachOnce(OctObject)
- Attached the obj to the current object only if it's not already attached
Return OCT.OK is operation is completed successfully,
OCT.ALREADY_ATTACHED otherwise
-
DEBUG(String)
- Prints the Debug "message" if the debugFlag is set to true
-
Delete()
-
Delete
Removes all references of the OctObject in the system
(The object is not explicitly deleted (i.e.
-
DeleteCommit()
-
Committing a Delete, so that the information gets transferred back
to the data server.
-
Detach(OctObject)
-
Detach
Policy:
User can/should only Detach OctObjects that are not Persistent
For detaching already Persistent OctObjects, DetachCommit must be called
so that the information gets transferred back to the data server.
-
DetachCommit(OctObject)
-
Committing a Detach, so that the information gets transferred back
to the data server.
-
DetachFrom(OctObject)
-
Detach the container's (cnt) content's instance of this object
-
getExternalId()
- Returns the externalId of the OctObject (for identification purposes)
-
GetField(int, Object, int)
- Gets the nth member of the children
-
GetObjId()
- Returns the objectId of the OctObject (for identification purposes)
-
InitGenContainers()
- Returns a Vector with the all containers with type "mask"
Load (all) the containers of the Octobject from data backend if
they are not already in memory.
-
InitGenContents()
- Loads (all) the contents of the Octobject from data backend if
they are not already loaded.
-
InstancePolicy(PersistentObject)
- Policy that have to be observed when instantiating an object
-
isAttached(OctObject)
-
Checks to see whether the obj is attached to the current OctObject
Returns OCT.OK if so, OCT.NOT_ATTACHED otherwise
-
OctError(String)
- Prints Error messages
-
OctGetField(int)
- Performs post-load operations (such as set dirty flag to false)
-
OctIdsEqual(int)
- Compares the objectId of the (persistent) OctObjects
-
OctObjSetup(int, int, String)
- Performs additional overhead for objects that inherits OctObjects
since 3 fields (containers, contents, objectId) are implicitly
declared in the parent (OctObject) class
-
OctSetField(int)
- Performs additional overhead for objects that inherits OctObjects
since 3 fields (containers, contents, objectId) are implicitly
declared in the parent (OctObject) class
-
PostLoadPolicy(Object)
- Policies that has be followed after the loading of OctObjects
-
PostSavePolicy(Object)
- Policies that has be followed after the saving of OctObjects
-
SavePolicy(Object)
- Policies that should be followed and confirmed before the
saving of OctObjects
-
SetId()
- Sets the objectId field to unique id return by data server
-
SetNewCell(OctCell)
- Sets the object's cell environment to a new one
className
public String className
- The Name of the Class that inherits OctObject
objectId
protected int objectId
- Unique object Id generated by the data server after a Save()
octFields
protected int octFields
- Number of fields in the OctObject
containers
protected Vector containers
- Vector which contains all object that are attached as containers
contents
protected Vector contents
- Vector which contains all object that are attached as contents
externalId
public long externalId
- ID generated by the program during dynamic construction
dirty
public boolean dirty
- Determines whether the object requires saving
octCell
public OctCell octCell
OctObject
public OctObject()
- Constructor of an OctObject
Initializes internal data structures
Never gets called explicitly
Attach
public int Attach(OctObject obj)
- Add the obj to the contents Vector
Returns OCT.OK
- Parameters:
- obj - OctObject to be added
AddAttachTo
public void AddAttachTo(OctObject oObj)
- Add the obj to the containers Vector
Should only be called internally or by the system
- Parameters:
- oObj - OctObject to be added
AttachOnce
public int AttachOnce(OctObject obj)
- Attached the obj to the current object only if it's not already attached
Return OCT.OK is operation is completed successfully,
OCT.ALREADY_ATTACHED otherwise
- Parameters:
- obj - The object to check whether it's attached
isAttached
public int isAttached(OctObject obj)
- Checks to see whether the obj is attached to the current OctObject
Returns OCT.OK if so, OCT.NOT_ATTACHED otherwise
- Parameters:
- cnt - The container to delete from
DetachFrom
public void DetachFrom(OctObject cnt)
- Detach the container's (cnt) content's instance of this object
- Parameters:
- cnt - The container to delete from
Delete
public void Delete()
- Delete
Removes all references of the OctObject in the system
(The object is not explicitly deleted (i.e. space freed))
DeleteCommit
public void DeleteCommit()
- Committing a Delete, so that the information gets transferred back
to the data server. Both local and persistent data is updated
- Parameters:
- obj - obj to commit the Delete
Detach
public int Detach(OctObject obj)
- Detach
Policy:
User can/should only Detach OctObjects that are not Persistent
For detaching already Persistent OctObjects, DetachCommit must be called
so that the information gets transferred back to the data server.
- Parameters:
- obj - object to Detach
DetachCommit
public int DetachCommit(OctObject obj)
- Committing a Detach, so that the information gets transferred back
to the data server. Both local and persistent data is updated
- Parameters:
- obj - obj to commit the Detach
InitGenContents
public int InitGenContents()
- Loads (all) the contents of the Octobject from data backend if
they are not already loaded.
InitGenContainers
public int InitGenContainers()
- Returns a Vector with the all containers with type "mask"
Load (all) the containers of the Octobject from data backend if
they are not already in memory.
GetField
protected Object GetField(int nthField,
Object indicator,
int nthObject)
- Gets the nth member of the children
- Parameters:
- nthField - The position of the field in the object
- indicator - OBJECT_INDICATOR (should be passed in)
- nthObject - The position within object fields
- Overrides:
- GetField in class PersistentObject
InstancePolicy
public void InstancePolicy(PersistentObject pObj)
- Policy that have to be observed when instantiating an object
- Parameters:
- pObj - The Persistent object to be processed
- Overrides:
- InstancePolicy in class PersistentObject
getExternalId
public long getExternalId()
- Returns the externalId of the OctObject (for identification purposes)
GetObjId
public int GetObjId()
- Returns the objectId of the OctObject (for identification purposes)
OctIdsEqual
public boolean OctIdsEqual(int id)
- Compares the objectId of the (persistent) OctObjects
OctError
protected void OctError(String message)
- Prints Error messages
DEBUG
protected void DEBUG(String message)
- Prints the Debug "message" if the debugFlag is set to true
- Overrides:
- DEBUG in class PersistentObject
OctObjSetup
protected void OctObjSetup(int port,
int octFields,
String className)
- Performs additional overhead for objects that inherits OctObjects
since 3 fields (containers, contents, objectId) are implicitly
declared in the parent (OctObject) class
- Parameters:
- port - Port number of the server for network operations
- octFields - Number of fields of the child OctObject
- className - Class name of the child OctObject
OctSetField
protected void OctSetField(int octFields)
- Performs additional overhead for objects that inherits OctObjects
since 3 fields (containers, contents, objectId) are implicitly
declared in the parent (OctObject) class
OctGetField
protected void OctGetField(int octFields)
- Performs post-load operations (such as set dirty flag to false)
SavePolicy
protected int SavePolicy(Object obj)
- Policies that should be followed and confirmed before the
saving of OctObjects
- Overrides:
- SavePolicy in class PersistentObject
PostSavePolicy
protected void PostSavePolicy(Object obj)
- Policies that has be followed after the saving of OctObjects
- Overrides:
- PostSavePolicy in class PersistentObject
PostLoadPolicy
protected void PostLoadPolicy(Object obj)
- Policies that has be followed after the loading of OctObjects
- Overrides:
- PostLoadPolicy in class PersistentObject
SetNewCell
protected void SetNewCell(OctCell cell)
- Sets the object's cell environment to a new one
SetId
protected void SetId()
- Sets the objectId field to unique id return by data server