org.gxos
Class Defaults

java.lang.Object
  |
  +--org.gxos.Defaults

public class Defaults
extends java.lang.Object

Provides utility methods.

$Id: Defaults.java,v 1.12 2001/05/01 16:03:40 balsoy Exp $


Field Summary
static java.lang.String GXOS_CONFIG
          GXOS configration file variable.
static java.lang.String GXOS_EXT
          Extension to names for Garnet objects.
static java.lang.String GXOS_ROOT_PREFIX
          Prefix for GXOS names, i.e.
static java.lang.String GXOS_SUBJNDI_CONTEXTFACTORY
          Default sub JNDI provider initial context factory.
static java.lang.String GXOS_SUBJNDI_PROVIDER_URL
          The provider URL for the sub JNDI.
static java.lang.String GXOS_SUBJNDI_PROVIDER_VAR
          Environment variable to look for the sub JNDI provider URL.
static java.lang.String GXOS_SUBJNDI_VAR
          Environment variable to look for the sub JNDI.
static java.lang.String NODEVERSION
          Current version of the schema.
 
Constructor Summary
Defaults()
           
 
Method Summary
static boolean addChild(TreeObject parent, TreeObject child)
          Adds a child object to another object's child list.
static java.lang.String getFullNameString(Entity gx)
           
static java.lang.String getObjectName(java.lang.String name)
           
static TreeObject initEntity(TreeObject gx, java.lang.String name, NodeTypeType type, NodeRootingType rooting)
          Initializes GXOS object with current version number and time.
static void marshal(TreeObject object, java.io.Writer writer)
          Outputs the XML content of a GXOS object into a writer.
static boolean removeChild(TreeObject parent, java.lang.String childName)
          Removes a child object's name from it's parent's child list.
static boolean removeChild(TreeObject parent, TreeObject child)
          Removes a child object from it's parent's child list, and sets the child's parent object to null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GXOS_CONFIG

public static final java.lang.String GXOS_CONFIG
GXOS configration file variable. This needs to be set before GNDI is run, i.e. java -Dgxos.config=

NODEVERSION

public static final java.lang.String NODEVERSION
Current version of the schema. Used in TreeObject.NodeVersionNumber.
See Also:
TreeObject

GXOS_ROOT_PREFIX

public static final java.lang.String GXOS_ROOT_PREFIX
Prefix for GXOS names, i.e. gxos:// or //.

GXOS_SUBJNDI_CONTEXTFACTORY

public static final java.lang.String GXOS_SUBJNDI_CONTEXTFACTORY
Default sub JNDI provider initial context factory.

GXOS_SUBJNDI_VAR

public static final java.lang.String GXOS_SUBJNDI_VAR
Environment variable to look for the sub JNDI.

GXOS_SUBJNDI_PROVIDER_URL

public static final java.lang.String GXOS_SUBJNDI_PROVIDER_URL
The provider URL for the sub JNDI.

GXOS_SUBJNDI_PROVIDER_VAR

public static final java.lang.String GXOS_SUBJNDI_PROVIDER_VAR
Environment variable to look for the sub JNDI provider URL.

GXOS_EXT

public static final java.lang.String GXOS_EXT
Extension to names for Garnet objects.
Constructor Detail

Defaults

public Defaults()
Method Detail

initEntity

public static TreeObject initEntity(TreeObject gx,
                                    java.lang.String name,
                                    NodeTypeType type,
                                    NodeRootingType rooting)
Initializes GXOS object with current version number and time. Name, type and rooting type are provided by the caller of the method.
Parameters:
gx - Garnet object that needs to be initialized. This object is not created in this method. It has to be created before the method is called.
name - NodeName of this Garnet object.
type - NodeType of this Garnet object. See NodeTypeType for options.
rooting - Type of this node. See NodeRootingType for options.
Returns:
GXOS object as initialized.
See Also:
NodeTypeType, NodeRootingType, TreeObject

addChild

public static boolean addChild(TreeObject parent,
                               TreeObject child)
Adds a child object to another object's child list.
Parameters:
parent - Parent object of which a child to be added.
child - Child object to be added.
Returns:
true if succeeded; other false.
See Also:
TreeObject

removeChild

public static boolean removeChild(TreeObject parent,
                                  java.lang.String childName)
Removes a child object's name from it's parent's child list. This does not affect the child object.
Parameters:
parent - Parent object whose child link will be removed.
child - Name of the child object to be removed.
Returns:
true if succeeded; otherwise false.
See Also:
TreeObject

removeChild

public static boolean removeChild(TreeObject parent,
                                  TreeObject child)
Removes a child object from it's parent's child list, and sets the child's parent object to null.
Parameters:
parent - Parent object whose child link will be removed.
child - Child object to be removed.
Returns:
true if succeeded; otherwise false.
See Also:
TreeObject

marshal

public static void marshal(TreeObject object,
                           java.io.Writer writer)
                    throws GxException
Outputs the XML content of a GXOS object into a writer.
Parameters:
object - GXOS object to be marshaled.
writer - writer object to which object's content will be output.
Throws:
GxException - if a marshalling error is encountered.

getFullNameString

public static java.lang.String getFullNameString(Entity gx)

getObjectName

public static java.lang.String getObjectName(java.lang.String name)