com.ibm.dse.base
Class ContextExternalizer

java.lang.Object
  |
  +--com.ibm.dse.base.Externalizer
        |
        +--com.ibm.dse.base.ContextExternalizer

public class ContextExternalizer
extends Externalizer

The ContextExternalizer class reads contexts. The SGML file must be specified in DSE.INI in the path settings.files.context. The tags must be in settings.tags.contexts.


Fields inherited from class com.ibm.dse.base.Externalizer
tagClassTable, tagInputStream, TYPE_CONTEXT, TYPE_DATA, TYPE_FORMAT, TYPE_OPERATION, TYPE_PROCESSOR, TYPE_SERVICE, TYPE_SETTINGS, TYPE_TYPE, TYPE_UNKNOWN, TYPE_VIEW
 
Constructor Summary
ContextExternalizer()
          This constructor creates a ContextExternalizer object.
ContextExternalizer(java.lang.String option, java.io.BufferedInputStream aIniStream)
          This constructor creates a new instance of the ContextExternalizer class.
ContextExternalizer(java.lang.String option, java.lang.String pathAndFile)
          This constructor creates a new instance of the ContextExternalizer class.
 
Method Summary
protected  Externalizer createNewExternalizer()
          Returns a new externalizer for the generic context file.
 void end()
          Releases resources from this externalizer
static void linkContext(Tag parentTag)
          Deprecated. Replaced by linkContext(Tag, TagInputStream).
static void linkContext(Tag parentTag, TagInputStream aTagInputStream)
          This method will add to parentTag (context tag), a subtag that is the parent context.
static void linkReferences(Tag parentTag)
          This method alters the tag structure of the tagInputStream for DSECTXT by linking all references to their real tags.
protected static void linkReferences(Tag parentTag, TagInputStream aTagInputStream)
          This method alters the tag structure of the tagInputStream for DSECTXT by linking all references to their real tags.
static void linkRefKColl(Tag parentTag)
          This method will add the real corresponding tag as a subtag to parentTag ("refKColl" tag).
static void linkRefService(Tag parentTag)
          This method will add the real corresponding tag as a subtag to parentTag ("refService" tag).
 void makeTagClassTable()
          Makes the tagClassTable with the values in DSE.INI The path is: settings.tags.contexts.
 void reset()
          Sets a new context externalizer to Context.
 void reset(java.util.Enumeration listTagId)
          Resets the definition of tags which tag id appears in listTagId.
 void reset(java.lang.String tagId)
          Resets the definition of the tag with id tagId.
protected  void reset(java.lang.String tagId, TagInputStream aTagInputStream)
          Resets the definition of the context entity with id equals to tagId.
 
Methods inherited from class com.ibm.dse.base.Externalizer
convertTagToObject, getClasses, getTagClassTable, getTagInputStream, getTagOutputStream, isRunTime, readObject, readObject, readTag, setRunTime, setTagClassTable, setTagInputStream, tagList, tagWithId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextExternalizer

public ContextExternalizer()
This constructor creates a ContextExternalizer object.

ContextExternalizer

public ContextExternalizer(java.lang.String option,
                           java.io.BufferedInputStream aIniStream)
                    throws java.io.IOException
This constructor creates a new instance of the ContextExternalizer class. Option can be Memory or File.Memory means that all tags are stored in memory. This is recommended with small files.File means that the file is read everytime you need a tag. This is recommended with large files.
Parameters:
option - java.lang.String
aIniStream - java.io.BufferedInputStream

ContextExternalizer

public ContextExternalizer(java.lang.String option,
                           java.lang.String pathAndFile)
                    throws java.io.IOException
This constructor creates a new instance of the ContextExternalizer class. Option can be Memory or File.Memory means that all tags are stored in memory. This is recommended with small files.File means that the file is read everytime you need a tag. This is recommended with large files.
Parameters:
option - java.lang.String
pathAndFile - java.lang.String
Method Detail

createNewExternalizer

protected Externalizer createNewExternalizer()
                                      throws java.io.IOException,
                                             DSEObjectNotFoundException
Returns a new externalizer for the generic context file.
Returns:
com.ibm.dse.base.Externalizer
Throws:
java.io.IOException -  
DSEObjectNotFoundException -  

end

public void end()
Releases resources from this externalizer
Overrides:
end in class Externalizer

linkContext

public static void linkContext(Tag parentTag)
                        throws java.io.IOException,
                               DSEObjectNotFoundException
Deprecated. Replaced by linkContext(Tag, TagInputStream).

This method will add to parentTag (context tag), a subtag that is the parent context.

linkContext

public static void linkContext(Tag parentTag,
                               TagInputStream aTagInputStream)
                        throws java.io.IOException,
                               DSEObjectNotFoundException
This method will add to parentTag (context tag), a subtag that is the parent context.

linkReferences

public static void linkReferences(Tag parentTag)
                           throws java.io.IOException,
                                  DSEObjectNotFoundException
This method alters the tag structure of the tagInputStream for DSECTXT by linking all references to their real tags. This method will add the real corresponding tag as a subtag to all "refKColl", and "refService" tags. This method will also add to each context, a subtag that is the parent context. The parentTag and all its subtags will have their names checked for "context", "refKColl", or "refService" tag.
Parameters:
parentTag - com.ibm.dse.base.Tag
Throws:
java.io.IOException -  
DSEObjectNotFoundException -  

linkReferences

protected static void linkReferences(Tag parentTag,
                                     TagInputStream aTagInputStream)
                              throws java.io.IOException,
                                     DSEObjectNotFoundException
This method alters the tag structure of the tagInputStream for DSECTXT by linking all references to their real tags. This method will add the real corresponding tag as a subtag to all "refKColl", and "refService" tags. This method will also add to each context, a subtag that is the parent context. The parentTag and all its subtags will have their names checked for "context", "refKColl", or "refService" tag. The aTagInputStream is the input stream where references are searched.
Parameters:
parentTag - com.ibm.dse.base.Tag
Throws:
java.io.IOException -  
DSEObjectNotFoundException -  

linkRefKColl

public static void linkRefKColl(Tag parentTag)
                         throws java.io.IOException,
                                DSEObjectNotFoundException
This method will add the real corresponding tag as a subtag to parentTag ("refKColl" tag).

linkRefService

public static void linkRefService(Tag parentTag)
                           throws java.io.IOException,
                                  DSEObjectNotFoundException
This method will add the real corresponding tag as a subtag to parentTag ("refService" tag).

makeTagClassTable

public void makeTagClassTable()
Makes the tagClassTable with the values in DSE.INI The path is: settings.tags.contexts.
Overrides:
makeTagClassTable in class Externalizer

reset

public void reset()
           throws java.io.IOException,
                  DSEObjectNotFoundException
Sets a new context externalizer to Context.
Throws:
java.io.IOException -  
DSEObjectNotFoundException -  

reset

public void reset(java.lang.String tagId)
           throws java.io.IOException,
                  DSEObjectNotFoundException
Resets the definition of the tag with id tagId. The new definition is read and its references solved from the file associated with this externalizer. If the tag doesn't exist in the file but exists in memory then memory definition is deleted. If the tag doesn't exist neither in the file nor in memory then an exception is thrown. If the tag exists in the file but doesn't exist in memory then the new definition is added to memory. If the tag exists both in the file and in memory then the memory definition is updated with the file definition.
Parameters:
tagId - java.lang.String The id of the tag to reset.
Throws:
java.io.IOException -  
DSEObjectNotFoundException -  

reset

protected void reset(java.lang.String tagId,
                     TagInputStream aTagInputStream)
              throws java.io.IOException
Resets the definition of the context entity with id equals to tagId. The new definition is obtained from the TagInputStream passed by parameter. If the tag doesn't exist in the TagInputStream but exists in memory then memory definition is deleted. If the tag doesn't exist neither in the TagInputStream nor in memory then an exception is thrown. If the tag exists in the TagInputStream but doesn't exist in memory then the new definition is added to memory. If the tag exists both in the TagInputStream and in memory then the memory definition is updated with the TagInputStream definition.
Parameters:
tagId - java.lang.String
aTagInputStream - com.ibm.dse.base.TagInputStream
Throws:
java.io.IOException -  

reset

public void reset(java.util.Enumeration listTagId)
           throws java.io.IOException,
                  DSEObjectNotFoundException
Resets the definition of tags which tag id appears in listTagId. The new definition are read and its references solved from the file associated with this externalizer. If the tag doesn't exist in the file but exists in memory then memory definition is deleted. If the tag doesn't exist neither in the file nor in memory then an exception is thrown. If the tag exists in the file but doesn't exist in memory then the new definition is added to memory. If the tag exists both in the file and in memory then the memory definition is updated with the file definition.
Parameters:
listTagId - java.util.Enumeration
Throws:
java.io.IOException -  
DSEObjectNotFoundException -