arlut.csd.ganymede
Class BaseDump

java.lang.Object
  |
  +--arlut.csd.ganymede.BaseDump
All Implemented Interfaces:
Base, CategoryNode, java.rmi.Remote

public class BaseDump
extends java.lang.Object
implements Base, CategoryNode

This class is intended to serve as a stub to hold basic information about server side categories for the client to process locally.

Many of the methods in the Base interface are there to support remote schema editing by the admin console's schema editor, and have no effect when called on instances of this class. RuntimeException's will be thrown if those methods are called on BaseDump.

Note that even though this class is implementing a remote interface, it is doing so for the purpose of providing a consistent interface for the client, not for actual remote access. Thus, we are not extending UnicastRemoteObject as we would if we were truly a remote object.


Field Summary
(package private)  boolean canCreate
           
(package private)  boolean canInactivate
           
(package private)  boolean isEmbedded
           
(package private)  short label_id
           
(package private)  java.lang.String labelFieldName
           
private  int lastIndex
           
(package private)  java.lang.String name
           
(package private)  CategoryDump parent
           
(package private)  java.lang.String pathedName
           
(package private)  short type_code
           
 
Constructor Summary
BaseDump(BaseListTransport baselist, char[] src, int index)
          Constructor for use by a BaseListTransport object
BaseDump(CategoryDump parent, char[] src, int index)
          Constructor for use by a CategoryDump object
 
Method Summary
 boolean canCreate(Session session)
          We ignore the Session param here, since we're a client side dump associated with a known Session.
 boolean canInactivate()
          Returns true if this object type can be inactivated.
 BaseField createNewField()
          Creates a new base field and inserts it into the DBObjectBase field definitions hash.
 ReturnVal deleteField(java.lang.String baseName)
          This method is used to remove a field definition from the current schema.
 boolean fieldInUse(java.lang.String baseName)
          This method is used by the SchemaEditor to detect whether any objects are using a field definition.
 Category getCategory()
          Get the parent Category for this object type.
private  java.lang.String getChunk(char[] chars, int startDex)
           
 java.lang.String getClassName()
          Returns the name of the class managing this object type
 BaseField getField(short id)
          Returns the field definition for the field matching id, or null if no match found.
 BaseField getField(java.lang.String name)
          Returns the field definition for the field matching name, or null if no match found.
 java.util.Vector getFields()
          This method returns a list of all BaseField references for the fields defined by this object type, in random order.
 java.util.Vector getFields(boolean includeBuiltIns)
          Returns BaseField base field definitions for objects of this type.
 short getLabelField()
          Returns the short type id for the field designated as this object's primary label field, if any.
 java.lang.String getLabelFieldName()
          Returns the field name for the field designated as this object's primary label field.
 int getLastIndex()
           
 java.lang.String getName()
          Returns the name of this object type.
 java.lang.String getPath()
          Returns the name and category path of this object type.
 short getTypeID()
          Returns the invid type id for this object definition
 boolean isEmbedded()
          This method returns true if this object base is for an embedded object.
 boolean isRemovable()
          This method indicates whether this base may be removed in the Schema Editor.
 ReturnVal moveFieldAfter(java.lang.String fieldName, java.lang.String previousFieldName)
          This method is used to adjust the ordering of a custom field in this Base.
 ReturnVal moveFieldBefore(java.lang.String fieldName, java.lang.String nextFieldName)
          This method is used to adjust the ordering of a custom field in this Base.
 void setCategory(Category category)
          This method tells the CategoryNode what it's containing category is.
 ReturnVal setClassName(java.lang.String newName)
          Sets the fully qualified classname of the class managing this object type
 ReturnVal setLabelField(short fieldID)
          Choose what field will serve as this objectBase's label.
 ReturnVal setLabelField(java.lang.String fieldName)
          Choose what field will serve as this objectBase's label.
 ReturnVal setName(java.lang.String newName)
          Sets the name for this object type
 java.lang.String toString()
          as a convenience for using the standard VecQuickSort comparator.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

parent

CategoryDump parent

name

java.lang.String name

pathedName

java.lang.String pathedName

type_code

short type_code

label_id

short label_id

labelFieldName

java.lang.String labelFieldName

canInactivate

boolean canInactivate

canCreate

boolean canCreate

isEmbedded

boolean isEmbedded

lastIndex

private int lastIndex
Constructor Detail

BaseDump

public BaseDump(CategoryDump parent,
                char[] src,
                int index)
Constructor for use by a CategoryDump object

BaseDump

public BaseDump(BaseListTransport baselist,
                char[] src,
                int index)
Constructor for use by a BaseListTransport object
Method Detail

getLastIndex

public int getLastIndex()

setCategory

public void setCategory(Category category)
This method tells the CategoryNode what it's containing category is.
Specified by:
setCategory in interface CategoryNode

isRemovable

public boolean isRemovable()
Description copied from interface: Base

This method indicates whether this base may be removed in the Schema Editor.

We don't allow removal of built-in Bases that the server depends on for its operation, such as permissions, notification, and logging object types.

Specified by:
isRemovable in interface Base

isEmbedded

public boolean isEmbedded()
Description copied from interface: Base
This method returns true if this object base is for an embedded object. Embedded objects do not have their own expiration and removal dates, do not have history trails, and can be only owned by a single object, not by a list of administrators.
Specified by:
isEmbedded in interface Base

getName

public java.lang.String getName()
Description copied from interface: Base
Returns the name of this object type. Guaranteed to be unique in the Ganymede server.
Specified by:
getName in interface Base

getPath

public java.lang.String getPath()
Description copied from interface: Base
Returns the name and category path of this object type. Guaranteed to be unique in the Ganymede server.
Specified by:
getPath in interface Base

getClassName

public java.lang.String getClassName()
Description copied from interface: Base
Returns the name of the class managing this object type
Specified by:
getClassName in interface Base

getTypeID

public short getTypeID()
Description copied from interface: Base
Returns the invid type id for this object definition
Specified by:
getTypeID in interface Base

getLabelField

public short getLabelField()
Description copied from interface: Base
Returns the short type id for the field designated as this object's primary label field, if any. Objects do not need to have a primary label field designated if labels for this object type are dynamically generated.
Specified by:
getLabelField in interface Base

getLabelFieldName

public java.lang.String getLabelFieldName()
Description copied from interface: Base
Returns the field name for the field designated as this object's primary label field. null is returned if no label has been designated.
Specified by:
getLabelFieldName in interface Base

getFields

public java.util.Vector getFields(boolean includeBuiltIns)
Description copied from interface: Base

Returns BaseField base field definitions for objects of this type.

If includeBuiltIns is false, the fields returned will be the custom fields defined for this object type, and they will be returned in display order. If includeBuiltIns is true, the built-in fields will be appended to the Vector after the custom types, in random order.

Specified by:
getFields in interface Base

getFields

public java.util.Vector getFields()
Description copied from interface: Base

This method returns a list of all BaseField references for the fields defined by this object type, in random order.

Specified by:
getFields in interface Base

getField

public BaseField getField(short id)
Description copied from interface: Base
Returns the field definition for the field matching id, or null if no match found.
Specified by:
getField in interface Base

getField

public BaseField getField(java.lang.String name)
Description copied from interface: Base
Returns the field definition for the field matching name, or null if no match found.
Specified by:
getField in interface Base

canCreate

public boolean canCreate(Session session)
We ignore the Session param here, since we're a client side dump associated with a known Session.
Specified by:
canCreate in interface Base

canInactivate

public boolean canInactivate()
Description copied from interface: Base
Returns true if this object type can be inactivated. Not all object types will have inactivation protocols defined in the server. Those that do not can just be deleted.
Specified by:
canInactivate in interface Base
Following copied from interface: arlut.csd.ganymede.Base
See Also:
Base

setName

public ReturnVal setName(java.lang.String newName)
Description copied from interface: Base

Sets the name for this object type

This method is only valid when the Base reference is obtained from a SchemaEdit reference by the Ganymede schema editor.

Specified by:
setName in interface Base

setClassName

public ReturnVal setClassName(java.lang.String newName)
Description copied from interface: Base

Sets the fully qualified classname of the class managing this object type

This method is only valid when the Base reference is obtained from a SchemaEdit reference by the Ganymede schema editor.

Specified by:
setClassName in interface Base

moveFieldAfter

public ReturnVal moveFieldAfter(java.lang.String fieldName,
                                java.lang.String previousFieldName)
Description copied from interface: Base

This method is used to adjust the ordering of a custom field in this Base.

Specified by:
moveFieldAfter in interface Base
Following copied from interface: arlut.csd.ganymede.Base
Parameters:
fieldName - The name of the field to move
previousFieldName - The name of the field that fieldName is going to be put after, or null if fieldName is to be the first field displayed in this object type.

moveFieldBefore

public ReturnVal moveFieldBefore(java.lang.String fieldName,
                                 java.lang.String nextFieldName)
Description copied from interface: Base

This method is used to adjust the ordering of a custom field in this Base.

Specified by:
moveFieldBefore in interface Base
Following copied from interface: arlut.csd.ganymede.Base
Parameters:
fieldName - The name of the field to move
nextFieldName - The name of the field that fieldName is going to be put before, or null if fieldName is to be the last field displayed in this object type.

setLabelField

public ReturnVal setLabelField(java.lang.String fieldName)
Description copied from interface: Base

Choose what field will serve as this objectBase's label. A fieldName parameter of null will cause the object's label field to be undefined, in which case the object will have to generate its own label using the getLabelHook() method.

This method is only valid when the Base reference is obtained from a SchemaEdit reference by the Ganymede schema editor.

Specified by:
setLabelField in interface Base

setLabelField

public ReturnVal setLabelField(short fieldID)
Description copied from interface: Base

Choose what field will serve as this objectBase's label. A fieldID parameter of -1 will cause the object's label field to be undefined, in which case the object will have to generate its own label using the getLabelHook() method.

This method is only valid when the Base reference is obtained from a SchemaEdit reference by the Ganymede schema editor.

Specified by:
setLabelField in interface Base

getCategory

public Category getCategory()
Description copied from interface: Base

Get the parent Category for this object type. This is used by the Ganymede client and schema editor to present object types in a hierarchical tree.

This method is only valid when the Base reference is obtained from a SchemaEdit reference by the Ganymede schema editor.

Specified by:
getCategory in interface Base

createNewField

public BaseField createNewField()
Description copied from interface: Base

Creates a new base field and inserts it into the DBObjectBase field definitions hash. The newly created field will the first short id code value available at or above 256.

This method is only valid when the Base reference is obtained from a SchemaEdit reference by the Ganymede schema editor.

Specified by:
createNewField in interface Base

deleteField

public ReturnVal deleteField(java.lang.String baseName)
Description copied from interface: Base

This method is used to remove a field definition from the current schema.

Of course, this removal will only take effect if the schema editor commits.

This method is only valid when the Base reference is obtained from a SchemaEdit reference by the Ganymede schema editor.

Specified by:
deleteField in interface Base
Following copied from interface: arlut.csd.ganymede.Base
See Also:
Base

fieldInUse

public boolean fieldInUse(java.lang.String baseName)
Description copied from interface: Base
This method is used by the SchemaEditor to detect whether any objects are using a field definition. If any objects of this type in the database have this field defined, this method will return true.
Specified by:
fieldInUse in interface Base
Following copied from interface: arlut.csd.ganymede.Base
See Also:
Base

getChunk

private java.lang.String getChunk(char[] chars,
                                  int startDex)

toString

public java.lang.String toString()

as a convenience for using the standard VecQuickSort comparator.

Overrides:
toString in class java.lang.Object