com.ibm.dse.base
Class Context

java.lang.Object
  |
  +--com.ibm.dse.base.Context

public class Context
extends java.lang.Object
implements Externalizable

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.

See Also:
Serialized Form

Field Summary
protected static Externalizer externalizer
           
 
Constructor Summary
Context()
          This constructor creates a Context object.
Context(java.lang.String aName)
          This constructor creates a new instance of the Context class, which is obtained from the external definition files through aName.
Context(java.lang.String aName, java.lang.String aType, Context aParent)
          Creates a context with the provided parameters.
Context(java.lang.String aName, java.lang.String aType, Context aContext, KeyedCollection aKeyedCollection)
          Creates a context with the provided parameters.
Context(java.lang.String aName, java.lang.String aType, KeyedCollection aKeyedCollection)
          Creates a context with the provided parameters.
Context(java.lang.String aName, java.lang.String aType, java.lang.String aContextName)
          Creates a context with the provided parameters.
 
Method Summary
static void addApplicationSession(java.lang.String aSession, java.lang.String aParentSession, Context aContext)
          Adds an new SessionEntry kColl for the application id to the kColl for the session id.
 void addElement(DataElement aDataElement)
          Adds an element to its keyedCollection.
 void addNotifier(Notifier aNotifier, java.lang.String aNotifierName, java.lang.String aNotifierType)
          Adds a notifier to the notifiers list of this context.
 void addService(Service aService, java.lang.String aServiceName, java.lang.String aServiceType)
          Adds a service to the service list of this context.
static void addSession(SessionEntry se)
          Adds a session entry in the table of sessions in the root context.
static void addSession(java.lang.String aType, java.lang.Long aTimeStamp, java.lang.String aSession, java.lang.String aTID, Context aContext)
          Adds an entry in the table of sessions in the root context.
static void addSession(java.lang.String aSession, java.lang.String aTID, Context aContext)
          Adds an entry in the table of sessions in the root context.
 void chainTo(Context aContext)
          Chains this context to aContext.
 void chainToContextNamed(java.lang.String aContextName)
          Chains this context to the context named aContextName.
 void chainToCurrentContext()
          Chains this context to the current context.
static void checkExpiredSessions()
          When an expired session is found, fire an event and mark the session as expired.
 void clearKeyedCollection()
          Clears the context (current level only) by destroying the current keyed collection associated and replace with a new one.
 boolean containsChild(java.lang.String aContextName)
          Returns true if this context has a child with the name aContextName. It returns false otherwise.
static Context currentContext()
          Returns the context set as the currentContext from the root.
 Externalizer externalizer()
          Returns the externalizer instance of this class.
 Vector fields()
          Returns all the data fields, which are addressable from this context.
 Vector getChildren()
          Returns the children contexts of this one.
 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 for a context named aContextName, and returns the first matching context.
static CSClientService getCSClient()
          Obtains the first instance of the CSClient service.
static CSServerService getCSServer()
          Returns the instance of CSServer.
 Context getCurrentContext()
          Obtains the context marked as currentContext from this one..
static Context getCurrentContextForSession(java.lang.String aSession)
          Returns the current Context for the specified sessionId.
static Context getCurrentContextForSession(java.lang.String aSession, java.lang.String anApplication)
          Returns the current Context for the specified sessionId and applicationId.
 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.
 KeyedCollection getKeyedCollection()
          Returns the keyedCollection attribute.
 java.lang.String getName()
          Return the name attribute.
 Context getNextContextNamed(java.lang.String aContextName)
          Returns the first context named aContextName beginning at this context.
 Notifier getNotifier(java.lang.String aNotifierName)
          Returns the first notifier named aNotifierName, by searching over this context branch in the upper direction.
 Notifier getNotifierByType(java.lang.String aNotifierType)
          Returns the first notifier that has a type that matches aNotifierType by searching over this context branch in the upper direction.
protected  Hashtable getNotifiers()
          Returns the notifiers attribute.
 Context getParent()
          Returns the parent attribute.
static Context getRoot()
          Returns the root context of the context tree.
 Service getService(java.lang.String aServiceName)
          Returns the first service named aServiceName, by searching over this context branch in the upper direction.
 Service getServiceByType(java.lang.String aServiceType)
          Returns the first service that has a type that matches aServiceType by searching over this context branch in the upper direction.
 Hashtable getServices()
          Returns the services attribute.
static SessionEntry getSession(java.lang.String aSession)
          Returns the SessionEntry for the sessionId.
static java.lang.String getSessionForTID(java.lang.String tid)
          This method will return the session id that a TID has associated or null if there is no session id associated with the TID passed
static java.lang.Object getSessionObjectForSession(java.lang.String aSession)
          Returns the Session Object for the specified sessionId.
static SessionTable getSessionTable()
          Returns the sessionTable.
 java.lang.String getTagName()
          Returns a String used by the externalizer.
static java.lang.String getTIDForSession(java.lang.String aSession)
          Returns the client workstation TID for the sessionId.
static java.lang.Long getTimeStampForSession(java.lang.String aSession)
          Returns the timeStamp of the last operation executed for the sessionId.
 java.lang.String getType()
          Returns the type attribute.
static java.lang.String getTypeForSession(java.lang.String aSession)
          Returns the client workstation type for the sessionId.
 java.lang.Object getValueAt(java.lang.String aCompositeKey)
          Returns the value of the element of its keyedCollection, or keyedCollections of the upper contexts, which is located at aCompositeKey path.
 boolean hasChildren()
          Returns true if this context has any children.
 boolean hasNotifiers()
          Returns true if this context has any notifier, false otherwise.
 boolean hasServices()
          Returns true if this context has any service.
 java.lang.Object initializeContextFrom(Tag aContextTag)
          Initializes a DataField with the aTag attributes.
 java.lang.Object initializeFrom(Tag aTag)
          Initializes a Context with the Tag attributes.
 java.lang.Object initializeKeyedCollectionFrom(Tag aTag)
          Initializes the context keyed collection.
 java.lang.Object initializeKeyedCollectionValueFrom(Tag aTag)
          Initializes a collection of values from aTag.
 java.lang.Object initializeServiceFrom(Tag aTag)
          Initializes services in the context.
 java.lang.Object initializeTypeFrom(Tag aTag)
          Initializes the context's KeyedCollection with a new instance created by the Types Externalizer
 boolean isAddToDynamicKColl()
          Returns the value of the addToDynamicKColl property.
 boolean isChained()
          Returns true if this context is in the context tree.
static boolean isContext(java.lang.String aContextName)
          Returns true if there is at least one context in the context tree that has a name that matches aContextName.
 boolean isRoot()
          Returns true if this context is the root context.
static int occurrencesNamed(java.lang.String aContextName)
          Returns the number of contexts in the context tree that have names that match aContextName.
 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.
static java.lang.Object readObject(java.lang.String name)
          Instantiates a Context named 'name' from the SGML.
 DataElement removeAt(java.lang.String aCompositeKey)
          Removes an element of its keyedCollection,or the keyedCollections in the upper contexts, which is located at aCompositeKey path.
 void removeExternal()
          Removes the tags for this object from the file where it is externalized
 void removeNotifier(java.lang.String aNotifierName)
          Removes a notifier from the context.
 void removeService(java.lang.String aServiceName)
          Remove a service from the context.
static void removeSession(java.lang.String aSession)
          Removes an entry in the session table.
static void removeSession(java.lang.String aSession, java.lang.String anApplication)
          Removes an sub session entry in the session table for a given session id and application id.
static void reset()
          Deletes all context instances.
 void setAddToDynamicKColl(boolean newValue)
          Sets the value of the addToDynamicKColl property.
 void setAsCurrentChild()
          Sets this context as currentChild in the parent Context.
 void setAsCurrentContext()
          Sets this context as currentChild in all its parent Contexts until the root.
 void setChildren(Vector aChildrenCollection)
          Sets the children attribute.
static void setCurrentContextForSession(java.lang.String aSession, Context aContext)
          Sets the specified Context for the specified sessionId.
static void setCurrentContextForSession(java.lang.String aSession, java.lang.String anApplication, Context aContext)
          Sets the Context for the specified sessionId and applicationId.
static void setExternalizer(Externalizer anExternalizer)
          Sets the externalizer.
 void setKeyedCollection(KeyedCollection aKeyedCollection)
          Sets the attribute keyedCollection.
 void setName(java.lang.String aContextName)
          Sets the name attribute of this context.
 void setServices(Hashtable aHashtable)
          Sets the service attribute of this context.
static void setSessionObjectForSession(java.lang.String aSession, java.lang.Object aSessionObject)
          Sets the specified Session Object for the specified sessionId.
static void setTimeStampForSession(java.lang.String aSession, java.lang.Long aTimeStamp)
          Sets the timeStamp for the sessionId.
 void setType(java.lang.String aContextType)
          Sets the type attribute of this context.
static void setTypeForSession(java.lang.String aSession, java.lang.String aType)
          Sets the client type for the for the sessionId.
 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, which is located at aCompositeKey path.
 void stopNotifiers()
          Stops all notifiers in the context invoking the terminate notifier's method.
 void stopNotifiersInChildren()
          Stops all notifiers in this context and all its children.
 void stopServices()
          Stops all services in the context invoking the terminate service's method.
 void stopServicesInChildren()
          Stops all services in this context and all its children.
 void terminateServices()
          Looks for all the services in the context and removes them.
 java.lang.String toString()
          Returns an SGML 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.
 void unchain()
          Removes this context and all its children from the context tree.
 void writeExternal()
          Writes this instance converted in tags to a file.
 void writeExternal(java.io.ObjectOutput s)
          Provides concrete serialization handling for Context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

externalizer

protected static Externalizer externalizer
Constructor Detail

Context

public Context()
This constructor creates a Context object.

Context

public Context(java.lang.String aName)
        throws java.io.IOException
This constructor creates a new instance of the Context class, which is obtained from the external definition files through aName.
Parameters:
aName - java.lang.String

Context

public Context(java.lang.String aName,
               java.lang.String aType,
               Context aParent)
        throws DSEInvalidRequestException
Creates a context with the provided parameters.
Parameters:
aName - java.lang.String
aType - java.lang.String
aParent - com.ibm.dse.base.Context

Context

public Context(java.lang.String aName,
               java.lang.String aType,
               Context aContext,
               KeyedCollection aKeyedCollection)
        throws DSEInvalidRequestException
Creates a context with the provided parameters.
Parameters:
aName - java.lang.String
aType - java.lang.String
aContext - com.ibm.dse.base.Context
aKeyedCollection - com.ibm.dse.base.KeyedCollection

Context

public Context(java.lang.String aName,
               java.lang.String aType,
               KeyedCollection aKeyedCollection)
Creates a context with the provided parameters.
Parameters:
aName - java.lang.String
aType - java.lang.String
aKeyedCollection - com.ibm.dse.base.KeyedCollection

Context

public Context(java.lang.String aName,
               java.lang.String aType,
               java.lang.String aContextName)
        throws DSEInvalidRequestException
Creates a context with the provided parameters.
Parameters:
aName - java.lang.String
aType - java.lang.String
aContextName - java.lang.String
Method Detail

addApplicationSession

public static void addApplicationSession(java.lang.String aSession,
                                         java.lang.String aParentSession,
                                         Context aContext)
                                  throws DSEInvalidRequestException
Adds an new SessionEntry kColl for the application id to the kColl for the session id. This table is used to maintain information about the established connections of the server with the client machines, and to administrate the different branches of the context tree. This API only should be used in the server application.
Parameters:
aSession - java.lang.String
aParentSession - java.lang.String
aContext - com.ibm.dse.base.Context

addElement

public void addElement(DataElement aDataElement)
                throws DSEInvalidRequestException
Adds an element to its keyedCollection.

addNotifier

public void addNotifier(Notifier aNotifier,
                        java.lang.String aNotifierName,
                        java.lang.String aNotifierType)
                 throws DSEInvalidRequestException
Adds a notifier to the notifiers list of this context. Verifies duplicate notifier names and non-null parameters.

addService

public void addService(Service aService,
                       java.lang.String aServiceName,
                       java.lang.String aServiceType)
                throws DSEInvalidRequestException
Adds a service to the service list of this context. Verifies the duplicate name services and non-null parameters.

addSession

public static void addSession(SessionEntry se)
                       throws DSEInvalidRequestException
Adds a session entry in the table of sessions in the root context. This method will not verify if the session entry already exists
Parameters:
se - com.ibm.dse.base.SessionEntry

addSession

public static void addSession(java.lang.String aType,
                              java.lang.Long aTimeStamp,
                              java.lang.String aSession,
                              java.lang.String aTID,
                              Context aContext)
                       throws DSEInvalidRequestException
Adds an entry in the table of sessions in the root context. This table is used to maintain information about the established connections of the server with the client machines, and to administrate the different branches of the context tree. This API only should be used in the server application.
Parameters:
aType - java.lang.String
aTimeStamp - java.lang.Long
aSession - java.lang.String
aTID - java.lang.String
aContext - com.ibm.dse.base.Context

addSession

public static void addSession(java.lang.String aSession,
                              java.lang.String aTID,
                              Context aContext)
                       throws DSEInvalidRequestException
Adds an entry in the table of sessions in the root context.
Parameters:
aSession - java.lang.String
aTID - java.lang.String
aContext - com.ibm.dse.base.Context

chainTo

public void chainTo(Context aContext)
             throws DSEInvalidRequestException
Chains this context to aContext. Verifies the consistency of the resultant context tree and changes the parent and children attributes of its respective contexts.

chainToContextNamed

public void chainToContextNamed(java.lang.String aContextName)
                         throws DSEInvalidRequestException,
                                DSEObjectNotFoundException
Chains this context to the context named aContextName. Throws an exception if this context does not exist.

chainToCurrentContext

public void chainToCurrentContext()
                           throws DSEInvalidRequestException
Chains this context to the current context.

checkExpiredSessions

public static void checkExpiredSessions()
                                 throws DSEInvalidRequestException,
                                        DSEObjectNotFoundException
When an expired session is found, fire an event and mark the session as expired. Method called from the ExpiredSessionsChecker thread. It is synchronized with the addSession and removeSession methods.

clearKeyedCollection

public void clearKeyedCollection()
Clears the context (current level only) by destroying the current keyed collection associated and replace with a new one.

containsChild

public boolean containsChild(java.lang.String aContextName)
Returns true if this context has a child with the name aContextName. It returns false otherwise.

currentContext

public static Context currentContext()
Returns the context set as the currentContext from the root.

externalizer

public Externalizer externalizer()
Returns the externalizer instance of this class.
Specified by:
externalizer in interface Externalizable
Returns:
com.ibm.dse.base.Externalizer

fields

public Vector fields()
Returns all the data fields, which are addressable from this context. This includes all the data fields of this context and the upper context.
Returns:
com.ibm.dse.base.Vector

getChildren

public Vector getChildren()
Returns the children contexts of this one.

getContextByType

public Context getContextByType(java.lang.String aTypeName)
Returns the first context that matches its type to aTypeName.

getContextNamed

public static Context getContextNamed(java.lang.String aContextName)
                               throws DSEInvalidRequestException
Searches the context tree for a context named aContextName, and returns the first matching context.

getCSClient

public static CSClientService getCSClient()
Obtains the first instance of the CSClient service.
Returns:
com.ibm.dse.clientserver.CSClient

getCSServer

public static CSServerService getCSServer()
Returns the instance of CSServer. It looks only in the root context because its a condition that the CSServer is chained to it.
Returns:
com.ibm.dse.clientserver.CSServer

getCurrentContext

public Context getCurrentContext()
Obtains the context marked as currentContext from this one..
Returns:
com.ibm.dse.base.Context

getCurrentContextForSession

public static Context getCurrentContextForSession(java.lang.String aSession)
                                           throws DSEInvalidRequestException,
                                                  DSEObjectNotFoundException
Returns the current Context for the specified sessionId.
Parameters:
aSession - java.lang.String
Returns:
com.ibm.dse.base.Context

getCurrentContextForSession

public static Context getCurrentContextForSession(java.lang.String aSession,
                                                  java.lang.String anApplication)
                                           throws DSEInvalidRequestException,
                                                  DSEObjectNotFoundException
Returns the current Context for the specified sessionId and applicationId.
Parameters:
aSession - java.lang.String
anApplication - java.lang.String
Returns:
com.ibm.dse.base.Context

getElementAt

public DataElement getElementAt(java.lang.String aCompositeKey)
                         throws DSEObjectNotFoundException
Returns the element of its keyedCollection,or keyedCollections of the upper contexts which is located at aCompositeKey path.

getExternalizer

public static Externalizer getExternalizer()
Gets the externalizer.

getKeyedCollection

public KeyedCollection getKeyedCollection()
Returns the keyedCollection attribute.

getName

public java.lang.String getName()
Return the name attribute.
Specified by:
getName in interface Externalizable
Tags copied from interface: Externalizable
Returns:
java.lang.String

getNextContextNamed

public Context getNextContextNamed(java.lang.String aContextName)
                            throws DSEInvalidRequestException
Returns the first context named aContextName beginning at this context. This method can be used for recursive searching of all context named aContextName.
Parameters:
aContextName - java.lang.String
Returns:
com.ibm.dse.base.Context

getNotifier

public Notifier getNotifier(java.lang.String aNotifierName)
                     throws DSEObjectNotFoundException
Returns the first notifier named aNotifierName, by searching over this context branch in the upper direction.

getNotifierByType

public Notifier getNotifierByType(java.lang.String aNotifierType)
                           throws DSEObjectNotFoundException
Returns the first notifier that has a type that matches aNotifierType by searching over this context branch in the upper direction.

getNotifiers

protected Hashtable getNotifiers()
Returns the notifiers attribute.
Returns:
com.ibm.dse.base.Hashtable.

getParent

public Context getParent()
Returns the parent attribute.

getRoot

public static Context getRoot()
Returns the root context of the context tree.

getService

public Service getService(java.lang.String aServiceName)
                   throws DSEObjectNotFoundException
Returns the first service named aServiceName, by searching over this context branch in the upper direction.

getServiceByType

public Service getServiceByType(java.lang.String aServiceType)
                         throws DSEObjectNotFoundException
Returns the first service that has a type that matches aServiceType by searching over this context branch in the upper direction.

getServices

public Hashtable getServices()
Returns the services attribute.
Returns:
com.ibm.dse.base.Hashtable.

getSession

public static SessionEntry getSession(java.lang.String aSession)
                               throws DSEInvalidRequestException,
                                      DSEObjectNotFoundException
Returns the SessionEntry for the sessionId.
Returns:
com.ibm.dse.SessionEntry

getSessionForTID

public static java.lang.String getSessionForTID(java.lang.String tid)
                                         throws DSEInvalidRequestException,
                                                DSEObjectNotFoundException
This method will return the session id that a TID has associated or null if there is no session id associated with the TID passed
Parameters:
tid - java.lang.String
Returns:
sessionId java.lang.String

getSessionObjectForSession

public static java.lang.Object getSessionObjectForSession(java.lang.String aSession)
                                                   throws DSEInvalidRequestException,
                                                          DSEObjectNotFoundException
Returns the Session Object for the specified sessionId.
Parameters:
aSession - java.lang.String
Returns:
Object

getSessionTable

public static SessionTable getSessionTable()
                                    throws DSEInvalidRequestException
Returns the sessionTable.
Returns:
com.ibm.dse.base.SessionTable

getTagName

public java.lang.String getTagName()
Returns a String used by the externalizer.
Returns:
java.lang.String

getTIDForSession

public static java.lang.String getTIDForSession(java.lang.String aSession)
                                         throws DSEInvalidRequestException,
                                                DSEObjectNotFoundException
Returns the client workstation TID for the sessionId.
Parameters:
aSession - java.lang.String
Returns:
java.lang.String

getTimeStampForSession

public static java.lang.Long getTimeStampForSession(java.lang.String aSession)
                                             throws DSEInvalidRequestException,
                                                    DSEObjectNotFoundException
Returns the timeStamp of the last operation executed for the sessionId.
Parameters:
aSession - java.lang.String
Returns:
java.lang.Long

getType

public java.lang.String getType()
Returns the type attribute.
Returns:
com.ibm.dse.base.Hashtable.

getTypeForSession

public static java.lang.String getTypeForSession(java.lang.String aSession)
                                          throws DSEInvalidRequestException,
                                                 DSEObjectNotFoundException
Returns the client workstation type for the sessionId.
Parameters:
aSession - java.lang.String
Returns:
java.lang.String

getValueAt

public java.lang.Object getValueAt(java.lang.String aCompositeKey)
                            throws DSEObjectNotFoundException
Returns the value of the element of its keyedCollection, or keyedCollections of the upper contexts, which is located at aCompositeKey path.

hasChildren

public boolean hasChildren()
Returns true if this context has any children. It returns false otherwise.

hasNotifiers

public boolean hasNotifiers()
Returns true if this context has any notifier, false otherwise.

hasServices

public boolean hasServices()
Returns true if this context has any service. It returns false otherwise.

initializeContextFrom

public java.lang.Object initializeContextFrom(Tag aContextTag)
                                       throws java.io.IOException
Initializes a DataField with the aTag attributes.
Parameters:
aContextTag - com.ibm.dse.base.Tag

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
                                throws java.io.IOException,
                                       DSEException
Initializes a Context with the Tag attributes.
Specified by:
initializeFrom in interface Externalizable
Parameters:
aTag - com.ibm.dse.base.Tag
Returns:
java.lang.Object

initializeKeyedCollectionFrom

public java.lang.Object initializeKeyedCollectionFrom(Tag aTag)
                                               throws java.io.IOException
Initializes the context keyed collection.
Parameters:
aTag - com.ibm.dse.base.Tag
Returns:
java.lang.Object

initializeKeyedCollectionValueFrom

public java.lang.Object initializeKeyedCollectionValueFrom(Tag aTag)
                                                    throws java.io.IOException
Initializes a collection of values from aTag.
Parameters:
aTag - com.ibm.dse.base.Tag
Returns:
java.lang.Object

initializeServiceFrom

public java.lang.Object initializeServiceFrom(Tag aTag)
                                       throws java.io.IOException
Initializes services in the context.
Parameters:
aTag - com.ibm.dse.base.Tag
Returns:
java.lang.Object

initializeTypeFrom

public java.lang.Object initializeTypeFrom(Tag aTag)
                                    throws java.io.IOException
Initializes the context's KeyedCollection with a new instance created by the Types Externalizer
Parameters:
aTag - com.ibm.dse.base.Tag
Returns:
java.lang.Object

isAddToDynamicKColl

public boolean isAddToDynamicKColl()
Returns the value of the addToDynamicKColl property.
Returns:
boolean - The current value of addToDynamicKColl.

isChained

public boolean isChained()
Returns true if this context is in the context tree.

isContext

public static boolean isContext(java.lang.String aContextName)
                         throws DSEInvalidRequestException
Returns true if there is at least one context in the context tree that has a name that matches aContextName. It returns false otherwise.

isRoot

public boolean isRoot()
Returns true if this context is the root context.

occurrencesNamed

public static int occurrencesNamed(java.lang.String aContextName)
                            throws DSEInvalidRequestException
Returns the number of contexts in the context tree that have names that match aContextName.

prune

public void prune()
           throws DSEInvalidRequestException,
                  DSEObjectNotFoundException
Removes this context and its children from the context tree.

readExternal

public void readExternal()
                  throws java.io.IOException
Initializes a dataElement with its external value. This instance requires an id (name) and the Externalizer and its tagInputStream are initialized.
Specified by:
readExternal in interface Externalizable
Tags copied from interface: Externalizable
Throws:
java.io.IOException -  

readExternal

public void readExternal(TagInputStream aTIS)
                  throws java.io.IOException
Initializes this instance with values read from a file. It should be called when the Externalizer has not initialized its tagStream. Once the tagStream is initialized, the method to call is readExternal()
Parameters:
s - java.io.InputStream

readExternal

public void readExternal(java.io.ObjectInput s)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Invokes the object creation from an ObjectInput. In the ObjectInput will arrive a context and all its children.
Parameters:
s - java.io.ObjectInput
Throws:
java.io.IOException. -  
java.lang.ClassNotFoundException. -  

readObject

public static java.lang.Object readObject(java.lang.String name)
                                   throws java.io.IOException
Instantiates a Context named 'name' from the SGML.
Parameters:
name - java.lang.String
Returns:
java.lang.Object

removeAt

public DataElement removeAt(java.lang.String aCompositeKey)
                     throws DSEObjectNotFoundException,
                            DSEInvalidRequestException
Removes an element of its keyedCollection,or the keyedCollections in the upper contexts, which is located at aCompositeKey path.

removeExternal

public void removeExternal()
                    throws java.io.IOException
Removes the tags for this object from the file where it is externalized
Specified by:
removeExternal in interface Externalizable

removeNotifier

public void removeNotifier(java.lang.String aNotifierName)
                    throws DSEObjectNotFoundException,
                           DSEException
Removes a notifier from the context.

removeService

public void removeService(java.lang.String aServiceName)
                   throws DSEObjectNotFoundException,
                          DSEException
Remove a service from the context.

removeSession

public static void removeSession(java.lang.String aSession)
                          throws DSEObjectNotFoundException,
                                 DSEInvalidArgumentException,
                                 DSEInvalidRequestException
Removes an entry in the session table. The method remove() of SessionEntry is called for safety removing.
Parameters:
aSession - java.lang.String

removeSession

public static void removeSession(java.lang.String aSession,
                                 java.lang.String anApplication)
                          throws DSEObjectNotFoundException,
                                 DSEInvalidArgumentException,
                                 DSEInvalidRequestException
Removes an sub session entry in the session table for a given session id and application id. The method remove() of SessionEntry is called for safety removing.
Parameters:
aSession - java.lang.String
anApplication - java.lang.String

reset

public static void reset()
                  throws DSEException
Deletes all context instances. Resets the rootInstance variable.

setAddToDynamicKColl

public void setAddToDynamicKColl(boolean newValue)
Sets the value of the addToDynamicKColl property.
Parameters:
newValue - boolean The new value of the property.

setAsCurrentChild

public void setAsCurrentChild()
                       throws DSEInvalidRequestException
Sets this context as currentChild in the parent Context.

setAsCurrentContext

public void setAsCurrentContext()
                         throws DSEInvalidRequestException
Sets this context as currentChild in all its parent Contexts until the root.

setChildren

public void setChildren(Vector aChildrenCollection)
Sets the children attribute.

setCurrentContextForSession

public static void setCurrentContextForSession(java.lang.String aSession,
                                               Context aContext)
                                        throws DSEObjectNotFoundException,
                                               DSEInvalidArgumentException,
                                               DSEInvalidRequestException
Sets the specified Context for the specified sessionId.
Parameters:
aSession - java.lang.String
aContext - com.ibm.dse.base.Context

setCurrentContextForSession

public static void setCurrentContextForSession(java.lang.String aSession,
                                               java.lang.String anApplication,
                                               Context aContext)
                                        throws DSEObjectNotFoundException,
                                               DSEInvalidArgumentException,
                                               DSEInvalidRequestException
Sets the Context for the specified sessionId and applicationId.
Parameters:
aSession - java.lang.String
anApplication - java.lang.String
aContext - com.ibm.dse.base.Context

setExternalizer

public static void setExternalizer(Externalizer anExternalizer)
Sets the externalizer.

setKeyedCollection

public void setKeyedCollection(KeyedCollection aKeyedCollection)
Sets the attribute keyedCollection.

setName

public void setName(java.lang.String aContextName)
Sets the name attribute of this context.
Specified by:
setName in interface Externalizable
Tags copied from interface: Externalizable
Parameters:
aName - java.lang.String

setServices

public void setServices(Hashtable aHashtable)
Sets the service attribute of this context.
Parameters:
aHashtable - com.ibm.dse.base.Hashtable

setSessionObjectForSession

public static void setSessionObjectForSession(java.lang.String aSession,
                                              java.lang.Object aSessionObject)
                                       throws DSEObjectNotFoundException,
                                              DSEInvalidArgumentException,
                                              DSEInvalidRequestException
Sets the specified Session Object for the specified sessionId.
Parameters:
aSession - java.lang.String
aSessionObject - Object

setTimeStampForSession

public static void setTimeStampForSession(java.lang.String aSession,
                                          java.lang.Long aTimeStamp)
                                   throws DSEInvalidArgumentException,
                                          DSEInvalidRequestException,
                                          DSEObjectNotFoundException
Sets the timeStamp for the sessionId.
Parameters:
aSession - java.lang.String
aTimeStamp - java.lang.Long

setType

public void setType(java.lang.String aContextType)
Sets the type attribute of this context.

setTypeForSession

public static void setTypeForSession(java.lang.String aSession,
                                     java.lang.String aType)
                              throws DSEInvalidArgumentException,
                                     DSEInvalidRequestException,
                                     DSEObjectNotFoundException
Sets the client type for the for the sessionId.
Parameters:
aSession - java.lang.String
aTtpe - java.lang.String

setValueAt

public void setValueAt(java.lang.String aCompositeKey,
                       java.lang.Object aDataValue)
                throws DSEInvalidArgumentException,
                       DSEObjectNotFoundException
Sets the value of the element of its keyedCollection, or keyedCollections of the upper contexts, which is located at aCompositeKey path. When the KeyedCollection of the Context is dynamic, this method has different behaviour depending on value of addToDynamicKColl property. If addToDynamicKColl is set to false firstly aCompositekey element is looked for in hierarchy. If it is found then its value is modified, but if the element is not found then it is created dynamically. Otherwise, when addToDynamicKColl is set to true, a new element is created in the current context or if it already exists overwrite its value, without checking the existence of the element in upper contexts.

stopNotifiers

public void stopNotifiers()
Stops all notifiers in the context invoking the terminate notifier's method.

stopNotifiersInChildren

public void stopNotifiersInChildren()
Stops all notifiers in this context and all its children.

stopServices

public void stopServices()
Stops all services in the context invoking the terminate service's method.

stopServicesInChildren

public void stopServicesInChildren()
Stops all services in this context and all its children.

terminateServices

public void terminateServices()
                       throws DSEException
Looks for all the services in the context and removes them.

toString

public java.lang.String toString()
Returns an SGML representation of this context.
Overrides:
toString in class java.lang.Object
Returns:
java.lang.String

toStrings

public Vector toStrings()
Returns a visual representation of this context.
Specified by:
toStrings in interface Externalizable
Returns:
com.ibm.dse.base.Vector

toTags

public Vector toTags()
              throws java.io.IOException
Returns a Vector with the elements represented as a Tag.
Specified by:
toTags in interface Externalizable
Returns:
com.ibm.dse.base.Vector

unchain

public void unchain()
             throws DSEInvalidRequestException,
                    DSEObjectNotFoundException
Removes this context and all its children from the context tree. Also maintains the consistency of the context tree.

writeExternal

public void writeExternal()
                   throws java.io.IOException
Writes this instance converted in tags to a file.
Specified by:
writeExternal in interface Externalizable

writeExternal

public void writeExternal(java.io.ObjectOutput s)
                   throws java.io.IOException
Provides concrete serialization handling for Context. Will be serialized the current context and all its children.
Parameters:
s - java.io.ObjectOutput
Throws:
java.io.IOException -