com.softwareag.tamino.db.api.response
Class TInputStreamInterpreter

java.lang.Object
  extended by com.softwareag.tamino.db.api.response.TInputStreamInterpreter
Direct Known Subclasses:
TDOMInputStreamInterpreter, TMeagerInputStreamInterpreter, TSaxHelperInputStreamInterpreter, TSAXInputStreamInterpreter, TStreamInputStreamInterpreter

public abstract class TInputStreamInterpreter
extends java.lang.Object

TInputStreamInterpreter defines the abstract base class for interpreting a TInputStream object. Its purpose it to interpret a TInputStream containing a Tamino response document and extract the documents information and query content. Each concrete implementation has to provide the plug in method doInterpret which does the main interpreting according the physical object model that is in use.

Version:
$Revision: 1.17 $
Author:
Marcus Schreyer

Field Summary
protected static TTimeLogger timeLogger
          The central instance for time logging of the API.
 
Constructor Summary
protected TInputStreamInterpreter()
          Initializes the interpreter.
 
Method Summary
protected abstract  void doInterpret(TInputStream inputStream)
          Performs the concrete interpretation of the TInputStream according the physical object model.
 java.util.Locale getLocale()
          Gets the locale.
 TResponseInfoContent getResponseInfoContent()
          Gets the TResponseInfoContent instance for the previous interpretation process.
 TResponseQueryContent getResponseQueryContent()
          Gets the TResponseQueryContent instance for the previous interpretation process.
 void interpret(TInputStream inputStream)
          Interprets the given TInputStream instance.
 void setLocale(java.util.Locale locale)
          Sets the locale.
abstract  void setProperty(java.lang.String key, java.lang.Object value)
          Sets a generic property on the concrete interpreter instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeLogger

protected static TTimeLogger timeLogger
The central instance for time logging of the API.

Constructor Detail

TInputStreamInterpreter

protected TInputStreamInterpreter()
Initializes the interpreter.

Method Detail

interpret

public void interpret(TInputStream inputStream)
               throws TStreamInterpretException
Interprets the given TInputStream instance. This method serves as a template method and it internally invokes the plug-in method doInterpret that is being provided by the implementation class.

Parameters:
inputStream - is the stream for a previous Tamino command operation.
Throws:
TStreamInterpretException - when interpreting errors occur.

getResponseInfoContent

public TResponseInfoContent getResponseInfoContent()
Gets the TResponseInfoContent instance for the previous interpretation process.

Returns:
TResponseInfoContent instance that represents the general response state information.

getResponseQueryContent

public TResponseQueryContent getResponseQueryContent()
Gets the TResponseQueryContent instance for the previous interpretation process. Please note that a response content is only available in case the input stream handed to the previous interpretation process is related to a query response.

Returns:
TResponseQueryContent if the previous interpret has been used for a query operation, an empty container otherwise.

setLocale

public void setLocale(java.util.Locale locale)
Sets the locale.


getLocale

public java.util.Locale getLocale()
Gets the locale.

Returns:
the locale.

setProperty

public abstract void setProperty(java.lang.String key,
                                 java.lang.Object value)
Sets a generic property on the concrete interpreter instance. The properties that can actually be set depend on the TXMLObjectModel that is related to the concrete interpreter. Each interpreter that might be instantiated is related to a TXMLObjectModel. Here the user can set specific properties that might be relevant as additional parameters to the interpreter.


doInterpret

protected abstract void doInterpret(TInputStream inputStream)
                             throws TStreamInterpretException
Performs the concrete interpretation of the TInputStream according the physical object model. As a side effect the TResponseInfoContent object is generated. If the given TInputStream is related to a previous query command a TResponseQueryContent object is generated as well. Please note, that this operation is invoked as a plugin method by the invoke operation. As a consequence, the cleared response info content can be obtained by getResponseQueryContent and the cleared response query content can be obtained with getResponseQueryContent respectively. This operation has only to interpret the input streams Tamino XML response document with respect to information and query content. Given headers are at this stage already set by the interpret operation.

Parameters:
inputStream - is the stream for a previous Tamino command operation.
Throws:
TStreamInterpretException - when interpreting errors occur.


Copyright (c) 2013 Software AG. All Rights Reserved.