|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.dse.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 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 |
protected static Externalizer externalizer
Constructor Detail |
public Context()
public Context(java.lang.String aName) throws java.io.IOException
aName
- java.lang.Stringpublic Context(java.lang.String aName, java.lang.String aType, Context aParent) throws DSEInvalidRequestException
aName
- java.lang.StringaType
- java.lang.StringaParent
- com.ibm.dse.base.Contextpublic Context(java.lang.String aName, java.lang.String aType, Context aContext, KeyedCollection aKeyedCollection) throws DSEInvalidRequestException
aName
- java.lang.StringaType
- java.lang.StringaContext
- com.ibm.dse.base.ContextaKeyedCollection
- com.ibm.dse.base.KeyedCollectionpublic Context(java.lang.String aName, java.lang.String aType, KeyedCollection aKeyedCollection)
aName
- java.lang.StringaType
- java.lang.StringaKeyedCollection
- com.ibm.dse.base.KeyedCollectionpublic Context(java.lang.String aName, java.lang.String aType, java.lang.String aContextName) throws DSEInvalidRequestException
aName
- java.lang.StringaType
- java.lang.StringaContextName
- java.lang.StringMethod Detail |
public static void addApplicationSession(java.lang.String aSession, java.lang.String aParentSession, Context aContext) throws DSEInvalidRequestException
aSession
- java.lang.StringaParentSession
- java.lang.StringaContext
- com.ibm.dse.base.Contextpublic void addElement(DataElement aDataElement) throws DSEInvalidRequestException
public void addNotifier(Notifier aNotifier, java.lang.String aNotifierName, java.lang.String aNotifierType) throws DSEInvalidRequestException
public void addService(Service aService, java.lang.String aServiceName, java.lang.String aServiceType) throws DSEInvalidRequestException
public static void addSession(SessionEntry se) throws DSEInvalidRequestException
se
- com.ibm.dse.base.SessionEntrypublic static void addSession(java.lang.String aType, java.lang.Long aTimeStamp, java.lang.String aSession, java.lang.String aTID, Context aContext) throws DSEInvalidRequestException
aType
- java.lang.StringaTimeStamp
- java.lang.LongaSession
- java.lang.StringaTID
- java.lang.StringaContext
- com.ibm.dse.base.Contextpublic static void addSession(java.lang.String aSession, java.lang.String aTID, Context aContext) throws DSEInvalidRequestException
aSession
- java.lang.StringaTID
- java.lang.StringaContext
- com.ibm.dse.base.Contextpublic void chainTo(Context aContext) throws DSEInvalidRequestException
public void chainToContextNamed(java.lang.String aContextName) throws DSEInvalidRequestException, DSEObjectNotFoundException
public void chainToCurrentContext() throws DSEInvalidRequestException
public static void checkExpiredSessions() throws DSEInvalidRequestException, DSEObjectNotFoundException
public void clearKeyedCollection()
public boolean containsChild(java.lang.String aContextName)
public static Context currentContext()
public Externalizer externalizer()
public Vector fields()
public Vector getChildren()
public Context getContextByType(java.lang.String aTypeName)
public static Context getContextNamed(java.lang.String aContextName) throws DSEInvalidRequestException
public static CSClientService getCSClient()
public static CSServerService getCSServer()
public Context getCurrentContext()
public static Context getCurrentContextForSession(java.lang.String aSession) throws DSEInvalidRequestException, DSEObjectNotFoundException
aSession
- java.lang.Stringpublic static Context getCurrentContextForSession(java.lang.String aSession, java.lang.String anApplication) throws DSEInvalidRequestException, DSEObjectNotFoundException
aSession
- java.lang.StringanApplication
- java.lang.Stringpublic DataElement getElementAt(java.lang.String aCompositeKey) throws DSEObjectNotFoundException
public static Externalizer getExternalizer()
public KeyedCollection getKeyedCollection()
public java.lang.String getName()
public Context getNextContextNamed(java.lang.String aContextName) throws DSEInvalidRequestException
aContextName
- java.lang.Stringpublic Notifier getNotifier(java.lang.String aNotifierName) throws DSEObjectNotFoundException
public Notifier getNotifierByType(java.lang.String aNotifierType) throws DSEObjectNotFoundException
protected Hashtable getNotifiers()
public Context getParent()
public static Context getRoot()
public Service getService(java.lang.String aServiceName) throws DSEObjectNotFoundException
public Service getServiceByType(java.lang.String aServiceType) throws DSEObjectNotFoundException
public Hashtable getServices()
public static SessionEntry getSession(java.lang.String aSession) throws DSEInvalidRequestException, DSEObjectNotFoundException
public static java.lang.String getSessionForTID(java.lang.String tid) throws DSEInvalidRequestException, DSEObjectNotFoundException
tid
- java.lang.Stringpublic static java.lang.Object getSessionObjectForSession(java.lang.String aSession) throws DSEInvalidRequestException, DSEObjectNotFoundException
aSession
- java.lang.Stringpublic static SessionTable getSessionTable() throws DSEInvalidRequestException
public java.lang.String getTagName()
public static java.lang.String getTIDForSession(java.lang.String aSession) throws DSEInvalidRequestException, DSEObjectNotFoundException
aSession
- java.lang.Stringpublic static java.lang.Long getTimeStampForSession(java.lang.String aSession) throws DSEInvalidRequestException, DSEObjectNotFoundException
aSession
- java.lang.Stringpublic java.lang.String getType()
public static java.lang.String getTypeForSession(java.lang.String aSession) throws DSEInvalidRequestException, DSEObjectNotFoundException
aSession
- java.lang.Stringpublic java.lang.Object getValueAt(java.lang.String aCompositeKey) throws DSEObjectNotFoundException
public boolean hasChildren()
public boolean hasNotifiers()
public boolean hasServices()
public java.lang.Object initializeContextFrom(Tag aContextTag) throws java.io.IOException
aContextTag
- com.ibm.dse.base.Tagpublic java.lang.Object initializeFrom(Tag aTag) throws java.io.IOException, DSEException
aTag
- com.ibm.dse.base.Tagpublic java.lang.Object initializeKeyedCollectionFrom(Tag aTag) throws java.io.IOException
aTag
- com.ibm.dse.base.Tagpublic java.lang.Object initializeKeyedCollectionValueFrom(Tag aTag) throws java.io.IOException
aTag
- com.ibm.dse.base.Tagpublic java.lang.Object initializeServiceFrom(Tag aTag) throws java.io.IOException
aTag
- com.ibm.dse.base.Tagpublic java.lang.Object initializeTypeFrom(Tag aTag) throws java.io.IOException
aTag
- com.ibm.dse.base.Tagpublic boolean isAddToDynamicKColl()
public boolean isChained()
public static boolean isContext(java.lang.String aContextName) throws DSEInvalidRequestException
public boolean isRoot()
public static int occurrencesNamed(java.lang.String aContextName) throws DSEInvalidRequestException
public void prune() throws DSEInvalidRequestException, DSEObjectNotFoundException
public void readExternal() throws java.io.IOException
public void readExternal(TagInputStream aTIS) throws java.io.IOException
s
- java.io.InputStreampublic void readExternal(java.io.ObjectInput s) throws java.io.IOException, java.lang.ClassNotFoundException
s
- java.io.ObjectInputpublic static java.lang.Object readObject(java.lang.String name) throws java.io.IOException
name
- java.lang.Stringpublic DataElement removeAt(java.lang.String aCompositeKey) throws DSEObjectNotFoundException, DSEInvalidRequestException
public void removeExternal() throws java.io.IOException
public void removeNotifier(java.lang.String aNotifierName) throws DSEObjectNotFoundException, DSEException
public void removeService(java.lang.String aServiceName) throws DSEObjectNotFoundException, DSEException
public static void removeSession(java.lang.String aSession) throws DSEObjectNotFoundException, DSEInvalidArgumentException, DSEInvalidRequestException
aSession
- java.lang.Stringpublic static void removeSession(java.lang.String aSession, java.lang.String anApplication) throws DSEObjectNotFoundException, DSEInvalidArgumentException, DSEInvalidRequestException
aSession
- java.lang.StringanApplication
- java.lang.Stringpublic static void reset() throws DSEException
public void setAddToDynamicKColl(boolean newValue)
newValue
- boolean The new value of the property.public void setAsCurrentChild() throws DSEInvalidRequestException
public void setAsCurrentContext() throws DSEInvalidRequestException
public void setChildren(Vector aChildrenCollection)
public static void setCurrentContextForSession(java.lang.String aSession, Context aContext) throws DSEObjectNotFoundException, DSEInvalidArgumentException, DSEInvalidRequestException
aSession
- java.lang.StringaContext
- com.ibm.dse.base.Contextpublic static void setCurrentContextForSession(java.lang.String aSession, java.lang.String anApplication, Context aContext) throws DSEObjectNotFoundException, DSEInvalidArgumentException, DSEInvalidRequestException
aSession
- java.lang.StringanApplication
- java.lang.StringaContext
- com.ibm.dse.base.Contextpublic static void setExternalizer(Externalizer anExternalizer)
public void setKeyedCollection(KeyedCollection aKeyedCollection)
public void setName(java.lang.String aContextName)
aName
- java.lang.Stringpublic void setServices(Hashtable aHashtable)
aHashtable
- com.ibm.dse.base.Hashtablepublic static void setSessionObjectForSession(java.lang.String aSession, java.lang.Object aSessionObject) throws DSEObjectNotFoundException, DSEInvalidArgumentException, DSEInvalidRequestException
aSession
- java.lang.StringaSessionObject
- Objectpublic static void setTimeStampForSession(java.lang.String aSession, java.lang.Long aTimeStamp) throws DSEInvalidArgumentException, DSEInvalidRequestException, DSEObjectNotFoundException
aSession
- java.lang.StringaTimeStamp
- java.lang.Longpublic void setType(java.lang.String aContextType)
public static void setTypeForSession(java.lang.String aSession, java.lang.String aType) throws DSEInvalidArgumentException, DSEInvalidRequestException, DSEObjectNotFoundException
aSession
- java.lang.StringaTtpe
- java.lang.Stringpublic void setValueAt(java.lang.String aCompositeKey, java.lang.Object aDataValue) throws DSEInvalidArgumentException, DSEObjectNotFoundException
public void stopNotifiers()
public void stopNotifiersInChildren()
public void stopServices()
public void stopServicesInChildren()
public void terminateServices() throws DSEException
public java.lang.String toString()
public Vector toStrings()
public Vector toTags() throws java.io.IOException
public void unchain() throws DSEInvalidRequestException, DSEObjectNotFoundException
public void writeExternal() throws java.io.IOException
public void writeExternal(java.io.ObjectOutput s) throws java.io.IOException
s
- java.io.ObjectOutput
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |