Class OctCell

Class OctCell

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

public class OctCell
extends OctObject

Variable Index

 o className
Class Name
 o elements
Keeps track of all OctObjects in the present environment
 o octFields
Number of fields

Constructor Index

 o OctCell(String)
Constructor of an OctCell (for loading from data back-end server)
 o OctCell(String, int)
Constructor of an OctCell (for loading from data back-end server)
 o OctCell(String, String, String)
Constructor of an OctCell (for dynamic creation).

Method Index

 o AddElement(OctObject)
Adds an entry of the OctObject to the Vector of elements in the current OctCell
 o Debug(String)
Prints out debugging message if the debugFlag is set to true
 o DelElement(OctObject)
Deletes the entry of the OctObject from the Vector of elements in the current OctCell
 o End()
Called when end of operations is reached.
 o GetById(int)
Returns OctObject with the ObjectId intId.
 o GetName()
Returns the name of the OctCell
 o GetObjFields()
Does not require filling since the object has no object fields
 o IsDirty(OctObject)
Checks the dirty flag
 o Load(int)
Should never be called
 o Load(String)
Loads the fields of an OctCell from data back-end
 o ObjInCell(int)
Returns true if the OctObject with the ObjectId intId is in memory (indicated by its OctCell)
 o Policy(OctObject, OctObject)
This is the method that verifies that any (Oct) Policy that the devloper states is passed.
 o SetClean(OctObject)
Sets the dirty flag to false (for use after a Save)
 o SetDirty(OctObject)
SetDirty sets the dirty bit of the OctObject passed in and also sets the dirty bit of all its parents Design Decision: when we save, we traverse/propogate down the children side and save all the dependents, but not parents/ancestors as cyclic relationships immediately arise even with the setting and checking of dirty bit, saving both children and parents seem like an undesirable choice (though Mark mentioned that the user can set flag and let the the user decide)
 o SetObjFields()
Performs the neccessary overhead to allow this object to be manipulated over the network
 o SetPermission(String)
Sets the permission of the OctCell

Variables

 o className
  public final static String className
Class Name
 o octFields
  public final static int octFields
Number of fields
 o elements
  public Vector elements
Keeps track of all OctObjects in the present environment

Constructors

 o OctCell
  public OctCell(String name,
                 String password,
                 String permission)
Constructor of an OctCell (for dynamic creation). The name of password parameters of an OctCell cannot be changed after the instantiation of the OctCell.
Parameters:
name - The name of the OctCell
password - The password of OctCell
permission - The permission of OctCell "W" for write, "R" for read-only
 o OctCell
  public OctCell(String name,
                 int port)
Constructor of an OctCell (for loading from data back-end server)
Parameters:
port - Port number of remote server
 o OctCell
  public OctCell(String name)
Constructor of an OctCell (for loading from data back-end server)

Methods

 o SetObjFields
  protected void SetObjFields()
Performs the neccessary overhead to allow this object to be manipulated over the network
Overrides:
SetObjFields in class PersistentObject
 o Load
  public boolean Load(String strId)
Loads the fields of an OctCell from data back-end
Parameters:
objectId - The String Id for the object
intId - The integer (unique) Id for the object
Overrides:
Load in class PersistentObject
 o Load
  public boolean Load(int intId)
Should never be called
Overrides:
Load in class PersistentObject
 o GetObjFields
  protected int GetObjFields()
Does not require filling since the object has no object fields
Overrides:
GetObjFields in class PersistentObject
 o GetName
  public String GetName()
Returns the name of the OctCell
 o SetPermission
  public void SetPermission(String perm)
Sets the permission of the OctCell
Parameters:
perm - The permission of the OctCell, "W" for write, "R" for read-only
 o GetById
  public OctObject GetById(int intId)
Returns OctObject with the ObjectId intId. Returns null if the Object with intId is not found in memory
Parameters:
intId - The objectId of OctObject for look-up
 o ObjInCell
  public boolean ObjInCell(int intId)
Returns true if the OctObject with the ObjectId intId is in memory (indicated by its OctCell)
Parameters:
intId - The objectId of OctObject for look-up
 o AddElement
  public void AddElement(OctObject obj)
Adds an entry of the OctObject to the Vector of elements in the current OctCell
 o DelElement
  public boolean DelElement(OctObject obj)
Deletes the entry of the OctObject from the Vector of elements in the current OctCell
 o SetDirty
  public void SetDirty(OctObject obj)
SetDirty sets the dirty bit of the OctObject passed in and also sets the dirty bit of all its parents Design Decision: when we save, we traverse/propogate down the children side and save all the dependents, but not parents/ancestors as cyclic relationships immediately arise even with the setting and checking of dirty bit, saving both children and parents seem like an undesirable choice (though Mark mentioned that the user can set flag and let the the user decide)
 o SetClean
  public void SetClean(OctObject obj)
Sets the dirty flag to false (for use after a Save)
Parameters:
obj - The object to operate on
 o IsDirty
  public boolean IsDirty(OctObject obj)
Checks the dirty flag
Parameters:
obj - The object to operate on
 o End
  public void End()
Called when end of operations is reached. Does nothing as of now
 o Policy
  public int Policy(OctObject cnt,
                    OctObject obj)
This is the method that verifies that any (Oct) Policy that the devloper states is passed. Will be greatly expanded in the future. Returns OCT.OK is all policies are passed, OCT.ERROR otherwise
Parameters:
cnt - The container in the Attach call
obj - The object to be attached
 o Debug
  protected void Debug(String message)
Prints out debugging message if the debugFlag is set to true