arlut.csd.ganymede
Class GanymedeXMLSession

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--arlut.csd.ganymede.GanymedeXMLSession
All Implemented Interfaces:
java.rmi.Remote, java.lang.Runnable, java.rmi.server.Unreferenced, XMLSession

public final class GanymedeXMLSession
extends java.lang.Thread
implements XMLSession, java.rmi.server.Unreferenced

This class handles all XML loading operations for the Ganymede server. GanymedeXMLSession's are created by the GanymedeServer's xmlLogin() method. A GanymedeXMLSession is created on top of a GanymedeSession and interacts with the database through that session. A GanymedeXMLSession generally looks to the rest of the server like any other client, except that if the XML file contains a <ganyschema> section, the GanymedeXMLSession will attempt to manipulate the server's login semaphore to force the server into schema editing mode. This will fail if there are any remote clients connected to the server at the time the XML file is processed.

Once xmlLogin creates (and RMI exports) a GanymedeXMLSession, an xmlclient repeatedly calls the xmlSubmit() method, which writes the bytes received into a pipe. The GanymedeXMLSession's thread (also initiated by GanymedeServer.xmlLogin()) then loops, reading data off of the pipe with an XMLReader and doing various schema editing and data loading operations.

The <ganydata> processing section was originally written as part of xmlclient, and did all xml parsing on the client side and all data operations remotely over RMI. Pulling this logic into a server-side GanymedeXMLSession sped things up by a factor of 300 in my testing.


Field Summary
private  java.util.Vector basesToAdd
          This vector is used by the XML schema editing logic to track object types from the xml file that need to be added to the current schema.
private  java.util.Vector basesToEdit
          This vector is used by the XML schema editing logic to track object types from the xml file that need to be edited in the current schema.
private  java.util.Vector basesToRemove
          This vector is used by the XML schema editing logic to track object types in the current schema that were not mentioned in the xml file and thus need to be removed from the current schema.
 int bufferSize
          The default buffer size in the XMLReader.
private  arlut.csd.Util.XMLItem categoryTree
          This XMLItem is the XMLElement root of the category tree, rooted with the top-level <category> element.
private  java.util.Vector cleanedup
          We're using this Vector as a super-simple sempahore thingy, to gate the cleanup() method.
 java.util.Vector createdObjects
          Vector of xmlobjects that correspond to new Ganymede server objects that have been/need to be created by this GanymedeXMLSession.
static boolean debug
           
 java.util.Vector deletedObjects
          Vector of xmlobjects that correspond to pre-existing Ganymede server objects that have been/need to be deleted by this GanymedeXMLSession.
 java.util.Vector editedObjects
          Vector of xmlobjects that correspond to pre-existing Ganymede server objects that have been/need to be checked out for editing by this GanymedeXMLSession.
private  arlut.csd.ganymede.DBSchemaEdit editor
          If we are editing the server's schema from the XML source, this field will hold a reference to a DBSchemaEdit object.
 java.util.Vector embeddedObjects
          Vector of xmlobjects that correspond to Ganymede server objects that have been created/checked out for editing during embedded invid field processing, and which need to have their invid fields registered after everything else is done.
 java.io.PrintWriter err
          This PrintWriter is used to handle all debug/error output on behalf of the GanymedeXMLSession.
 java.io.StringWriter errBuf
          This StringWriter holds output generated by the GanymedeXMLSession's parser thread.
 java.util.Vector inactivatedObjects
          Vector of xmlobjects that correspond to pre-existing Ganymede server objects that have been/need to be inactivated by this GanymedeXMLSession.
static int majorVersion
          This major version number is compared with the "major" attribute in the Ganymede XML document element.
static int minorVersion
          This minor version number is compared with the "minor" attribute in the Ganymede XML document element.
private  arlut.csd.Util.XMLItem namespaceTree
          This XMLItem is the XMLElement root of the namespace tree, rooted with the <namespaces> element.
 java.util.Hashtable objectStore
          Hashtable mapping Short type ids to hashes which map local object designations to actual xmlobject records.
 java.util.Hashtable objectTypeIDs
          Hashtable mapping Short object type ids to hashtables mapping field names to FieldTemplate objects.
 java.util.Hashtable objectTypes
          Hashtable mapping object type names to hashtables mapping field names to FieldTemplate objects.
private  boolean parsing
          This flag is used to track whether the background parser thread is active.
(package private)  java.io.PipedOutputStream pipe
          The data stream used to write data from the client to the XML parser.
(package private)  arlut.csd.Util.XMLReader reader
          The XML parser object handling XML data from the client
static boolean schemadebug
           
(package private)  arlut.csd.ganymede.GanymedeSession session
          The working GanymedeSession underlying this XML session.
private  java.util.Vector spacesToAdd
          This vector is used by the XML schema editing logic to track namespaces from the xml file that need to be added to the current schema.
private  java.util.Vector spacesToEdit
          This vector is used by the XML schema editing logic to track namespaces from the xml file that need to be edited in the current schema.
private  java.util.Vector spacesToRemove
          This vector is used by the XML schema editing logic to track namespaces from the xml file that need to be removed from the current schema.
private  boolean success
          This flag is used to track whether the background parser thread was successful in committing the transaction.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
GanymedeXMLSession(arlut.csd.ganymede.GanymedeSession session)
           
 
Method Summary
 void abort()
          This method is for use on the server, and is called by the GanymedeSession to let us know if the server is forcing our login off.
 arlut.csd.ganymede.DBBaseCategory buildXMLCategories(arlut.csd.Util.XMLItem categoryRoot)
          This recursive method takes an XMLItem category tree and returns a new DBBaseCategory tree with all categories and object definitions from the XMLItem category tree ordered correctly.
private  boolean calculateBases()
          This method fills in basesToAdd, basesToRemove, and basesToEdit.
private  boolean calculateNameSpaces()
          This method fills in spacesToAdd, spacesToRemove, and spacesToEdit.
 void cleanup()
          Something to assist in garbage collection.
private  arlut.csd.ganymede.DBSchemaEdit editSchema()
          This is a copy of the editSchema method from the GanymedeAdmin class which has been modified so that it will assert a schema edit lock without requiring that the login semaphore count be zero.
private  void findBasesInXMLTree(arlut.csd.Util.XMLItem treeRoot, java.util.Vector foundBases)
          This is a recursive method to do a traversal of an XMLItem tree, adding object base definition roots found to the foundBases vector.
 java.util.Hashtable getFieldHash(java.lang.String objectTypeName)
          This helper method returns a hash of field names to FieldTemplate based on the underscore-for-space XML encoded object type name.
 arlut.csd.ganymede.FieldTemplate getFieldTemplate(short type, java.lang.String fieldName)
          This helper method takes a short object type id and an underscore-for-space XML encoded field name and returns the FieldTemplate for that field, if known.
 arlut.csd.ganymede.FieldTemplate getFieldTemplate(java.lang.Short type, java.lang.String fieldName)
          This helper method takes a short object type id and an underscore-for-space XML encoded field name and returns the FieldTemplate for that field, if known.
 arlut.csd.ganymede.Invid getInvid(short typeId, java.lang.String objId)
          This method resolves an Invid from a type/id pair, talking to the server if the type/id pair has not previously been seen.
 arlut.csd.ganymede.Invid getInvid(java.lang.String typename, int num)
          This method resolves an Invid from a type/num pair
 arlut.csd.Util.XMLItem getNextItem()
          Private helper method to process events from the XMLReader.
 arlut.csd.ganymede.xmlobject getObject(java.lang.Short baseID, java.lang.Integer objectNum)
          This method retrieves an xmlobject that has been previously loaded from the XML file.
 arlut.csd.ganymede.xmlobject getObject(java.lang.Short baseID, java.lang.String objectID)
          This method retrieves an xmlobject that has been previously loaded from the XML file.
 arlut.csd.ganymede.xmlobject getObject(java.lang.String baseName, java.lang.Integer objectNum)
          This method retrieves an xmlobject that has been previously loaded from the XML file.
 arlut.csd.ganymede.xmlobject getObject(java.lang.String baseName, java.lang.String objectID)
          This method retrieves an xmlobject that has been previously loaded from the XML file.
 arlut.csd.ganymede.FieldTemplate getObjectFieldType(java.util.Hashtable fieldHash, java.lang.String fieldName)
          This helper method takes a hash of field names to FieldTemplate and an underscore-for-space XML encoded field name and returns the FieldTemplate for that field, if known.
private  arlut.csd.ganymede.ReturnVal getReturnVal(java.lang.String message, boolean success)
          This private helper method creates a ReturnVal object to be passed back to the xmlclient.
 java.util.Vector getTemplateVector(short type)
           
 java.util.Vector getTemplateVector(java.lang.Short type)
           
 java.lang.String getTypeName(short objectTypeID)
          This helper method returns the object type string for an object type based on its short object type ID number.
 short getTypeNum(java.lang.String objectTypeName)
          This helper method returns the short id number of an object type based on its underscore-for-space encoded XML object type name.
private  boolean handleBaseRenaming()
          This private method takes care of doing any object type renaming, prior to resolving invid field definitions.
private  boolean handleReturnVal(arlut.csd.ganymede.ReturnVal retval)
          Private helper method to print to the client the text of any return val dialog.
private  void incCount(java.util.Hashtable table, java.lang.String type)
          this private helper method increments a counting integer in table, keyed by type.
private  void initializeLookups()
          This private method handles data structures initialization for the GanymedeXMLSession, prepping hash lookups that are used to accelerate XML processing.
private  boolean integrateXMLTransaction()
          This method actually does the work of integrating our data into the DBStore.
 boolean processData()
          This method is called after the <ganydata> element has been read and consumes everything up to and including the matching </ganydata> element, if such is to be found.
 boolean processSchema(arlut.csd.Util.XMLItem ganySchemaItem)
          This method is called after the <ganyschema> element has been read and consumes everything up to and including the matching </ganyschema> element, if such is to be found.
 arlut.csd.ganymede.ReturnVal reshuffleCategories(arlut.csd.Util.XMLItem categoryRoot)
          This method is used by the XML schema editing code in GanymedeXMLSession to fix up the category tree to match that specified in the XML <ganyschema> element.
 void run()
          This method handles the actual XML processing in the background.
 boolean storeObject(arlut.csd.ganymede.xmlobject object)
          This method records an xmlobject that has been loaded from the XML file into the GanymedeXMLSession objectStore hash.
 boolean testXMLCategories(arlut.csd.Util.XMLItem categoryRoot, java.util.Hashtable names)
          This method tests an XML category tree to make sure that all categories in the tree have unique names.
 void unreferenced()
          This method is called when the Java RMI system detects that this remote object is no longer referenced by any remote objects.
 arlut.csd.ganymede.ReturnVal xmlEnd()
          This method is called by the XML client once the end of the XML stream has been transmitted, whereupon the server will attempt to finalize the XML transaction and return an overall success or failure message in the ReturnVal.
 arlut.csd.ganymede.ReturnVal xmlSubmit(byte[] bytes)
          This method is called repeatedly by the XML client in order to send the next packet of XML data to the server.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debug

public static final boolean debug
See Also:
Constant Field Values

schemadebug

public static final boolean schemadebug
See Also:
Constant Field Values

majorVersion

public static final int majorVersion

This major version number is compared with the "major" attribute in the Ganymede XML document element. We won't try to read Ganymede XML files whose major and/or minor numbers are too high.

See Also:
Constant Field Values

minorVersion

public static final int minorVersion

This minor version number is compared with the "minor" attribute in the Ganymede XML document element. We won't try to read Ganymede XML files whose major and/or minor numbers are too high.

See Also:
Constant Field Values

session

arlut.csd.ganymede.GanymedeSession session

The working GanymedeSession underlying this XML session.


reader

arlut.csd.Util.XMLReader reader

The XML parser object handling XML data from the client


pipe

java.io.PipedOutputStream pipe

The data stream used to write data from the client to the XML parser.


bufferSize

public int bufferSize

The default buffer size in the XMLReader. This value determines how far ahead the XMLReader's i/o thread can get in reading from the XML file. Higher or lower values of this variable may give better performance, depending on the characteristics of the JVM with regards threading, etc.


objectTypes

public java.util.Hashtable objectTypes

Hashtable mapping object type names to hashtables mapping field names to FieldTemplate objects.


objectTypeIDs

public java.util.Hashtable objectTypeIDs

Hashtable mapping Short object type ids to hashtables mapping field names to FieldTemplate objects.


objectStore

public java.util.Hashtable objectStore

Hashtable mapping Short type ids to hashes which map local object designations to actual xmlobject records.


createdObjects

public java.util.Vector createdObjects

Vector of xmlobjects that correspond to new Ganymede server objects that have been/need to be created by this GanymedeXMLSession.


editedObjects

public java.util.Vector editedObjects

Vector of xmlobjects that correspond to pre-existing Ganymede server objects that have been/need to be checked out for editing by this GanymedeXMLSession.


embeddedObjects

public java.util.Vector embeddedObjects

Vector of xmlobjects that correspond to Ganymede server objects that have been created/checked out for editing during embedded invid field processing, and which need to have their invid fields registered after everything else is done.


inactivatedObjects

public java.util.Vector inactivatedObjects

Vector of xmlobjects that correspond to pre-existing Ganymede server objects that have been/need to be inactivated by this GanymedeXMLSession.


deletedObjects

public java.util.Vector deletedObjects

Vector of xmlobjects that correspond to pre-existing Ganymede server objects that have been/need to be deleted by this GanymedeXMLSession.


errBuf

public java.io.StringWriter errBuf

This StringWriter holds output generated by the GanymedeXMLSession's parser thread.


err

public java.io.PrintWriter err

This PrintWriter is used to handle all debug/error output on behalf of the GanymedeXMLSession.


parsing

private boolean parsing

This flag is used to track whether the background parser thread is active.

We set it true here so that we avoid any race conditions.


success

private boolean success

This flag is used to track whether the background parser thread was successful in committing the transaction.


editor

private arlut.csd.ganymede.DBSchemaEdit editor

If we are editing the server's schema from the XML source, this field will hold a reference to a DBSchemaEdit object.


spacesToAdd

private java.util.Vector spacesToAdd

This vector is used by the XML schema editing logic to track namespaces from the xml file that need to be added to the current schema. Elements in this vector are empty XMLElements that contain name and optional case-sensitive attributes.


spacesToRemove

private java.util.Vector spacesToRemove

This vector is used by the XML schema editing logic to track namespaces from the xml file that need to be removed from the current schema. Elements in this vector are Strings representing the level of name spaces to be deleted..


spacesToEdit

private java.util.Vector spacesToEdit

This vector is used by the XML schema editing logic to track namespaces from the xml file that need to be edited in the current schema. Since namespaces can only be edited in the sense of toggling the case sensitivity flag, this vector will only contain XMLElements for namespaces that need to have their case sensitivity toggled. Elements in this vector are empty XMLElements that contain name and optional case-sensitive attributes.


basesToAdd

private java.util.Vector basesToAdd

This vector is used by the XML schema editing logic to track object types from the xml file that need to be added to the current schema. Elements in this vector are XMLItem trees rooted with the appropriate <objectdef> elements.


basesToRemove

private java.util.Vector basesToRemove

This vector is used by the XML schema editing logic to track object types in the current schema that were not mentioned in the xml file and thus need to be removed from the current schema. Elements of this vector are the names of existing bases to be removed.


basesToEdit

private java.util.Vector basesToEdit

This vector is used by the XML schema editing logic to track object types from the xml file that need to be edited in the current schema. Elements in this vector are XMLItem trees rooted with the appropriate <objectdef> elements.


namespaceTree

private arlut.csd.Util.XMLItem namespaceTree

This XMLItem is the XMLElement root of the namespace tree, rooted with the <namespaces> element. Children of this node will be <namespace> elements.


categoryTree

private arlut.csd.Util.XMLItem categoryTree

This XMLItem is the XMLElement root of the category tree, rooted with the top-level <category> element. Children of this node will be either <category> or <objectdef> elements.


cleanedup

private java.util.Vector cleanedup

We're using this Vector as a super-simple sempahore thingy, to gate the cleanup() method.

Constructor Detail

GanymedeXMLSession

public GanymedeXMLSession(arlut.csd.ganymede.GanymedeSession session)
Method Detail

xmlSubmit

public arlut.csd.ganymede.ReturnVal xmlSubmit(byte[] bytes)

This method is called repeatedly by the XML client in order to send the next packet of XML data to the server. If the server has detected any errors in the already-received XML stream, xmlSubmit() may return a non-null ReturnVal with a description of the failure. Otherwise, the xmlSubmit() method will enqueue the XML data for the server's continued processing and immediately return a null value, indicating success. The xmlSubmit() method will only block if the server has filled up its internal buffers and must wait to digest more of the already submitted XML.

Specified by:
xmlSubmit in interface XMLSession

xmlEnd

public arlut.csd.ganymede.ReturnVal xmlEnd()

This method is called by the XML client once the end of the XML stream has been transmitted, whereupon the server will attempt to finalize the XML transaction and return an overall success or failure message in the ReturnVal. The xmlEnd() method will block until the server finishes processing all the XML data previously submitted by xmlSubmit().

This method is synchronized to cause it to block until the background parser completes.

Specified by:
xmlEnd in interface XMLSession

abort

public void abort()

This method is for use on the server, and is called by the GanymedeSession to let us know if the server is forcing our login off.

Specified by:
abort in interface XMLSession

unreferenced

public void unreferenced()

This method is called when the Java RMI system detects that this remote object is no longer referenced by any remote objects.

This method handles abnormal logouts and time outs for us. By default, the 1.1 RMI time-out is 10 minutes.

Specified by:
unreferenced in interface java.rmi.server.Unreferenced
See Also:
Unreferenced

cleanup

public void cleanup()
Something to assist in garbage collection.


run

public void run()

This method handles the actual XML processing in the background. All activity which ultimately draws from the XMLReader will block as necessary to wait for more data from the client.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

getNextItem

public arlut.csd.Util.XMLItem getNextItem()
                                   throws org.xml.sax.SAXException

Private helper method to process events from the XMLReader. By using this method, the rest of the code in GanymedeXMLSession doesn't have to check for error and warning conditions.

org.xml.sax.SAXException

processSchema

public boolean processSchema(arlut.csd.Util.XMLItem ganySchemaItem)
                      throws org.xml.sax.SAXException

This method is called after the <ganyschema> element has been read and consumes everything up to and including the matching </ganyschema> element, if such is to be found. Eventually, this method will actually process the contents of the <ganyschema> element and transmit the schema change information to the server.

org.xml.sax.SAXException

calculateNameSpaces

private boolean calculateNameSpaces()

This method fills in spacesToAdd, spacesToRemove, and spacesToEdit.


calculateBases

private boolean calculateBases()

This method fills in basesToAdd, basesToRemove, and basesToEdit.


findBasesInXMLTree

private void findBasesInXMLTree(arlut.csd.Util.XMLItem treeRoot,
                                java.util.Vector foundBases)

This is a recursive method to do a traversal of an XMLItem tree, adding object base definition roots found to the foundBases vector.


handleBaseRenaming

private boolean handleBaseRenaming()
                            throws java.rmi.RemoteException

This private method takes care of doing any object type renaming, prior to resolving invid field definitions.

java.rmi.RemoteException

reshuffleCategories

public arlut.csd.ganymede.ReturnVal reshuffleCategories(arlut.csd.Util.XMLItem categoryRoot)

This method is used by the XML schema editing code in GanymedeXMLSession to fix up the category tree to match that specified in the XML <ganyschema> element.


testXMLCategories

public boolean testXMLCategories(arlut.csd.Util.XMLItem categoryRoot,
                                 java.util.Hashtable names)

This method tests an XML category tree to make sure that all categories in the tree have unique names.


buildXMLCategories

public arlut.csd.ganymede.DBBaseCategory buildXMLCategories(arlut.csd.Util.XMLItem categoryRoot)

This recursive method takes an XMLItem category tree and returns a new DBBaseCategory tree with all categories and object definitions from the XMLItem category tree ordered correctly.


processData

public boolean processData()
                    throws org.xml.sax.SAXException

This method is called after the <ganydata> element has been read and consumes everything up to and including the matching </ganydata> element, if such is to be found.

Before starting to read data from the <ganydata> element, this method communicates with the Ganymede server database through the normal client Session interface.

The contents of <ganydata> are scanned, and an in-memory datastructure is constructed in the GanymedeXMLSession. All objects are organized in memory by type and id, and inter-object invid references are resolved to the extent possible.

If all of that succeeds, processData() will start a transaction on the server, and will start transferring the data from the XML file's <ganydata> element into the database. If any errors are reported, the returned error message is printed and processData aborts. If no errors are reported at this stage, a transaction commit is attempted. Once again, if there are any errors reported from the server, they are printed and processData aborts. Otherwise, success!

org.xml.sax.SAXException

initializeLookups

private void initializeLookups()

This private method handles data structures initialization for the GanymedeXMLSession, prepping hash lookups that are used to accelerate XML processing.


storeObject

public boolean storeObject(arlut.csd.ganymede.xmlobject object)

This method records an xmlobject that has been loaded from the XML file into the GanymedeXMLSession objectStore hash.

This method returns false if the object to be stored has an id conflict with a previously stored object.


getInvid

public arlut.csd.ganymede.Invid getInvid(short typeId,
                                         java.lang.String objId)

This method resolves an Invid from a type/id pair, talking to the server if the type/id pair has not previously been seen.

Returns null on failure to retrieve.

Parameters:
typeId - The object type number of the invid to find
objId - The unique label of the object

getInvid

public arlut.csd.ganymede.Invid getInvid(java.lang.String typename,
                                         int num)

This method resolves an Invid from a type/num pair

Returns null on failure to retrieve.

Parameters:
typename - The name of the object type, in XML encoded form
num - The numeric id of

getObject

public arlut.csd.ganymede.xmlobject getObject(java.lang.String baseName,
                                              java.lang.String objectID)

This method retrieves an xmlobject that has been previously loaded from the XML file.

Parameters:
baseName - An XML-encoded object type string
objectID - The id string for the object in question

getObject

public arlut.csd.ganymede.xmlobject getObject(java.lang.Short baseID,
                                              java.lang.String objectID)

This method retrieves an xmlobject that has been previously loaded from the XML file.

Parameters:
baseID - a Short holding the number of object type sought
objectID - The id string for the object in question

getObject

public arlut.csd.ganymede.xmlobject getObject(java.lang.String baseName,
                                              java.lang.Integer objectNum)

This method retrieves an xmlobject that has been previously loaded from the XML file.

Parameters:
baseName - An XML-encoded object type string
objectNum - The Integer object number for the object sought

getObject

public arlut.csd.ganymede.xmlobject getObject(java.lang.Short baseID,
                                              java.lang.Integer objectNum)

This method retrieves an xmlobject that has been previously loaded from the XML file.

Parameters:
baseID - a Short holding the number of object type sought
objectNum - The Integer object number for the object sought

getTypeNum

public short getTypeNum(java.lang.String objectTypeName)

This helper method returns the short id number of an object type based on its underscore-for-space encoded XML object type name.

If the named object type cannot be found, a NullPointerException will be thrown.


getTypeName

public java.lang.String getTypeName(short objectTypeID)

This helper method returns the object type string for an object type based on its short object type ID number.

If the named object type cannot be found, a NullPointerException will be thrown.


getFieldHash

public java.util.Hashtable getFieldHash(java.lang.String objectTypeName)

This helper method returns a hash of field names to FieldTemplate based on the underscore-for-space XML encoded object type name.

The Hashtable returned by this method is intended to be used with the getObjectFieldType method.


getObjectFieldType

public arlut.csd.ganymede.FieldTemplate getObjectFieldType(java.util.Hashtable fieldHash,
                                                           java.lang.String fieldName)

This helper method takes a hash of field names to FieldTemplate and an underscore-for-space XML encoded field name and returns the FieldTemplate for that field, if known. If not, null is returned.


getFieldTemplate

public arlut.csd.ganymede.FieldTemplate getFieldTemplate(short type,
                                                         java.lang.String fieldName)

This helper method takes a short object type id and an underscore-for-space XML encoded field name and returns the FieldTemplate for that field, if known. If not, null is returned.


getFieldTemplate

public arlut.csd.ganymede.FieldTemplate getFieldTemplate(java.lang.Short type,
                                                         java.lang.String fieldName)

This helper method takes a short object type id and an underscore-for-space XML encoded field name and returns the FieldTemplate for that field, if known. If not, null is returned.


getTemplateVector

public java.util.Vector getTemplateVector(java.lang.Short type)

getTemplateVector

public java.util.Vector getTemplateVector(short type)

integrateXMLTransaction

private boolean integrateXMLTransaction()

This method actually does the work of integrating our data into the DBStore.


incCount

private void incCount(java.util.Hashtable table,
                      java.lang.String type)
this private helper method increments a counting integer in table, keyed by type.


getReturnVal

private arlut.csd.ganymede.ReturnVal getReturnVal(java.lang.String message,
                                                  boolean success)

This private helper method creates a ReturnVal object to be passed back to the xmlclient. Any text printed to the err object will be included in the ReturnVal object, followed by the content of message, if any. If success is true, the ReturnVal returned will encode that. If success is false, the returned ReturnVal will indicate failure.


editSchema

private arlut.csd.ganymede.DBSchemaEdit editSchema()

This is a copy of the editSchema method from the GanymedeAdmin class which has been modified so that it will assert a schema edit lock without requiring that the login semaphore count be zero. This way we can get a DBSchemaEdit context that we can use to do XML-based schema editing without having to have dropped our GanymedeSession's semaphore increment. This is safe to do only because we know that the GanymedeXMLSession is single-threaded and will not do any database activity while the schema is opened for editing.

Returns:
null if the server could not be put into schema edit mode.

handleReturnVal

private boolean handleReturnVal(arlut.csd.ganymede.ReturnVal retval)

Private helper method to print to the client the text of any return val dialog. Returns true if the retval codes for success, false otherwise.