arlut.csd.ganymede
Class XMLDumpContext

java.lang.Object
  |
  +--arlut.csd.ganymede.XMLDumpContext

public class XMLDumpContext
extends java.lang.Object

This class is used on the server to group parameters that will guide the server in doing an XML dump.


Field Summary
(package private)  boolean dumpCreatorModifierInfo
          If true, the Ganymede server thread using this XMLDumpContext will include the four standard history fields for each object in the emitted XML file.
(package private)  boolean dumpPlaintextPasswords
          If true, the Ganymede server thread using this XMLDumpContext will include plaintext passwords to the emitted XML file whenever possible
(package private)  int indentLevel
           
(package private)  com.jclark.xml.output.XMLWriter xmlOut
           
 
Constructor Summary
XMLDumpContext(com.jclark.xml.output.XMLWriter xmlOut, boolean passwords, boolean historyInfo)
          Main constructor
 
Method Summary
 void attribute(java.lang.String name, java.lang.String value)
          Writes an attribute.
 void cdataSection(java.lang.String content)
          Writes a CDATA section.
 void characterReference(int n)
          Writes a character reference.
 void close()
           
 void comment(java.lang.String body)
          Writes a comment.
 boolean doDumpHistoryInfo()
          Returns true if this XMLDumpContext is configured to dump creation and modification information when writing out object records.
 boolean doDumpPlaintext()
          Returns true if this XMLDumpContext is configured to dump plaintext password information to disk when a password field has enough information in crypt() or md5Crypt() form that the Ganymede server would be able to load and authenticate against a non-plaintext version of the password.
 void endAttribute()
          Ends an attribute.
 void endElement(java.lang.String name)
          Ends an element.
 void endElementIndent(java.lang.String name)
          Ends an element, indenting before emitting the end tag.
 void endReplacementText()
          Ends the replacement text for an internal entity.
 void entityReference(boolean isParam, java.lang.String name)
          Writes an entity reference.
 int getIndent()
          Returns the current indentation level.
 com.jclark.xml.output.XMLWriter getWriter()
           
 void indent()
           
 void indentIn()
          Decreases the indent level one step.
 void indentOut()
          Increase the indent level one step.
 void markup(java.lang.String str)
          Writes markup.
 void processingInstruction(java.lang.String target, java.lang.String data)
          Writes a processing instruction.
 void setIndentLevel(int x)
          This method directly sets the indention level for subsequent indent(), startElementIndent(), and endElementIndent() calls.
 void skipLine()
           
 void startAttribute(java.lang.String name)
          Starts an attribute.
 void startElement(java.lang.String name)
          Starts an element.
 void startElementIndent(java.lang.String name)
          Starts an element, indented according to the current indent level.
 void startReplacementText()
          Starts the replacement text for an internal entity.
 void write(java.lang.String str)
           
 com.jclark.xml.output.XMLWriter writer()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

dumpPlaintextPasswords

boolean dumpPlaintextPasswords

If true, the Ganymede server thread using this XMLDumpContext will include plaintext passwords to the emitted XML file whenever possible


dumpCreatorModifierInfo

boolean dumpCreatorModifierInfo

If true, the Ganymede server thread using this XMLDumpContext will include the four standard history fields for each object in the emitted XML file.


xmlOut

com.jclark.xml.output.XMLWriter xmlOut

indentLevel

int indentLevel
Constructor Detail

XMLDumpContext

public XMLDumpContext(com.jclark.xml.output.XMLWriter xmlOut,
                      boolean passwords,
                      boolean historyInfo)

Main constructor

Parameters:
xmlOut - The XMLWriter to write to
passwords - Include plaintext passwords in password field dumps, even if the password field includes UNIX crypt() or md5Crypt() passwords that could be depended on for authentication without having to reveal the plaintext.
historyInfo - If true, all objects dumped out using this XMLDumpContext will include creator and modification information.
Method Detail

getWriter

public com.jclark.xml.output.XMLWriter getWriter()

writer

public com.jclark.xml.output.XMLWriter writer()

indentOut

public void indentOut()

Increase the indent level one step. Successive indent(), startElementIndent(), and endElementIndent() method calls will indent one level further.

This method itself produces no output.


indentIn

public void indentIn()

Decreases the indent level one step. Successive indent(), startElementIndent(), and endElementIndent() method calls will decrease one level fiewer.

This method itself produces no output.


setIndentLevel

public void setIndentLevel(int x)

This method directly sets the indention level for subsequent indent(), startElementIndent(), and endElementIndent() calls.


getIndent

public int getIndent()

Returns the current indentation level.


indent

public void indent()
            throws java.io.IOException

skipLine

public void skipLine()
              throws java.io.IOException

doDumpPlaintext

public boolean doDumpPlaintext()

Returns true if this XMLDumpContext is configured to dump plaintext password information to disk when a password field has enough information in crypt() or md5Crypt() form that the Ganymede server would be able to load and authenticate against a non-plaintext version of the password.


doDumpHistoryInfo

public boolean doDumpHistoryInfo()

Returns true if this XMLDumpContext is configured to dump creation and modification information when writing out object records.


startElementIndent

public void startElementIndent(java.lang.String name)
                        throws java.io.IOException
Starts an element, indented according to the current indent level. This may be followed by zero or more calls to attribute. The start-tag will be closed by the first following call to any method other than attribute.

startElement

public void startElement(java.lang.String name)
                  throws java.io.IOException
Starts an element. This may be followed by zero or more calls to attribute. The start-tag will be closed by the first following call to any method other than attribute.

attribute

public void attribute(java.lang.String name,
                      java.lang.String value)
               throws java.io.IOException
Writes an attribute. This is not legal if there have been calls to methods other than attribute since the last call to startElement, unless inside a startAttribute, endAttribute pair.

startAttribute

public void startAttribute(java.lang.String name)
                    throws java.io.IOException
Starts an attribute. This writes the attribute name, = and the opening quote. This provides an alternative to attribute that allows markup to be included in the attribute value. The value of the attribute is written using the normal write methods; endAttribute must be called at the end of the attribute value. Entity and character references can be written using entityReference and characterReference.

endAttribute

public void endAttribute()
                  throws java.io.IOException
Ends an attribute. This writes the closing quote of the attribute value.

endElementIndent

public void endElementIndent(java.lang.String name)
                      throws java.io.IOException
Ends an element, indenting before emitting the end tag. If the element comprised no content between the startElement and endElement calls, aside from attributes, then endElement should be used. endElementIndent() will always put space between a start and end tag. This may output an end-tag or close the current start-tag as an empty element.

endElement

public void endElement(java.lang.String name)
                throws java.io.IOException
Ends an element. This may output an end-tag or close the current start-tag as an empty element.

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws java.io.IOException
Writes a processing instruction. If data is non-empty a space will be inserted automatically to separate it from the target.

comment

public void comment(java.lang.String body)
             throws java.io.IOException
Writes a comment.

entityReference

public void entityReference(boolean isParam,
                            java.lang.String name)
                     throws java.io.IOException
Writes an entity reference.

characterReference

public void characterReference(int n)
                        throws java.io.IOException
Writes a character reference.

cdataSection

public void cdataSection(java.lang.String content)
                  throws java.io.IOException
Writes a CDATA section.

startReplacementText

public void startReplacementText()
                          throws java.io.IOException
Starts the replacement text for an internal entity. The replacement text must be ended with endReplacementText. This enables an extra level of escaping that protects against the process of constructing an entity's replacement text from the literal entity value. See Section 4.5 of the XML Recommendation. Between a call to startReplacementText and endReplacementText, the argument to markup would specify entity replacement text; these would be escaped so that when processed as a literal entity value, the specified entity replacement text would be constructed. This call does not itself cause anything to be written.

endReplacementText

public void endReplacementText()
                        throws java.io.IOException
Ends the replacement text for an internal entity. This disables the extra level of escaping enabled by startReplacementText. This call does not itself cause anything to be written.

markup

public void markup(java.lang.String str)
            throws java.io.IOException
Writes markup. The characters in the string will be written as is without being escaped (except for any escaping enabled by startReplacementText).

write

public void write(java.lang.String str)
           throws java.io.IOException

close

public void close()
           throws java.io.IOException