Class OctCell
Class OctCell
java.lang.Object
|
+----PersistentObject
|
+----OctObject
|
+----OctCell
- public class OctCell
- extends OctObject
-
className
- Class Name
-
elements
-
Keeps track of all OctObjects in the present environment
-
octFields
- Number of fields
-
OctCell(String)
-
Constructor of an OctCell (for loading from data back-end server)
-
OctCell(String, int)
-
Constructor of an OctCell (for loading from data back-end server)
-
OctCell(String, String, String)
-
Constructor of an OctCell (for dynamic creation).
-
AddElement(OctObject)
-
Adds an entry of the OctObject to the Vector of elements
in the current OctCell
-
Debug(String)
- Prints out debugging message if the debugFlag is set to true
-
DelElement(OctObject)
-
Deletes the entry of the OctObject from the Vector of elements
in the current OctCell
-
End()
- Called when end of operations is reached.
-
GetById(int)
-
Returns OctObject with the ObjectId intId.
-
GetName()
- Returns the name of the OctCell
-
GetObjFields()
- Does not require filling since the object has no object fields
-
IsDirty(OctObject)
- Checks the dirty flag
-
Load(int)
- Should never be called
-
Load(String)
-
Loads the fields of an OctCell from data back-end
-
ObjInCell(int)
-
Returns true if the OctObject with the ObjectId intId
is in memory (indicated by its OctCell)
-
Policy(OctObject, OctObject)
-
This is the method that verifies that any (Oct) Policy
that the devloper states is passed.
-
SetClean(OctObject)
- Sets the dirty flag to false (for use after a Save)
-
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)
-
SetObjFields()
-
Performs the neccessary overhead to allow this object to be
manipulated over the network
-
SetPermission(String)
- Sets the permission of the OctCell
className
public final static String className
- Class Name
octFields
public final static int octFields
- Number of fields
elements
public Vector elements
- Keeps track of all OctObjects in the present environment
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
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
OctCell
public OctCell(String name)
- Constructor of an OctCell (for loading from data back-end server)
SetObjFields
protected void SetObjFields()
- Performs the neccessary overhead to allow this object to be
manipulated over the network
- Overrides:
- SetObjFields in class PersistentObject
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
Load
public boolean Load(int intId)
- Should never be called
- Overrides:
- Load in class PersistentObject
GetObjFields
protected int GetObjFields()
- Does not require filling since the object has no object fields
- Overrides:
- GetObjFields in class PersistentObject
GetName
public String GetName()
- Returns the name of the OctCell
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
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
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
AddElement
public void AddElement(OctObject obj)
- Adds an entry of the OctObject to the Vector of elements
in the current OctCell
DelElement
public boolean DelElement(OctObject obj)
- Deletes the entry of the OctObject from the Vector of elements
in the current OctCell
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)
SetClean
public void SetClean(OctObject obj)
- Sets the dirty flag to false (for use after a Save)
- Parameters:
- obj - The object to operate on
IsDirty
public boolean IsDirty(OctObject obj)
- Checks the dirty flag
- Parameters:
- obj - The object to operate on
End
public void End()
- Called when end of operations is reached. Does nothing as of now
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
Debug
protected void Debug(String message)
- Prints out debugging message if the debugFlag is set to true