Class OctObject

Class OctObject

java.lang.Object
   |
   +----PersistentObject
           |
           +----OctObject

public class OctObject
extends PersistentObject

Variable Index

 o className
The Name of the Class that inherits OctObject
 o containers
Vector which contains all object that are attached as containers
 o contents
Vector which contains all object that are attached as contents
 o dirty
Determines whether the object requires saving
 o externalId
ID generated by the program during dynamic construction
 o objectId
Unique object Id generated by the data server after a Save()
 o octCell
 o octFields
Number of fields in the OctObject

Constructor Index

 o OctObject()
Constructor of an OctObject Initializes internal data structures Never gets called explicitly

Method Index

 o AddAttachTo(OctObject)
Add the obj to the containers Vector Should only be called internally or by the system
 o Attach(OctObject)
Add the obj to the contents Vector Returns OCT.OK
 o 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
 o DEBUG(String)
Prints the Debug "message" if the debugFlag is set to true
 o Delete()
Delete Removes all references of the OctObject in the system (The object is not explicitly deleted (i.e.
 o DeleteCommit()
Committing a Delete, so that the information gets transferred back to the data server.
 o 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.
 o DetachCommit(OctObject)
Committing a Detach, so that the information gets transferred back to the data server.
 o DetachFrom(OctObject)
Detach the container's (cnt) content's instance of this object
 o getExternalId()
Returns the externalId of the OctObject (for identification purposes)
 o GetField(int, Object, int)
Gets the nth member of the children
 o GetObjId()
Returns the objectId of the OctObject (for identification purposes)
 o 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.
 o InitGenContents()
Loads (all) the contents of the Octobject from data backend if they are not already loaded.
 o InstancePolicy(PersistentObject)
Policy that have to be observed when instantiating an object
 o isAttached(OctObject)
Checks to see whether the obj is attached to the current OctObject Returns OCT.OK if so, OCT.NOT_ATTACHED otherwise
 o OctError(String)
Prints Error messages
 o OctGetField(int)
Performs post-load operations (such as set dirty flag to false)
 o OctIdsEqual(int)
Compares the objectId of the (persistent) OctObjects
 o 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
 o OctSetField(int)
Performs additional overhead for objects that inherits OctObjects since 3 fields (containers, contents, objectId) are implicitly declared in the parent (OctObject) class
 o PostLoadPolicy(Object)
Policies that has be followed after the loading of OctObjects
 o PostSavePolicy(Object)
Policies that has be followed after the saving of OctObjects
 o SavePolicy(Object)
Policies that should be followed and confirmed before the saving of OctObjects
 o SetId()
Sets the objectId field to unique id return by data server
 o SetNewCell(OctCell)
Sets the object's cell environment to a new one

Variables

 o className
  public String className
The Name of the Class that inherits OctObject
 o objectId
  protected int objectId
Unique object Id generated by the data server after a Save()
 o octFields
  protected int octFields
Number of fields in the OctObject
 o containers
  protected Vector containers
Vector which contains all object that are attached as containers
 o contents
  protected Vector contents
Vector which contains all object that are attached as contents
 o externalId
  public long externalId
ID generated by the program during dynamic construction
 o dirty
  public boolean dirty
Determines whether the object requires saving
 o octCell
  public OctCell octCell

Constructors

 o OctObject
  public OctObject()
Constructor of an OctObject Initializes internal data structures Never gets called explicitly

Methods

 o Attach
  public int Attach(OctObject obj)
Add the obj to the contents Vector Returns OCT.OK
Parameters:
obj - OctObject to be added
 o 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
 o 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
 o 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
 o DetachFrom
  public void DetachFrom(OctObject cnt)
Detach the container's (cnt) content's instance of this object
Parameters:
cnt - The container to delete from
 o Delete
  public void Delete()
Delete Removes all references of the OctObject in the system (The object is not explicitly deleted (i.e. space freed))
 o 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
 o 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
 o 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
 o InitGenContents
  public int InitGenContents()
Loads (all) the contents of the Octobject from data backend if they are not already loaded.
 o 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.
 o 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
 o 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
 o getExternalId
  public long getExternalId()
Returns the externalId of the OctObject (for identification purposes)
 o GetObjId
  public int GetObjId()
Returns the objectId of the OctObject (for identification purposes)
 o OctIdsEqual
  public boolean OctIdsEqual(int id)
Compares the objectId of the (persistent) OctObjects
 o OctError
  protected void OctError(String message)
Prints Error messages
 o DEBUG
  protected void DEBUG(String message)
Prints the Debug "message" if the debugFlag is set to true
Overrides:
DEBUG in class PersistentObject
 o 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
 o 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
 o OctGetField
  protected void OctGetField(int octFields)
Performs post-load operations (such as set dirty flag to false)
 o SavePolicy
  protected int SavePolicy(Object obj)
Policies that should be followed and confirmed before the saving of OctObjects
Overrides:
SavePolicy in class PersistentObject
 o PostSavePolicy
  protected void PostSavePolicy(Object obj)
Policies that has be followed after the saving of OctObjects
Overrides:
PostSavePolicy in class PersistentObject
 o PostLoadPolicy
  protected void PostLoadPolicy(Object obj)
Policies that has be followed after the loading of OctObjects
Overrides:
PostLoadPolicy in class PersistentObject
 o SetNewCell
  protected void SetNewCell(OctCell cell)
Sets the object's cell environment to a new one
 o SetId
  protected void SetId()
Sets the objectId field to unique id return by data server