arlut.csd.ganymede
Class DBObjectBaseField

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--arlut.csd.ganymede.DBObjectBaseField
All Implemented Interfaces:
BaseField, FieldType, java.rmi.Remote, java.io.Serializable

public final class DBObjectBaseField
extends java.rmi.server.UnicastRemoteObject
implements BaseField, FieldType

An entry in the Ganymede server's DBStore schema dictionary. DBStore contains a collection of DBObjectBase objects, which define the schema information for a particular type of object held in the Ganymede database. A DBObjectBaseField is contained within a DBObjectBase, and defines the name, id, type, and constraints of a particular field that can be held in DBObjects of that type, including a controlling DBNameSpace, if appropriate.

Each DBField held in the server's database holds a reference to a DBObjectBaseField, and the DBField's methods will consult the DBObjectBaseField during run-time to make decisions based on specified constraints defined in the DBObjectBaseField.

The Ganymede schema editor uses the BaseField remote interface to make changes to a DBObjectBaseField's constraint information during schema editing. The Ganymede client may also use the BaseField interface to learn about the field's type information, but it may also download a FieldTemplate that carries a DBObjectBaseField's type information in an efficiently retrieved summary.

See Also:
Serialized Form

Field Summary
(package private)  short allowedTarget
           
(package private)  java.lang.String allowedTargetStr
          If this is not null, then we have gotten information on this Invid DBObjectBaseField pointing to a type of object from an XML file, and we'll need to do type resolution once the schema is completely loaded from an XML stream.
(package private)  boolean apachemd5crypted
           
(package private)  boolean array
          true if this field is an array type
(package private)  java.lang.String badChars
           
(package private)  arlut.csd.ganymede.DBObjectBase base
          Object type definition for the database object class we are member of
(package private)  java.lang.Class classdef
          class object containing the code managing dbfields of this type
(package private)  java.lang.String classname
          name of class to manage user interactions with this field
(package private)  java.lang.String comment
          string to be displayed in the client as a tooltip explaining this field
(package private)  boolean crypted
           
(package private) static boolean debug
           
(package private)  boolean editInPlace
           
(package private)  arlut.csd.ganymede.DBSchemaEdit editor
          If we are being edited, this will point to an instance of a server-side schema editing class.
(package private)  java.lang.String falseLabel
           
(package private)  short field_code
          id of this field in the current object type
(package private)  java.lang.String field_name
          name of this field
(package private)  short field_type
          Field Type for this field
(package private)  java.lang.Boolean inUseCache
          A three state flag used by isInUse() to report whether or not a particular field is in use in the loaded database.
(package private)  boolean labeled
           
(package private)  short limit
          max length of array
(package private)  boolean loading
          true if we're in the middle of loading
(package private)  short maxLength
           
(package private)  boolean md5crypted
           
(package private)  short minLength
           
(package private)  boolean multiLine
           
(package private)  arlut.csd.ganymede.DBNameSpace namespace
           
(package private)  arlut.csd.ganymede.DBObjectBaseField next
           
(package private)  java.lang.String okChars
           
(package private)  gnu.regexp.RE regexp
          Compiled regular expression for input-filtering in StringDBFields.
(package private)  java.lang.String regexpDesc
          Text description of the meaning of the regexpPat, if defined
(package private)  java.lang.String regexpPat
          Regular Expression string for input-filtering in StringDBFields.
(package private)  boolean storePlaintext
           
(package private)  short targetField
           
(package private)  java.lang.String targetFieldStr
          If this is not null, then we have gotten information on this Invid DBObjectBaseField linked to a field from an XML file, and we'll need to do type resolution once the schema is completely loaded from an XML stream.
(package private)  arlut.csd.ganymede.FieldTemplate template
          Downloadable FieldTemplate representing the constant field type attributes represented by this DBObjectBaseField.
(package private)  int tmp_displayOrder
          This field is used to handle field order sorting when we read an old (pre-2.0) ganymede.db file.
(package private)  java.lang.String trueLabel
           
(package private)  boolean visibility
          Should this field be displayed to the client? May be false for some fields intended for 'scratch-pad' use, as in serving as anchors for compound namespace use.
(package private) static arlut.csd.ganymede.ReturnVal warning1
           
(package private) static arlut.csd.ganymede.ReturnVal warning2
           
(package private)  boolean winHashed
           
 
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
 
Fields inherited from interface arlut.csd.ganymede.FieldType
BOOLEAN, DATE, FIRSTFIELD, FLOAT, INVID, IP, LASTFIELD, NUMERIC, PASSWORD, PERMISSIONMATRIX, STRING
 
Constructor Summary
(package private) DBObjectBaseField(java.io.DataInput in, arlut.csd.ganymede.DBObjectBase base)
          Receive constructor, for binary loading from ganymede.db.
(package private) DBObjectBaseField(arlut.csd.ganymede.DBObjectBase base)
          Generic field constructor.
(package private) DBObjectBaseField(arlut.csd.ganymede.DBObjectBase base, arlut.csd.ganymede.DBSchemaEdit editor)
          Editing base constructor.
(package private) DBObjectBaseField(arlut.csd.ganymede.DBObjectBaseField original, arlut.csd.ganymede.DBSchemaEdit editor)
          Copy constructor, used during schema editing.
 
Method Summary
 arlut.csd.ganymede.DBObjectBase base()
          Returns the object definition that this field is defined under.
private  arlut.csd.ganymede.ReturnVal doBooleanXML(arlut.csd.Util.XMLItem root)
          This method takes care of doing everything required to take an XMLItem tree <fielddef type="boolean"> and update this field's schema information to match.
private  arlut.csd.ganymede.ReturnVal doInvidXML(arlut.csd.Util.XMLItem root, boolean doLinkResolve)
          This method takes care of doing everything required to take an XMLItem tree <fielddef type="invid"> and update this field's schema information to match.
private  arlut.csd.ganymede.ReturnVal doIPXML(arlut.csd.Util.XMLItem root)
          This method takes care of doing everything required to take an XMLItem tree <fielddef type="ip"> and update this field's schema information to match.
private  arlut.csd.ganymede.ReturnVal doNumericXML(arlut.csd.Util.XMLItem root)
          This method takes care of doing everything required to take an XMLItem tree <fielddef type="numeric"> and update this field's schema information to match.
private  arlut.csd.ganymede.ReturnVal doPasswordXML(arlut.csd.Util.XMLItem root)
          This method takes care of doing everything required to take an XMLItem tree <fielddef type="password"> and update this field's schema information to match.
private  arlut.csd.ganymede.ReturnVal doStringXML(arlut.csd.Util.XMLItem root)
          This method takes care of doing everything required to take an XMLItem tree <fielddef type="string"> and update this field's schema information to match.
(package private)  void emit(java.io.DataOutput out)
          This method is used when the database is being dumped, to write out this field definition to disk.
(package private)  void emitXML(arlut.csd.ganymede.XMLDumpContext xmlOut)
          This method is used when the database is being dumped, to write out this field definition to disk.
private static arlut.csd.ganymede.ReturnVal genWarning1()
           
private static arlut.csd.ganymede.ReturnVal genWarning2()
           
 java.lang.String getBadChars()
          Returns the set of unacceptable characters if this is a string or password field.
 arlut.csd.ganymede.Base getBase()
          Returns the Base we are a part of.
 java.lang.Class getClassDef()
          Returns the Class object managing instances of this field
 java.lang.String getClassName()
          Returns the name of the class managing instances of this field
 java.lang.String getComment()
          Returns the comment defined in the schema for this field
 java.lang.String getFalseLabel()
          Returns the false Label if this is a labeled boolean field
 short getID()
          Returns id code for this field.
 java.lang.Short getKey()
          Returns the type id for this field definition as a Short, suitable for use in a hash.
 short getMaxArraySize()
          Returns the array size limitation for this field if it is an array field
 short getMaxLength()
          Returns the maximum acceptable string length if this is a string or password field.
 short getMinLength()
          Returns the minimum acceptable string length if this is a string or password field.
 java.lang.String getName()
          Returns the name of this field
 arlut.csd.ganymede.DBNameSpace getNameSpace()
          Returns the DBNameSpace that this string, numeric, or IP field is associated with.
 java.lang.String getNameSpaceLabel()
          Returns the label of this string, numeric, or IP field's namespace.
 java.lang.String getOKChars()
          Returns the set of acceptable characters if this is a string field.
 java.lang.String getRegexpDesc()
          Returns the text description of the regexp pattern string constraining this string field.
 java.lang.String getRegexpPat()
          Returns the regexp pattern string constraining this string field.
 short getTargetBase()
          Return the object type that this invid field is constrained to point to, if set
 short getTargetField()
          If this field is a target restricted invid field, this method will return a short indicating the field in the target object that the symmetry relation applies to.
 arlut.csd.ganymede.FieldTemplate getTemplate()
          Returns a FieldTemplate serializable field definition object for this field.
 java.lang.String getTrueLabel()
          Returns the true Label if this is a labeled boolean field
 short getType()
          Returns the field type
 java.lang.String getTypeDesc()
          This method is intended to produce a human readable representation of this field definition's type attributes.
 java.lang.String getTypeDescHTML()
          This method is intended to produce a human readable representation of this field definition's type attributes.
 boolean isApacheMD5Crypted()
          This method returns true if this is a password field that stores passwords in Apache md5crypt() format, and can thus accept pre-crypted passwords.
 boolean isArray()
          Returns true if this field is a vector field, false otherwise.
 boolean isBoolean()
          Returns true if this field is of boolean type
 boolean isBuiltIn()
          This method returns true if this field is one of the system fields present in all objects.
 boolean isCrypted()
          This method returns true if this is a password field that stores passwords in UNIX crypt format, and can thus accept pre-crypted passwords.
 boolean isDate()
          Returns true if this field is of date type
 boolean isEditable()
          This method returns true if this field definition can be edited in the schema editor.
 boolean isEditInPlace()
          Returns true if this is an invid field which is intended as an editInPlace reference for the client's rendering.
 boolean isFloat()
          Returns true if this field is of float type
 boolean isInUse()
          This method returns true if there are any fields of this type in the database.
 boolean isInvid()
          Returns true if this field is of invid type
 boolean isIP()
          Returns true if this field is of IP type
 boolean isLabeled()
          Returns true if this is a boolean field with labels
 boolean isMD5Crypted()
          This method returns true if this is a password field that stores passwords in OpenBSD/FreeBSD/PAM md5crypt() format, and can thus accept pre-crypted passwords.
 boolean isMultiLine()
          Returns true if this string field is intended to be a multi-line field.
 boolean isNumeric()
          Returns true if this field is of numeric type
 boolean isPassword()
          Returns true if this field is of password type
 boolean isPermMatrix()
          Returns true if this field is of permission matrix type
 boolean isPlainText()
          This method returns true if this is a password field that will keep a copy of the password in plaintext in the Ganymede server's on-disk database.
 boolean isRemovable()
          This method returns true if this field definition can be removed by the schema editor.
 boolean isString()
          Returns true if this field is of string type
 boolean isSymmetric()
          If this field is a target restricted invid field, this method will return true if this field has a symmetry relationship to the target
private  boolean isSystemField()
          This method checks to see if this DBObjectBaseField corresponds to a system field
 boolean isTargetRestricted()
          Returns true if this is a target restricted invid field
 boolean isVisible()
          This method returns true if this field is intended to be visible to the client normally, false otherwise.
 boolean isWinHashed()
          This method returns true if this is a password field that will store passwords in the two hashing formats used by Samba/Windows, the older 14-char LANMAN hash, and the newer md5/Unicode hash used by Windows NT.
 void print(java.io.PrintWriter out, java.lang.String indent)
          This method is used when the Ganymede server dumps its schema.
 void printHTML(java.io.PrintWriter out)
          This method is used when the Ganymede server dumps its schema.
(package private)  void receive(java.io.DataInput in)
          This method is used when the database is being loaded, to read in this field definition from disk.
 arlut.csd.ganymede.ReturnVal setApacheMD5Crypted(boolean b)
          This method is used to specify that this password field should store passwords in Apache md5crypt() format.
 arlut.csd.ganymede.ReturnVal setArray(boolean b)
          Set this field to be a vector or scalar.
 arlut.csd.ganymede.ReturnVal setBadChars(java.lang.String s)
          Sets the set of characters that are specifically disallowed in this string or password field.
(package private)  arlut.csd.ganymede.ReturnVal setBase(arlut.csd.ganymede.DBObjectBase base)
           
 arlut.csd.ganymede.ReturnVal setClassName(java.lang.String name)
          Sets the name of the class managing instances of this field
 arlut.csd.ganymede.ReturnVal setComment(java.lang.String s)
          Sets the comment defined in the schema for this field
 arlut.csd.ganymede.ReturnVal setCrypted(boolean b)
          This method is used to specify that this password field should store passwords in UNIX crypt format.
 arlut.csd.ganymede.ReturnVal setEditInPlace(boolean b)
          Sets whether or not this field is intended as an editInPlace reference for the client's rendering.
 arlut.csd.ganymede.ReturnVal setFalseLabel(java.lang.String label)
          Sets the label associated with the false choice for this boolean field.
 arlut.csd.ganymede.ReturnVal setID(short id)
          This method is used to set this field's id in the containing DBObjectBase.
 arlut.csd.ganymede.ReturnVal setLabeled(boolean b)
          Turn labeled choices on/off for a boolean field.
 arlut.csd.ganymede.ReturnVal setMaxArraySize(short limit)
          Set the maximum number of values allowed in this vector field.
 arlut.csd.ganymede.ReturnVal setMaxLength(short val)
          Sets the maximum acceptable length for this string or password field.
 arlut.csd.ganymede.ReturnVal setMD5Crypted(boolean b)
          This method is used to specify that this password field should store passwords in OpenBSD/FreeBSD/PAM md5crypt() format.
 arlut.csd.ganymede.ReturnVal setMinLength(short val)
          Sets the minimum acceptable length for this string or password field.
 arlut.csd.ganymede.ReturnVal setMultiLine(boolean b)
          Sets whether or not this string field should be presented as a multiline field.
 arlut.csd.ganymede.ReturnVal setName(java.lang.String name)
          Sets the name of this field
 arlut.csd.ganymede.ReturnVal setName(java.lang.String name, boolean swapIfNeeded)
          Sets the name of this field
(package private)  arlut.csd.ganymede.ReturnVal setNameSpace(arlut.csd.ganymede.DBNameSpace newNamespace)
          This method is used internally to set a namespace constraint.
 arlut.csd.ganymede.ReturnVal setNameSpace(java.lang.String nameSpaceId)
          Set a namespace constraint for this string, numeric, or IP field.
 arlut.csd.ganymede.ReturnVal setOKChars(java.lang.String s)
          Sets the set of characters that are allowed in this string or password field.
 arlut.csd.ganymede.ReturnVal setPlainText(boolean b)
          This method is used to specify that this password field should keep a copy of the password in plaintext on disk, even if other hash methods are in use which could be used for Ganymede login authentication.
 arlut.csd.ganymede.ReturnVal setRegexpDesc(java.lang.String s)
          Sets the text descriptionf or the regexp pattern string constraining this string field.
 arlut.csd.ganymede.ReturnVal setRegexpPat(java.lang.String s)
          Sets the regexp pattern string constraining this string field.
 arlut.csd.ganymede.ReturnVal setTargetBase(short val)
          Sets the allowed target object code of this invid field to <val>.
 arlut.csd.ganymede.ReturnVal setTargetBase(java.lang.String baseName)
          Sets the allowed target object code of this invid field to <baseName>.
 arlut.csd.ganymede.ReturnVal setTargetField(short val)
          Sets the field of the target object of this invid field that should be managed in the symmetry relationship if isSymmetric().
 arlut.csd.ganymede.ReturnVal setTargetField(java.lang.String fieldName)
          Sets the field of the target object of this invid field that should be managed in the symmetry relationship if isSymmetric().
 arlut.csd.ganymede.ReturnVal setTrueLabel(java.lang.String label)
          Sets the label associated with the true choice for this boolean field.
 arlut.csd.ganymede.ReturnVal setType(short type)
          Sets the field type for this field.
 arlut.csd.ganymede.ReturnVal setWinHashed(boolean b)
          This method is used to specify that this password field should store passwords in the Samba/Windows hashing formats.
(package private)  arlut.csd.ganymede.ReturnVal setXML(arlut.csd.Util.XMLItem root, boolean doLinkResolve, java.io.PrintWriter err)
          This method is used to read the definition for this DBObjectBaseField from a <fielddef> XMLItem tree.
 java.lang.String toString()
           
 
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, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

warning1

static final arlut.csd.ganymede.ReturnVal warning1

warning2

static final arlut.csd.ganymede.ReturnVal warning2

debug

static final boolean debug
See Also:
Constant Field Values

base

arlut.csd.ganymede.DBObjectBase base
Object type definition for the database object class we are member of


field_name

java.lang.String field_name
name of this field


field_code

short field_code
id of this field in the current object type


field_type

short field_type
Field Type for this field


visibility

boolean visibility
Should this field be displayed to the client? May be false for some fields intended for 'scratch-pad' use, as in serving as anchors for compound namespace use. (i.e., the case where two fields in an object are considered together for namespace use.. in this case, a hidden field might be defined with custom code updating the hidden field whenever either of the two visible fields are changed. The hidden field will have a value of XY where X is the contents of field 1 and Y the contents of field 2. Oh, never mind.)


classname

java.lang.String classname
name of class to manage user interactions with this field


comment

java.lang.String comment
string to be displayed in the client as a tooltip explaining this field


classdef

java.lang.Class classdef
class object containing the code managing dbfields of this type


array

boolean array
true if this field is an array type


loading

boolean loading
true if we're in the middle of loading


limit

short limit
max length of array


labeled

boolean labeled

trueLabel

java.lang.String trueLabel

falseLabel

java.lang.String falseLabel

minLength

short minLength

maxLength

short maxLength

okChars

java.lang.String okChars

badChars

java.lang.String badChars

namespace

arlut.csd.ganymede.DBNameSpace namespace

multiLine

boolean multiLine

regexpPat

java.lang.String regexpPat
Regular Expression string for input-filtering in StringDBFields.


regexpDesc

java.lang.String regexpDesc
Text description of the meaning of the regexpPat, if defined


regexp

gnu.regexp.RE regexp
Compiled regular expression for input-filtering in StringDBFields.


editInPlace

boolean editInPlace

allowedTarget

short allowedTarget

targetField

short targetField

allowedTargetStr

java.lang.String allowedTargetStr
If this is not null, then we have gotten information on this Invid DBObjectBaseField pointing to a type of object from an XML file, and we'll need to do type resolution once the schema is completely loaded from an XML stream. Once this happens, allowedTarget will be set properly, and allowedTargetStr will be set to null.


targetFieldStr

java.lang.String targetFieldStr
If this is not null, then we have gotten information on this Invid DBObjectBaseField linked to a field from an XML file, and we'll need to do type resolution once the schema is completely loaded from an XML stream. Once this happens, targetField will be set properly, and targetFieldStr will be set to null.


crypted

boolean crypted

md5crypted

boolean md5crypted

apachemd5crypted

boolean apachemd5crypted

winHashed

boolean winHashed

storePlaintext

boolean storePlaintext

editor

arlut.csd.ganymede.DBSchemaEdit editor
If we are being edited, this will point to an instance of a server-side schema editing class.


template

arlut.csd.ganymede.FieldTemplate template
Downloadable FieldTemplate representing the constant field type attributes represented by this DBObjectBaseField. This template is regenerated whenever clearEditor() is called, upon schema editing completion.


next

arlut.csd.ganymede.DBObjectBaseField next

inUseCache

java.lang.Boolean inUseCache

A three state flag used by isInUse() to report whether or not a particular field is in use in the loaded database.


tmp_displayOrder

int tmp_displayOrder
This field is used to handle field order sorting when we read an old (pre-2.0) ganymede.db file.

Constructor Detail

DBObjectBaseField

DBObjectBaseField(arlut.csd.ganymede.DBObjectBase base)
            throws java.rmi.RemoteException
Generic field constructor.


DBObjectBaseField

DBObjectBaseField(arlut.csd.ganymede.DBObjectBase base,
                  arlut.csd.ganymede.DBSchemaEdit editor)
            throws java.rmi.RemoteException
Editing base constructor. This constructor is used to create a new field definition object in an editing context.


DBObjectBaseField

DBObjectBaseField(java.io.DataInput in,
                  arlut.csd.ganymede.DBObjectBase base)
            throws java.io.IOException,
                   java.rmi.RemoteException
Receive constructor, for binary loading from ganymede.db.


DBObjectBaseField

DBObjectBaseField(arlut.csd.ganymede.DBObjectBaseField original,
                  arlut.csd.ganymede.DBSchemaEdit editor)
            throws java.rmi.RemoteException

Copy constructor, used during schema editing.

IMPORTANT: BE SURE TO ALWAYS EDIT THIS METHOD IF YOU ADD ANY FIELDS TO THIS CLASS!

Method Detail

emit

void emit(java.io.DataOutput out)
    throws java.io.IOException

This method is used when the database is being dumped, to write out this field definition to disk. It is mated with receive().

java.io.IOException

receive

void receive(java.io.DataInput in)
       throws java.io.IOException

This method is used when the database is being loaded, to read in this field definition from disk. It is mated with emit().

java.io.IOException

emitXML

void emitXML(arlut.csd.ganymede.XMLDumpContext xmlOut)
       throws java.io.IOException

This method is used when the database is being dumped, to write out this field definition to disk. It is mated with receive().

java.io.IOException

setXML

arlut.csd.ganymede.ReturnVal setXML(arlut.csd.Util.XMLItem root,
                                    boolean doLinkResolve,
                                    java.io.PrintWriter err)

This method is used to read the definition for this DBObjectBaseField from a <fielddef> XMLItem tree.


doStringXML

private arlut.csd.ganymede.ReturnVal doStringXML(arlut.csd.Util.XMLItem root)

This method takes care of doing everything required to take an XMLItem tree <fielddef type="string"> and update this field's schema information to match.

Returns:
A failure ReturnVal if the schema for this field could not be set to match.

doBooleanXML

private arlut.csd.ganymede.ReturnVal doBooleanXML(arlut.csd.Util.XMLItem root)

This method takes care of doing everything required to take an XMLItem tree <fielddef type="boolean"> and update this field's schema information to match.

Returns:
A failure ReturnVal if the schema for this field could not be set to match.

doPasswordXML

private arlut.csd.ganymede.ReturnVal doPasswordXML(arlut.csd.Util.XMLItem root)

This method takes care of doing everything required to take an XMLItem tree <fielddef type="password"> and update this field's schema information to match.

Returns:
A failure ReturnVal if the schema for this field could not be set to match.

doIPXML

private arlut.csd.ganymede.ReturnVal doIPXML(arlut.csd.Util.XMLItem root)

This method takes care of doing everything required to take an XMLItem tree <fielddef type="ip"> and update this field's schema information to match.

Returns:
A failure ReturnVal if the schema for this field could not be set to match.

doNumericXML

private arlut.csd.ganymede.ReturnVal doNumericXML(arlut.csd.Util.XMLItem root)

This method takes care of doing everything required to take an XMLItem tree <fielddef type="numeric"> and update this field's schema information to match.

Returns:
A failure ReturnVal if the schema for this field could not be set to match.

doInvidXML

private arlut.csd.ganymede.ReturnVal doInvidXML(arlut.csd.Util.XMLItem root,
                                                boolean doLinkResolve)

This method takes care of doing everything required to take an XMLItem tree <fielddef type="invid"> and update this field's schema information to match.

Returns:
A failure ReturnVal if the schema for this field could not be set to match.

isEditable

public boolean isEditable()

This method returns true if this field definition can be edited in the schema editor.

This method will return false for the built-in universal field types that the server is dependent on for its own functioning, because those really have no reason to be edited at all.. even the field names needn't be edited by anyone, since they aren't shown in the client.

See Also:
BaseField

isBuiltIn

public boolean isBuiltIn()

This method returns true if this field is one of the system fields present in all objects.

Specified by:
isBuiltIn in interface BaseField

isRemovable

public boolean isRemovable()

This method returns true if this field definition can be removed by the schema editor.

Specified by:
isRemovable in interface BaseField
See Also:
BaseField

isVisible

public boolean isVisible()

This method returns true if this field is intended to be visible to the client normally, false otherwise.

Specified by:
isVisible in interface BaseField
See Also:
BaseField

isInUse

public boolean isInUse()

This method returns true if there are any fields of this type in the database. The schema editing system uses this method to prevent incompatible modifications to fields that are in use in the database.

Specified by:
isInUse in interface BaseField
See Also:
BaseField

getBase

public arlut.csd.ganymede.Base getBase()

Returns the Base we are a part of.

Specified by:
getBase in interface BaseField
See Also:
BaseField

getTemplate

public arlut.csd.ganymede.FieldTemplate getTemplate()

Returns a FieldTemplate serializable field definition object for this field.


getName

public java.lang.String getName()

Returns the name of this field

Specified by:
getName in interface BaseField
See Also:
BaseField

setName

public arlut.csd.ganymede.ReturnVal setName(java.lang.String name)

Sets the name of this field

Specified by:
setName in interface BaseField
Parameters:
name - The new name to put in this field
See Also:
BaseField

setName

public arlut.csd.ganymede.ReturnVal setName(java.lang.String name,
                                            boolean swapIfNeeded)

Sets the name of this field

Parameters:
name - The new name to put in this field
swapIfNeeded - If true, attempting to set this field's name to a name that is already taken in the object will result in this field's taking the new name from the other field and giving that other field its own name. Only intended for use by setXML(), which has higher-level code to check for uniqueness of names in an XML schema definition.

getClassName

public java.lang.String getClassName()

Returns the name of the class managing instances of this field

Specified by:
getClassName in interface BaseField
See Also:
BaseField

setClassName

public arlut.csd.ganymede.ReturnVal setClassName(java.lang.String name)

Sets the name of the class managing instances of this field

Specified by:
setClassName in interface BaseField
See Also:
BaseField

getClassDef

public java.lang.Class getClassDef()

Returns the Class object managing instances of this field


getComment

public java.lang.String getComment()

Returns the comment defined in the schema for this field

Specified by:
getComment in interface BaseField
See Also:
BaseField

setComment

public arlut.csd.ganymede.ReturnVal setComment(java.lang.String s)

Sets the comment defined in the schema for this field

Specified by:
setComment in interface BaseField
See Also:
BaseField

getType

public short getType()

Returns the field type

Where type is one of the following constants defined in the FieldType interface:

   static short BOOLEAN = 0;
   static short NUMERIC = 1;
   static short DATE = 2;
   static short STRING = 3;
   static short INVID = 4;
   static short PERMISSIONMATRIX = 5;
   static short PASSWORD = 6;
   static short IP = 7;
   static short FLOAT = 8;
 

Specified by:
getType in interface BaseField
See Also:
DBStore, BaseField

setType

public arlut.csd.ganymede.ReturnVal setType(short type)

Sets the field type for this field. Changing the basic type of a field that is already being used in the server will cause very bad things to happen. The right way to change an existing field is to delete the field, commit the schema edit, edit the schema again, and recreate the field with the desired field type.

If the new field type is not string, invid, or IP, the field will be made a scalar field.

Specified by:
setType in interface BaseField
See Also:
BaseField

isBoolean

public boolean isBoolean()

Returns true if this field is of boolean type

Specified by:
isBoolean in interface BaseField
See Also:
BaseField

isNumeric

public boolean isNumeric()

Returns true if this field is of numeric type

Specified by:
isNumeric in interface BaseField
See Also:
BaseField

isFloat

public boolean isFloat()

Returns true if this field is of float type

Specified by:
isFloat in interface BaseField
See Also:
BaseField

isDate

public boolean isDate()

Returns true if this field is of date type

Specified by:
isDate in interface BaseField
See Also:
BaseField

isString

public boolean isString()

Returns true if this field is of string type

Specified by:
isString in interface BaseField
See Also:
BaseField

isInvid

public boolean isInvid()

Returns true if this field is of invid type

Specified by:
isInvid in interface BaseField
See Also:
BaseField

isPermMatrix

public boolean isPermMatrix()

Returns true if this field is of permission matrix type

Specified by:
isPermMatrix in interface BaseField
See Also:
BaseField

isPassword

public boolean isPassword()

Returns true if this field is of password type

Specified by:
isPassword in interface BaseField
See Also:
BaseField

isIP

public boolean isIP()

Returns true if this field is of IP type

Specified by:
isIP in interface BaseField
See Also:
BaseField

isArray

public boolean isArray()

Returns true if this field is a vector field, false otherwise.

Specified by:
isArray in interface BaseField
See Also:
BaseField

setArray

public arlut.csd.ganymede.ReturnVal setArray(boolean b)

Set this field to be a vector or scalar. If b is true, this field will be a vector, if false, scalar.

Only strings, invid's, and ip fields may be vectors. Attempting to setArray(true) for other field types will cause an IllegalArgumentException to be thrown.

It may be possible to compatibly handle the conversion from scalar to vector, but a vector to scalar change is an incompatible change.

Specified by:
setArray in interface BaseField
See Also:
BaseField

getID

public short getID()

Returns id code for this field. Each field in a DBObject has a unique code which identifies the field. This code represents the field in the on-disk data store, and is used by DBEditObject to choose what field to change in the setField method.

Specified by:
getID in interface BaseField
See Also:
BaseField

setID

public arlut.csd.ganymede.ReturnVal setID(short id)

This method is used to set this field's id in the containing DBObjectBase. This method will return a failure if an id is selected which is already in use in another field in this object definition.


getKey

public java.lang.Short getKey()

Returns the type id for this field definition as a Short, suitable for use in a hash.


base

public arlut.csd.ganymede.DBObjectBase base()

Returns the object definition that this field is defined under.


setBase

arlut.csd.ganymede.ReturnVal setBase(arlut.csd.ganymede.DBObjectBase base)

getMaxArraySize

public short getMaxArraySize()

Returns the array size limitation for this field if it is an array field

Specified by:
getMaxArraySize in interface BaseField
See Also:
BaseField

setMaxArraySize

public arlut.csd.ganymede.ReturnVal setMaxArraySize(short limit)

Set the maximum number of values allowed in this vector field.

Specified by:
setMaxArraySize in interface BaseField
See Also:
BaseField

isLabeled

public boolean isLabeled()

Returns true if this is a boolean field with labels

Specified by:
isLabeled in interface BaseField
See Also:
BaseField

setLabeled

public arlut.csd.ganymede.ReturnVal setLabeled(boolean b)

Turn labeled choices on/off for a boolean field.

This method will throw an IllegalArgumentException if this field definition is not a boolean type.

Specified by:
setLabeled in interface BaseField
See Also:
BaseField

getTrueLabel

public java.lang.String getTrueLabel()

Returns the true Label if this is a labeled boolean field

This method will throw an IllegalArgumentException if this field definition is not a labeled boolean type.

Specified by:
getTrueLabel in interface BaseField
See Also:
BaseField

setTrueLabel

public arlut.csd.ganymede.ReturnVal setTrueLabel(java.lang.String label)

Sets the label associated with the true choice for this boolean field.

This method will throw an IllegalArgumentException if this field definition is not a labeled boolean type.

Specified by:
setTrueLabel in interface BaseField
See Also:
BaseField

getFalseLabel

public java.lang.String getFalseLabel()

Returns the false Label if this is a labeled boolean field

This method will throw an IllegalArgumentException if this field definition is not a labeled boolean type.

Specified by:
getFalseLabel in interface BaseField
See Also:
BaseField

setFalseLabel

public arlut.csd.ganymede.ReturnVal setFalseLabel(java.lang.String label)

Sets the label associated with the false choice for this boolean field.

This method will throw an IllegalArgumentException if this field definition is not a labeled boolean type.

Specified by:
setFalseLabel in interface BaseField
See Also:
BaseField

getMinLength

public short getMinLength()

Returns the minimum acceptable string length if this is a string or password field.

This method will throw an IllegalArgumentException if this field definition is not a string or password type.

Specified by:
getMinLength in interface BaseField
See Also:
BaseField

setMinLength

public arlut.csd.ganymede.ReturnVal setMinLength(short val)

Sets the minimum acceptable length for this string or password field.

This method will throw an IllegalArgumentException if this field definition is not a string or password type.

Specified by:
setMinLength in interface BaseField
See Also:
BaseField

getMaxLength

public short getMaxLength()

Returns the maximum acceptable string length if this is a string or password field.

This method will throw an IllegalArgumentException if this field definition is not a string or password type.

Specified by:
getMaxLength in interface BaseField
See Also:
BaseField

setMaxLength

public arlut.csd.ganymede.ReturnVal setMaxLength(short val)

Sets the maximum acceptable length for this string or password field.

This method will throw an IllegalArgumentException if this field definition is not a string or password type.

Specified by:
setMaxLength in interface BaseField
See Also:
BaseField

getOKChars

public java.lang.String getOKChars()

Returns the set of acceptable characters if this is a string field.

This method will throw an IllegalArgumentException if this field definition is not a string or password type.

Specified by:
getOKChars in interface BaseField
See Also:
BaseField

setOKChars

public arlut.csd.ganymede.ReturnVal setOKChars(java.lang.String s)

Sets the set of characters that are allowed in this string or password field. If s is null, all characters by default are acceptable.

This method will throw an IllegalArgumentException if this field definition is not a string or password type.

Specified by:
setOKChars in interface BaseField
See Also:
BaseField

getBadChars

public java.lang.String getBadChars()

Returns the set of unacceptable characters if this is a string or password field.

This method will throw an IllegalArgumentException if this field definition is not a string or password type.

Specified by:
getBadChars in interface BaseField
See Also:
BaseField

setBadChars

public arlut.csd.ganymede.ReturnVal setBadChars(java.lang.String s)

Sets the set of characters that are specifically disallowed in this string or password field.

This method will throw an IllegalArgumentException if this field definition is not a string or password type.

Specified by:
setBadChars in interface BaseField
See Also:
BaseField

isMultiLine

public boolean isMultiLine()

Returns true if this string field is intended to be a multi-line field.

This method will throw an IllegalArgumentException if this field definition is not a string type.

Specified by:
isMultiLine in interface BaseField
See Also:
BaseField

setMultiLine

public arlut.csd.ganymede.ReturnVal setMultiLine(boolean b)

Sets whether or not this string field should be presented as a multiline field.

This method will throw an IllegalArgumentException if this field definition is not a string type.

Specified by:
setMultiLine in interface BaseField
See Also:
BaseField

getRegexpPat

public java.lang.String getRegexpPat()

Returns the regexp pattern string constraining this string field.

This method will throw an IllegalArgumentException if this field definition is not a string type.

Specified by:
getRegexpPat in interface BaseField
See Also:
BaseField

getRegexpDesc

public java.lang.String getRegexpDesc()

Returns the text description of the regexp pattern string constraining this string field.

This method will throw an IllegalArgumentException if this field definition is not a string type.

Specified by:
getRegexpDesc in interface BaseField
See Also:
BaseField

setRegexpPat

public arlut.csd.ganymede.ReturnVal setRegexpPat(java.lang.String s)

Sets the regexp pattern string constraining this string field.

This method will throw an IllegalArgumentException if this field definition is not a string type.

Specified by:
setRegexpPat in interface BaseField
See Also:
BaseField

setRegexpDesc

public arlut.csd.ganymede.ReturnVal setRegexpDesc(java.lang.String s)

Sets the text descriptionf or the regexp pattern string constraining this string field.

This method will throw an IllegalArgumentException if this field definition is not a string type.

Specified by:
setRegexpDesc in interface BaseField
See Also:
BaseField

getNameSpace

public arlut.csd.ganymede.DBNameSpace getNameSpace()

Returns the DBNameSpace that this string, numeric, or IP field is associated with.


getNameSpaceLabel

public java.lang.String getNameSpaceLabel()

Returns the label of this string, numeric, or IP field's namespace.

Specified by:
getNameSpaceLabel in interface BaseField
See Also:
BaseField

setNameSpace

public arlut.csd.ganymede.ReturnVal setNameSpace(java.lang.String nameSpaceId)

Set a namespace constraint for this string, numeric, or IP field.

Note that this is intended to be called from the Schema Editor, and won't take effect until the next time the system is stopped and reloaded.

This method will throw an IllegalArgumentException if this field definition is not a string, numeric, or IP type.

Specified by:
setNameSpace in interface BaseField
See Also:
BaseField

setNameSpace

arlut.csd.ganymede.ReturnVal setNameSpace(arlut.csd.ganymede.DBNameSpace newNamespace)

This method is used internally to set a namespace constraint.

It does not appear that this method is currently used.. rather that setNameSpace(string) is.

This method will throw an IllegalArgumentException if this field definition is not a string, numeric, or IP type.


isEditInPlace

public boolean isEditInPlace()

Returns true if this is an invid field which is intended as an editInPlace reference for the client's rendering.

Specified by:
isEditInPlace in interface BaseField
See Also:
BaseField

setEditInPlace

public arlut.csd.ganymede.ReturnVal setEditInPlace(boolean b)

Sets whether or not this field is intended as an editInPlace reference for the client's rendering.

This method will throw an IllegalArgumentException if this field definition is not an invid type.

Specified by:
setEditInPlace in interface BaseField
See Also:
BaseField

isTargetRestricted

public boolean isTargetRestricted()

Returns true if this is a target restricted invid field

This method will throw an IllegalArgumentException if this field definition is not an invid type.

Specified by:
isTargetRestricted in interface BaseField
See Also:
BaseField

getTargetBase

public short getTargetBase()

Return the object type that this invid field is constrained to point to, if set

-1 means there is no restriction on target type.

-2 means there is no restriction on target type, but there is a specified symmetric field.

This method will throw an IllegalArgumentException if this field definition is not an invid type.

Specified by:
getTargetBase in interface BaseField
See Also:
BaseField

setTargetBase

public arlut.csd.ganymede.ReturnVal setTargetBase(short val)

Sets the allowed target object code of this invid field to <val>. If val is -1, this invid field can point to objects of any type.

This method will throw an IllegalArgumentException if this field definition is not an invid type.

Specified by:
setTargetBase in interface BaseField
See Also:
BaseField

setTargetBase

public arlut.csd.ganymede.ReturnVal setTargetBase(java.lang.String baseName)

Sets the allowed target object code of this invid field to <baseName>. If val is null, this invid field can point to objects of any type.

This method will throw an IllegalArgumentException if this field definition is not an invid type.

Specified by:
setTargetBase in interface BaseField
See Also:
BaseField

isSymmetric

public boolean isSymmetric()

If this field is a target restricted invid field, this method will return true if this field has a symmetry relationship to the target

This method will throw an IllegalArgumentException if this field definition is not an invid type.

Specified by:
isSymmetric in interface BaseField
See Also:
BaseField

getTargetField

public short getTargetField()

If this field is a target restricted invid field, this method will return a short indicating the field in the target object that the symmetry relation applies to.

This method will throw an IllegalArgumentException if this field definition is not an invid type.

Specified by:
getTargetField in interface BaseField
See Also:
BaseField

setTargetField

public arlut.csd.ganymede.ReturnVal setTargetField(short val)

Sets the field of the target object of this invid field that should be managed in the symmetry relationship if isSymmetric(). If val == -1, the targetField will be set to a value representing no selection.

This method will throw an IllegalArgumentException if this field definition is not an invid type.

Specified by:
setTargetField in interface BaseField
See Also:
BaseField

setTargetField

public arlut.csd.ganymede.ReturnVal setTargetField(java.lang.String fieldName)

Sets the field of the target object of this invid field that should be managed in the symmetry relationship if isSymmetric(). If <fieldName> is null, the targetField will be cleared.

This method will throw an IllegalArgumentException if this field definition is not an invid type.

Specified by:
setTargetField in interface BaseField
See Also:
BaseField

isCrypted

public boolean isCrypted()

This method returns true if this is a password field that stores passwords in UNIX crypt format, and can thus accept pre-crypted passwords.

Specified by:
isCrypted in interface BaseField
See Also:
BaseField

setCrypted

public arlut.csd.ganymede.ReturnVal setCrypted(boolean b)

This method is used to specify that this password field should store passwords in UNIX crypt format. If passwords are stored in UNIX crypt format, they will not be kept in plaintext on disk, regardless of the setting of setPlainText().

setCrypted() is not mutually exclusive with setMD5Crypted().

This method will throw an IllegalArgumentException if this field definition is not a password type.

Specified by:
setCrypted in interface BaseField
See Also:
BaseField

isMD5Crypted

public boolean isMD5Crypted()

This method returns true if this is a password field that stores passwords in OpenBSD/FreeBSD/PAM md5crypt() format, and can thus accept pre-crypted passwords.

Specified by:
isMD5Crypted in interface BaseField
See Also:
BaseField

setMD5Crypted

public arlut.csd.ganymede.ReturnVal setMD5Crypted(boolean b)

This method is used to specify that this password field should store passwords in OpenBSD/FreeBSD/PAM md5crypt() format. If passwords are stored in md5crypt() format, they will not be kept in plaintext on disk, unless isPlainText() returns true.

setMD5Crypted() is not mutually exclusive with any other encryption or plaintext options.

This method will throw an IllegalArgumentException if this field definition is not a password type.

Specified by:
setMD5Crypted in interface BaseField
See Also:
BaseField

isApacheMD5Crypted

public boolean isApacheMD5Crypted()

This method returns true if this is a password field that stores passwords in Apache md5crypt() format, and can thus accept pre-crypted passwords.

Specified by:
isApacheMD5Crypted in interface BaseField
See Also:
BaseField

setApacheMD5Crypted

public arlut.csd.ganymede.ReturnVal setApacheMD5Crypted(boolean b)

This method is used to specify that this password field should store passwords in Apache md5crypt() format. If passwords are stored in Apache md5crypt() format, they will not be kept in plaintext on disk, unless isPlainText() returns true.

setApacheMD5Crypted() is not mutually exclusive with any other encryption or plaintext options.

This method will throw an IllegalArgumentException if this field definition is not a password type.

Specified by:
setApacheMD5Crypted in interface BaseField
See Also:
BaseField

isWinHashed

public boolean isWinHashed()

This method returns true if this is a password field that will store passwords in the two hashing formats used by Samba/Windows, the older 14-char LANMAN hash, and the newer md5/Unicode hash used by Windows NT. If passwords are stored in the windows hashing formats, they will not be kept in plaintext on disk, unless isPlainText() returns true.

Specified by:
isWinHashed in interface BaseField
See Also:
BaseField

setWinHashed

public arlut.csd.ganymede.ReturnVal setWinHashed(boolean b)

This method is used to specify that this password field should store passwords in the Samba/Windows hashing formats.

setWinHashed() is not mutually exclusive with any other encryption or plaintext options.

This method will throw an IllegalArgumentException if this field definition is not a password type.

Specified by:
setWinHashed in interface BaseField
See Also:
BaseField

isPlainText

public boolean isPlainText()

This method returns true if this is a password field that will keep a copy of the password in plaintext in the Ganymede server's on-disk database.

Specified by:
isPlainText in interface BaseField
See Also:
BaseField

setPlainText

public arlut.csd.ganymede.ReturnVal setPlainText(boolean b)

This method is used to specify that this password field should keep a copy of the password in plaintext on disk, even if other hash methods are in use which could be used for Ganymede login authentication. If no hash methods are enabled for this password field, plaintext will be stored on disk even if isPlainText() returns false for this field definition.

This method will throw an IllegalArgumentException if this field definition is not a password type.

Specified by:
setPlainText in interface BaseField
See Also:
BaseField

isSystemField

private boolean isSystemField()

This method checks to see if this DBObjectBaseField corresponds to a system field


getTypeDesc

public java.lang.String getTypeDesc()

This method is intended to produce a human readable representation of this field definition's type attributes. This method should not be used programatically to determine this field's type information.

This method is only for human information, and the precise results returned are subject to change at any time.

Specified by:
getTypeDesc in interface BaseField
See Also:
BaseField

getTypeDescHTML

public java.lang.String getTypeDescHTML()

This method is intended to produce a human readable representation of this field definition's type attributes. This method should not be used programatically to determine this field's type information.

This method is only for human elucidation, and the precise results returned are subject to change at any time.

See Also:
BaseField

printHTML

public void printHTML(java.io.PrintWriter out)

This method is used when the Ganymede server dumps its schema. It prints an HTML description of this field type to the PrintWriter specified.

This method was written in concert with the other DBStore objects' printHTML methods, and assumes that it will be run in the context of the full DBStore.printCategoryTreeHTML() method.


print

public void print(java.io.PrintWriter out,
                  java.lang.String indent)

This method is used when the Ganymede server dumps its schema. It prints an ASCII description of this field type to the PrintWriter specified.

This method was written in concert with the other DBStore objects' print methods, and assumes that it will be run in the context of the full DBStore.printBases() method.


toString

public java.lang.String toString()
Overrides:
toString in class java.rmi.server.RemoteObject

genWarning1

private static arlut.csd.ganymede.ReturnVal genWarning1()

genWarning2

private static arlut.csd.ganymede.ReturnVal genWarning2()