|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--arlut.csd.ganymede.DBBaseCategory
A DBBaseCategory is a 'red folder node' in the server's category and object hierarchy. The purpose of DBBaseCategory is to be able to group object types with related purpose into a common folder for display on the client.
The DBStore contains a tree of
CategoryNodes, each of which is either
a DBObjectBase or a DBBaseCategory. The
Category RMI interface is used by the
server and the schema editor to perform browsing and manipulating the server's
category tree.
| Field Summary | |
private java.util.Hashtable |
baseHash
We use this baseHash to keep a map of DBObjectBase.getKey() to instances of DBObjectBase. |
private static arlut.csd.Util.Compare |
comparator
|
private java.util.Vector |
contents
The actual members of this category. |
private static boolean |
debug
|
private arlut.csd.ganymede.DBSchemaEdit |
editor
A reference to the DBSchemaEdit object that is editing us for a client-side schema editor. |
private java.lang.String |
name
|
private arlut.csd.ganymede.DBBaseCategory |
parent
|
private arlut.csd.ganymede.DBStore |
store
|
(package private) int |
tmp_displayOrder
In order to keep compatibility with versions 1.17 and previous of the ganymede.db file format, we'll keep this field so we can do a sort after loading when reading an old file. |
| Fields inherited from class java.rmi.server.UnicastRemoteObject |
|
| Fields inherited from class java.rmi.server.RemoteServer |
|
| Fields inherited from class java.rmi.server.RemoteObject |
ref |
| Constructor Summary | |
DBBaseCategory(arlut.csd.ganymede.DBStore store,
java.io.DataInput in)
Receive constructor. |
|
DBBaseCategory(arlut.csd.ganymede.DBStore store,
java.io.DataInput in,
arlut.csd.ganymede.DBBaseCategory parent)
Receive constructor. |
|
DBBaseCategory(arlut.csd.ganymede.DBStore store,
arlut.csd.ganymede.DBBaseCategory rootCategory,
java.util.Hashtable baseHash,
arlut.csd.ganymede.DBSchemaEdit editor)
Recursive duplication constructor. |
|
DBBaseCategory(arlut.csd.ganymede.DBStore store,
java.lang.String name)
Default value constructor. |
|
DBBaseCategory(arlut.csd.ganymede.DBStore store,
java.lang.String name,
arlut.csd.ganymede.DBBaseCategory parent)
Primary constructor. |
|
| Method Summary | |
void |
addNodeAfter(arlut.csd.ganymede.CategoryNode node,
java.lang.String prevNodeName)
This method is used to place a Category Node under us. |
void |
addNodeBefore(arlut.csd.ganymede.CategoryNode node,
java.lang.String nextNodeName)
This method is used to place a Category Node under us. |
void |
clearEditor()
This method is used when a schema editor is 'checking in' a category tree. |
boolean |
contains(java.lang.String name)
This method returns true if this category directly contains a CategoryNode
with name <name> |
(package private) void |
emit(java.io.DataOutput out)
Emits this category and its contents to <out>, in ganymede.db form. |
(package private) void |
emitXML(arlut.csd.ganymede.XMLDumpContext xmlOut)
Emits this category and its contents to <out>, in XML form. |
arlut.csd.ganymede.DBObjectBase |
getBaseFromBase(arlut.csd.ganymede.Base base)
This method is used to convert an RMI remote reference to a Base object to a reference to the local copy. |
arlut.csd.ganymede.DBObjectBase |
getBaseFromKey(short id)
This method is used to convert an RMI remote reference to a Base object to a reference to the local copy. |
arlut.csd.ganymede.Category |
getCategory()
This method returns the category that this category node belongs to. |
java.lang.String |
getName()
Returns the name of this category. |
arlut.csd.ganymede.CategoryNode |
getNode(java.lang.String name)
Returns a subcategory of name <name>. |
java.util.Vector |
getNodes()
Returns child nodes |
java.lang.String |
getPath()
Returns the full path to this category, with levels in the hierarchy separated by '/'s. |
arlut.csd.ganymede.DBBaseCategory |
getRoot()
This method returns a reference to the top of this category's tree. |
boolean |
isUnder(arlut.csd.ganymede.Category cat)
This method returns true if this is a subcategory of <cat>. |
void |
moveCategoryNode(java.lang.String catPath,
java.lang.String prevNodeName)
This method can be used to move a Category from another Category to this Category, or to move a Category around within this Category. |
arlut.csd.ganymede.Category |
newSubCategory()
This creates a new subcategory under this category, with displayOrder after the last item currently in the category. |
arlut.csd.ganymede.Category |
newSubCategory(java.lang.String name)
This creates a new subcategory under this category, with displayOrder after the last item currently in the category. |
void |
print(java.io.PrintWriter out,
java.lang.String indent)
Recursively prints a portion of a text representation of this category to <out>, with leading indent. |
void |
printHTML(java.io.PrintWriter out)
Recursively prints a portion of an HTML representation of this category to <out> Must be called from DBStore.printCategoryTreeHTML(), as it assumes the HTML context
generated by that method. |
(package private) void |
receive(java.io.DataInput in,
arlut.csd.ganymede.DBBaseCategory parent)
Reads this category and its contents from <in>, in ganymede.db form. |
private void |
recurseDown(arlut.csd.ganymede.DBBaseCategory category,
java.util.Hashtable baseHash,
arlut.csd.ganymede.DBSchemaEdit editor)
This method takes all the children of the passed-in category (both DBObjectBase objects
and contained DBBaseCategory
objects) and makes copies under this. |
void |
removeNode(arlut.csd.ganymede.CategoryNode node)
This method is used to remove a Category Node from under us. |
void |
removeNode(java.lang.String name)
This method is used to remove a Category Node from under us. |
void |
resort()
Resorts this category's contents based on the tmp_displayOrder field. |
void |
setCategory(arlut.csd.ganymede.Category category)
This method tells the CategoryNode what it's containing category is. |
boolean |
setName(java.lang.String newName)
Sets the name of this node. |
| Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
| Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
| Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
private static final boolean debug
private static arlut.csd.Util.Compare comparator
private java.lang.String name
private arlut.csd.ganymede.DBBaseCategory parent
private arlut.csd.ganymede.DBStore store
private java.util.Vector contents
DBObjectBase or another
DBBaseCategory.
int tmp_displayOrder
private java.util.Hashtable baseHash
private arlut.csd.ganymede.DBSchemaEdit editor
| Constructor Detail |
public DBBaseCategory(arlut.csd.ganymede.DBStore store,
java.lang.String name,
arlut.csd.ganymede.DBBaseCategory parent)
throws java.rmi.RemoteException
store - DBStore that is managing us. We'll ask it to look up parents
for us.name - Name for this baseparent - If we're not being constructed at the top level, who is our parent?
public DBBaseCategory(arlut.csd.ganymede.DBStore store,
java.lang.String name)
throws java.rmi.RemoteException
store - DBStore that is managing us. We'll ask it to look up parents
for us.name - Name for this category
public DBBaseCategory(arlut.csd.ganymede.DBStore store,
java.io.DataInput in)
throws java.rmi.RemoteException,
java.io.IOException
store - DBStore that is managing us. We'll ask it to look up parents
for us.in - DataInput stream to load the db representation of this category from
public DBBaseCategory(arlut.csd.ganymede.DBStore store,
java.io.DataInput in,
arlut.csd.ganymede.DBBaseCategory parent)
throws java.rmi.RemoteException,
java.io.IOException
store - DBStore that is managing us. We'll ask it to look up parents
for us.in - DataInput stream to load the db representation of this category from
public DBBaseCategory(arlut.csd.ganymede.DBStore store,
arlut.csd.ganymede.DBBaseCategory rootCategory,
java.util.Hashtable baseHash,
arlut.csd.ganymede.DBSchemaEdit editor)
throws java.rmi.RemoteException
| Method Detail |
private void recurseDown(arlut.csd.ganymede.DBBaseCategory category,
java.util.Hashtable baseHash,
arlut.csd.ganymede.DBSchemaEdit editor)
throws java.rmi.RemoteException
This method takes all the children of the passed-in category
(both DBObjectBase objects
and contained DBBaseCategory
objects) and makes copies under this.
java.rmi.RemoteExceptionpublic void clearEditor()
public void printHTML(java.io.PrintWriter out)
Recursively prints a portion of an HTML
representation of this category
to <out> Must be called from
DBStore.printCategoryTreeHTML(), as it assumes the HTML context
generated by that method.
public void print(java.io.PrintWriter out,
java.lang.String indent)
Recursively prints a portion of a text representation of this category to <out>, with leading indent.
out - indent - leading indent for this category and below
void emit(java.io.DataOutput out)
throws java.io.IOException
Emits this category and its contents to <out>, in ganymede.db form.
java.io.IOException
void receive(java.io.DataInput in,
arlut.csd.ganymede.DBBaseCategory parent)
throws java.io.IOException
Reads this category and its contents from <in>, in ganymede.db form.
java.io.IOException
void emitXML(arlut.csd.ganymede.XMLDumpContext xmlOut)
throws java.io.IOException
Emits this category and its contents to <out>, in XML form.
java.io.IOExceptionpublic void resort()
Resorts this category's contents based on the tmp_displayOrder field.
We only use this when loading DBBaseCategory's from old-style ganymede.db files. The modern way of doing things depends on the order of categories within a contents Vector, and needs no explicit tmp_displayOrder or sorting to be done.
public java.lang.String getPath()
Returns the full path to this category, with levels in the hierarchy separated by '/'s.
getPath in interface CategoryCategorypublic java.lang.String getName()
getName in interface CategoryCategorypublic boolean setName(java.lang.String newName)
setName in interface CategoryCategoryNodepublic arlut.csd.ganymede.Category getCategory()
getCategory in interface CategoryCategory,
CategoryNodepublic void setCategory(arlut.csd.ganymede.Category category)
setCategory in interface CategoryNodeCategoryNode
public void addNodeAfter(arlut.csd.ganymede.CategoryNode node,
java.lang.String prevNodeName)
This method is used to place a Category Node under us. This method adds a new node into this category, after prevNodeName if prevNodeName is not null, or at the end of the category if it is.
addNodeAfter in interface Categorynode - Node to place under this categoryprevNodeName - the name of the node that the new node is to be added after,
must not be path-qualified.Category
public void addNodeBefore(arlut.csd.ganymede.CategoryNode node,
java.lang.String nextNodeName)
This method is used to place a Category Node under us. This method adds a new node into this category, before nextNodeName if nextNodeName is not null, or at the beginning of the category if it is.
addNodeBefore in interface Categorynode - Node to place under this categorynextNodeName - the name of the node that the new node is to be added before,
must not be path-qualified.Category
public void moveCategoryNode(java.lang.String catPath,
java.lang.String prevNodeName)
This method can be used to move a Category from another Category to this Category, or to move a Category around within this Category.
moveCategoryNode in interface CategorycatPath - the fully specified path of the node to be movedprevNodeName - the name of the node that the catPath node is
to be placed after in this category, or null if the node is to
be placed at the first element of this categoryCategory
public void removeNode(arlut.csd.ganymede.CategoryNode node)
throws java.rmi.RemoteException
This method is used to remove a Category Node from under us.
removeNode in interface Categoryjava.rmi.RemoteExceptionCategory
public void removeNode(java.lang.String name)
throws java.rmi.RemoteException
This method is used to remove a Category Node from under us.
removeNode in interface Categoryjava.rmi.RemoteExceptionCategorypublic arlut.csd.ganymede.CategoryNode getNode(java.lang.String name)
Returns a subcategory of name <name>.
getNode in interface CategoryCategorypublic java.util.Vector getNodes()
getNodes in interface CategoryCategorypublic arlut.csd.ganymede.Category newSubCategory(java.lang.String name)
This creates a new subcategory under this category, with displayOrder after the last item currently in the category. This method should only be called when there are no nodes left to be added to the category with prefixed displayOrder values.
public arlut.csd.ganymede.Category newSubCategory()
This creates a new subcategory under this category, with displayOrder after the last item currently in the category. This method should only be called when there are no nodes left to be added to the category with prefixed displayOrder values.
newSubCategory in interface CategoryCategorypublic boolean isUnder(arlut.csd.ganymede.Category cat)
This method returns true if this is a subcategory of <cat>.
isUnder in interface CategoryCategorypublic boolean contains(java.lang.String name)
This method returns true if this category directly
contains a CategoryNode
with name <name>
public arlut.csd.ganymede.DBBaseCategory getRoot()
public arlut.csd.ganymede.DBObjectBase getBaseFromBase(arlut.csd.ganymede.Base base)
This method is used to convert an RMI remote reference to a Base object to a reference to the local copy.
Needed for RMI under JDK 1.1.
public arlut.csd.ganymede.DBObjectBase getBaseFromKey(short id)
This method is used to convert an RMI remote reference to a Base object to a reference to the local copy.
Needed for RMI under JDK 1.1.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||