|
IBM Branch Transformation Toolkit Javadoc | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.btt.base.Context
This class is the basic repository of data and services. Instances of this class can be linked, or chained, in a tree of contexts, and the instances are capable of navigating over this tree, always in the upper direction. The instances of this class also can be passed as parameters of the format() and unformat() methods of a record format.
Field Summary | |
---|---|
protected int |
bufferSize
|
static int |
DEFAULT_BUFFER_SIZE
|
static byte |
DEFAULT_COMPRESSION
|
protected static Externalizer |
externalizer
|
Constructor Summary | |
---|---|
Context()
This constructor creates a local context object without name. |
|
Context(java.lang.String contextName,
boolean isDistributed)
This constructor creates a distributed Context object or a local context according to the value of the parameter isDistributed. |
|
Context(java.lang.String aName,
java.lang.String aType,
Context aParent)
Creates a local context without predefined definition and chain to another local or distributed context. |
|
Context(java.lang.String contextName,
java.lang.String typeName,
Context parentContext,
boolean isDistributed)
If isDistributed = true, create a distributed Context based on a context name, and the following optional params, type name, parent Context. |
|
Context(java.lang.String aName,
java.lang.String aType,
Context aParent,
KeyedCollection aKeyedCollection)
Creates a local context without predefined definition and chain to another local or distributed context. |
|
Context(java.lang.String contextName,
java.lang.String typeName,
Context parentContext,
KeyedCollection aKeyedCollection,
boolean isDistributed)
If isDistributed = true, create a distributed Context based on a context name, and the following optional params, type name, parent Context, a KeyedCollection. |
|
Context(java.lang.String aName,
java.lang.String aType,
KeyedCollection aKeyedCollection)
Creates a local context without predefined definition and chain to another local or distributed context. |
Method Summary | |
---|---|
void |
addChild(Context aNewChild)
Adds a child specified by the parameter to the children list of current context. |
void |
addElement(DataElement aDataElement)
Adds an element to its keyedCollection. |
void |
chainTo(Context aContext)
Chains this context to aContext. |
void |
clearKeyedCollection()
Clears the context (current level only) by destroying the current keyed collection associated and replacing it with a new one. |
void |
clearKeyedCollection(boolean keepKCollStatus,
boolean clearOnlyValues)
This method clears both the typed and non-typed elements in the context keyed collection. |
boolean |
containsChild(java.lang.String aContextName)
Returns true if this context has a child with the name aContextName. |
Externalizer |
externalizer()
Returns the externalizer instance of this class. |
Vector |
fields()
Returns all the data fields, which are addressable from this context. |
Context |
getAncestorByName(java.lang.String aContextName)
Searches the context tree for an ancestor Context named aContextName and returns the first matching context. |
java.lang.String |
getCHALocation(java.lang.String contextName)
Get the CHA server location where the context specified by the parameter contextName is stored. |
Vector |
getChildren()
Returns the children contexts of this one. |
Vector |
getChildrenAtAnyLevel()
Get the children of a remote context at any level from the context tree. |
static Context |
getContextByInstanceID(java.lang.String anInstanceID)
Returns the distributed context that matches the parameter: instanceID. |
Context |
getContextByType(java.lang.String aTypeName)
Returns the first context that matches its type to aTypeName. |
static Context |
getContextNamed(java.lang.String aContextName)
Searches the context tree from the root context for a context named aContextName |
DataElement |
getElementAt(java.lang.String aCompositeKey)
Returns the element of its keyedCollection,or keyedCollections of the upper contexts which is located at aCompositeKey path. |
static Externalizer |
getExternalizer()
Gets the externalizer. |
java.lang.String |
getInstanceID()
Returns the instanceID. |
KeyedCollection |
getKeyedCollection()
Returns the keyedCollection attribute. |
java.lang.String |
getLevel()
We can define an attribute --level-- in dsectxt.xml file to indicate level of the context. |
int |
getMode()
Returns the mode. |
java.lang.String |
getName()
Return the name attribute. |
Context |
getNextContextHorizontal()
The method used to iterate over the context tree. |
Context |
getNextContextVertical(Context parentContext)
|
Context |
getParent()
Returns the parent attribute. |
static Context |
getRoot()
Returns the root context of the context tree. |
java.lang.String |
getRootLocation()
Get the CHA server location where the root context will be stored. |
java.lang.String |
getTagName()
Returns a String used by the externalizer. |
java.lang.String |
getType()
Returns the "type" attribute. |
java.lang.Object |
getValueAt(java.lang.String aCompositeKey)
Returns the value of the element of its keyedCollection, or keyedCollections of the upper contexts, located in the "aCompositeKey" path. |
boolean |
hasChildren()
Returns true if this context has any children. |
java.lang.Object |
initializeFrom(Tag aTag)
Initializes a Context with the Tag attributes. |
boolean |
isAddToDynamicKColl()
Returns the value of the addToDynamicKColl property. |
boolean |
isChained()
Returns true if this context is in the context tree. |
boolean |
isReadOnly()
If the definition of this context in dsetxt.xml has the attribute readonly="true", this method will return true, otherwise, false is returned. |
boolean |
isRoot()
Returns true if this context is the root context. |
void |
prune()
Removes this context and its children from the context tree. |
void |
readExternal()
Initializes a dataElement with its external value. |
void |
readExternal(java.io.ObjectInput s)
Invokes the object creation from an ObjectInput. |
void |
readExternal(TagInputStream aTIS)
Initializes this instance with values read from a file. |
void |
readFromStream(java.io.ObjectInput s)
Invokes the object creation from an ObjectInput. |
DataElement |
removeAt(java.lang.String aCompositeKey)
Removes aCompositeKey element of its keyedCollection. |
DataElement |
removeAtAnyLevel(java.lang.String aCompositeKey)
Removes an element of its keyedCollection, or the keyedCollections in the upper contexts, located in the aCompositeKey path. |
void |
removeChild(Context aContext)
Removes a child of this context from the context tree if the current context and its child are both local contexts. |
void |
removeChild(java.lang.String childInstanceID)
Remove the child-parent relationship in CHAChildren table when the current context is a remote context and Multiple CHA Architecture is used (supportMultipleCHAServers=true). |
void |
removeExternal()
Removes the object's tags from the file in which the object is externalized. |
void |
removeInstance()
The method used to remove the current context if it is a remote context. |
static void |
reset()
Deletes all context instances. |
void |
setAddToDynamicKColl(boolean newValue)
Sets the value of the addToDynamicKColl property. |
void |
setChildren(Vector aChildrenCollection)
Sets the children property. |
static void |
setExternalizer(Externalizer anExternalizer)
Sets the externalizer. |
void |
setInstanceID(java.lang.String anInstanceID)
Sets the instanceID for a local context which must not predefined in the configuration file such as dsectxt.xml. |
void |
setKCollDynamic(boolean aValue)
Set the value to the attribute dynamic for the keyedCollection in this context. |
void |
setKeyedCollection(KeyedCollection aKeyedCollection)
Sets the attribute keyedCollection. |
void |
setName(java.lang.String aContextName)
Sets the name property of this context. |
void |
setReadOnly(boolean isReadOnly)
|
void |
setSerializableLevel(int i)
Set the value of variable serializableLevel. |
void |
setSerializeParentsAndChildren(boolean b)
Set the value of variable serializeParentsAndChildren When the local context will be serialized, if serializeParentsAndChildren = true, the parents and children of the local context will be serialized. |
void |
setType(java.lang.String aContextType)
Sets the type property of this context. |
int |
setValueAt(SortedTable aSortedTable)
The function is similiar to setValueAt(String, Object) except that set pairs of keys and values stored in aSortedTable via one method. |
void |
setValueAt(java.lang.String aCompositeKey,
java.lang.Object aDataValue)
Sets the value of the element of its keyedCollection, or keyedCollections of the upper contexts, located in the aCompositeKey path. |
java.lang.String |
toString()
Returns an XML representation of this context. |
Vector |
toStrings()
Returns a visual representation of this context. |
Vector |
toTags()
Returns a Vector with the elements represented as a Tag. |
DataElement |
tryGetElementAt(java.lang.String aCompositeKey)
Returns the element of its keyedCollection, or keyedCollections of the upper contexts which is located at aCompositeKey path. |
java.lang.Object |
tryGetValueAt(java.lang.String aCompositeKey)
Returns the value of the element of its keyedCollection, or keyedCollections of the upper contexts, located in the aCompositeKey path. |
int |
trySetElementAt(java.lang.String aCompositeKey,
java.io.Serializable aValue)
Set the value of the element of its keyedCollection, or keyedCollections of the upper contexts which is located at aCompositeKey path. |
void |
unchain()
Removes this context and all its children from the context tree. |
void |
writeExternal()
Writes this instance to a file using tags. |
void |
writeExternal(java.io.ObjectOutput s)
Provides concrete serialization handling for contexts. |
void |
writeToStream(java.io.ObjectOutput s)
Provides concrete serialization handling for contexts. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static Externalizer externalizer
public static final byte DEFAULT_COMPRESSION
public static final int DEFAULT_BUFFER_SIZE
protected int bufferSize
Constructor Detail |
public Context()
public Context(java.lang.String contextName, boolean isDistributed) throws DSEInvalidRequestException
public Context(java.lang.String aName, java.lang.String aType, Context aParent) throws DSEInvalidRequestException
aName
- java.lang.StringaType
- java.lang.StringaParent
- Contextpublic Context(java.lang.String aName, java.lang.String aType, Context aParent, KeyedCollection aKeyedCollection) throws DSEInvalidRequestException
public Context(java.lang.String aName, java.lang.String aType, KeyedCollection aKeyedCollection) throws DSEInvalidRequestException
aName
- java.lang.StringaType
- java.lang.StringaKeyedCollection
- KeyedCollectionpublic Context(java.lang.String contextName, java.lang.String typeName, Context parentContext, boolean isDistributed) throws DSEInvalidRequestException
contextName
- typeName
- parentContext
- isDistributed
-
DSEInvalidRequestException
public Context(java.lang.String contextName, java.lang.String typeName, Context parentContext, KeyedCollection aKeyedCollection, boolean isDistributed) throws DSEInvalidRequestException
contextName
- typeName
- parentContext
- aKeyedCollection
- isDistributed
-
DSEInvalidRequestException
Method Detail |
public void addChild(Context aNewChild) throws DSEInvalidRequestException
aNewChild
- Context
DSEInvalidRequestException
public void addElement(DataElement aDataElement) throws DSEInvalidRequestException
DSEInvalidRequestException
public void chainTo(Context aContext) throws DSEInvalidRequestException
DSEInvalidRequestException
public void clearKeyedCollection() throws DSEInvalidRequestException
DSEInvalidRequestException
public void clearKeyedCollection(boolean keepKCollStatus, boolean clearOnlyValues) throws java.io.IOException, DSEInvalidRequestException
keepKCollStatus
- boolean (false - clear also the context kColl attributes; true - keep the context kColl attributes and clear only the kColl data elements)clearOnlyValues
- boolean (false - clear all attributes of the context kColl data elements; true - clear only kColl data elements values)
java.io.IOException
- - If keepKCollStatus or clearOnlyValues are false and the keyed collection has not been defined in the generic data file or in the generic types file
DSEInvalidRequestException
public boolean containsChild(java.lang.String aContextName) throws DSEInvalidRequestException
DSEInvalidRequestException
public Externalizer externalizer()
externalizer
in interface Externalizable
public Vector fields() throws DSEInvalidRequestException
DSEInvalidRequestException
public Context getAncestorByName(java.lang.String aContextName) throws DSEInvalidRequestException
aContextName
- java.lang.String
DSEInvalidRequestException
public Vector getChildrenAtAnyLevel() throws DSEInvalidRequestException
DSEInvalidRequestException
public Vector getChildren() throws DSEInvalidRequestException
DSEInvalidRequestException
public Context getContextByType(java.lang.String aTypeName) throws DSEInvalidRequestException
DSEInvalidRequestException
public static Context getContextNamed(java.lang.String aContextName) throws DSEInvalidRequestException
DSEInvalidRequestException
public Context getNextContextHorizontal() throws DSEInvalidRequestException
DSEInvalidRequestException
public Context getNextContextVertical(Context parentContext) throws DSEInvalidRequestException
DSEInvalidRequestException
public DataElement getElementAt(java.lang.String aCompositeKey) throws DSEObjectNotFoundException
DSEObjectNotFoundException
public static Externalizer getExternalizer()
public KeyedCollection getKeyedCollection() throws DSEInvalidRequestException
DSEInvalidRequestException
public java.lang.String getName()
getName
in interface Externalizable
public Context getParent() throws DSEInvalidRequestException
DSEInvalidRequestException
public static Context getRoot() throws DSEInvalidRequestException
DSEInvalidRequestException
public java.lang.String getTagName()
public java.lang.String getType() throws DSEInvalidRequestException
DSEInvalidRequestException
public java.lang.Object getValueAt(java.lang.String aCompositeKey) throws DSEObjectNotFoundException
DSEObjectNotFoundException
public boolean hasChildren() throws DSEInvalidRequestException
DSEInvalidRequestException
public java.lang.Object initializeFrom(Tag aTag) throws java.io.IOException, DSEException
initializeFrom
in interface Externalizable
aTag
- Tag
java.io.IOException
DSEException
public boolean isAddToDynamicKColl() throws DSEInvalidRequestException
DSEInvalidRequestException
public boolean isChained() throws DSEInvalidRequestException
DSEInvalidRequestException
public boolean isRoot() throws DSEInvalidRequestException
DSEInvalidRequestException
public void prune() throws DSEInvalidRequestException, DSEObjectNotFoundException
DSEInvalidRequestException
DSEObjectNotFoundException
public void readExternal() throws java.io.IOException
readExternal
in interface Externalizable
java.io.IOException
public void readExternal(TagInputStream aTIS) throws java.io.IOException
java.io.IOException
public void readExternal(java.io.ObjectInput s) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
s
- java.io.ObjectInput
java.io.IOException.
java.lang.ClassNotFoundException.
java.io.IOException
java.lang.ClassNotFoundException
public void readFromStream(java.io.ObjectInput s) throws java.io.IOException, java.lang.ClassNotFoundException
s
- java.io.ObjectInput
java.io.IOException.
java.lang.ClassNotFoundException.
java.io.IOException
java.lang.ClassNotFoundException
public DataElement removeAt(java.lang.String aCompositeKey) throws DSEObjectNotFoundException, DSEInvalidRequestException
DSEObjectNotFoundException
DSEInvalidRequestException
public DataElement removeAtAnyLevel(java.lang.String aCompositeKey) throws DSEObjectNotFoundException, DSEInvalidRequestException
DSEObjectNotFoundException
DSEInvalidRequestException
public void removeChild(Context aContext) throws DSEObjectNotFoundException, DSEInvalidRequestException
aContext
- Context
DSEObjectNotFoundException
DSEInvalidRequestException
public void removeInstance() throws DSEInvalidRequestException
DSEInvalidRequestException
public void removeChild(java.lang.String childInstanceID) throws DSEInvalidRequestException
childInstanceID
-
DSEInvalidRequestException
public void removeExternal() throws java.io.IOException
removeExternal
in interface Externalizable
java.io.IOException
public static void reset() throws DSEException
DSEException
public void setAddToDynamicKColl(boolean newValue) throws DSEInvalidRequestException
newValue
- boolean The new value of the property.
DSEInvalidRequestException
public void setChildren(Vector aChildrenCollection) throws DSEInvalidRequestException
DSEInvalidRequestException
public static void setExternalizer(Externalizer anExternalizer)
public void setKeyedCollection(KeyedCollection aKeyedCollection) throws DSEInvalidRequestException
DSEInvalidRequestException
public void setName(java.lang.String aContextName)
setName
in interface Externalizable
aContextName
- java.lang.Stringpublic void setType(java.lang.String aContextType) throws DSEInvalidRequestException
DSEInvalidRequestException
public int setValueAt(SortedTable aSortedTable) throws DSEInvalidRequestException
aSortedTable
-
DSEInvalidRequestException
public java.lang.String toString()
public Vector toStrings()
toStrings
in interface Externalizable
public Vector toTags() throws java.io.IOException
toTags
in interface Externalizable
java.io.IOException
public DataElement tryGetElementAt(java.lang.String aCompositeKey) throws DSEObjectNotFoundException
DSEObjectNotFoundException
public java.lang.Object tryGetValueAt(java.lang.String aCompositeKey) throws DSEObjectNotFoundException
DSEObjectNotFoundException
public void unchain() throws DSEInvalidRequestException, DSEObjectNotFoundException
DSEInvalidRequestException
DSEObjectNotFoundException
public void writeExternal() throws java.io.IOException
writeExternal
in interface Externalizable
java.io.IOException
public void writeExternal(java.io.ObjectOutput s) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
s
- java.io.ObjectOutput
java.io.IOException
public void writeToStream(java.io.ObjectOutput s) throws java.io.IOException
s
- java.io.ObjectOutput
java.io.IOException
public java.lang.String getInstanceID()
public void setInstanceID(java.lang.String anInstanceID) throws DSEInvalidArgumentException
DSEInvalidArgumentException
public int getMode()
public void setKCollDynamic(boolean aValue) throws DSEInvalidRequestException
aValue
-
DSEInvalidRequestException
public int trySetElementAt(java.lang.String aCompositeKey, java.io.Serializable aValue) throws DSEInvalidRequestException
DSEInvalidRequestException
public static Context getContextByInstanceID(java.lang.String anInstanceID) throws DSEInvalidRequestException
DSEInvalidRequestException
public void setValueAt(java.lang.String aCompositeKey, java.lang.Object aDataValue) throws DSEInvalidArgumentException, DSEObjectNotFoundException, DSEInvalidRequestException
DSEInvalidArgumentException
DSEObjectNotFoundException
DSEInvalidRequestException
public boolean isReadOnly() throws DSEInvalidRequestException
DSEInvalidRequestException
public java.lang.String getLevel() throws DSEInvalidRequestException
DSEInvalidRequestException
public java.lang.String getRootLocation() throws DSEInvalidRequestException
DSEInvalidRequestException
public void setReadOnly(boolean isReadOnly)
public java.lang.String getCHALocation(java.lang.String contextName) throws DSEInvalidRequestException
DSEInvalidRequestException
public void setSerializableLevel(int i) throws DSEInvalidRequestException
DSEInvalidRequestException
public void setSerializeParentsAndChildren(boolean b)
|
IBM Branch Transformation Toolkit Javadoc | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |