com.softwareag.tamino.db.api.invocation
Class TInvocationRequestWriter

java.lang.Object
  extended by com.softwareag.tamino.db.api.invocation.TInvocationRequestWriter
Direct Known Subclasses:
THTTPInvocationRequestWriter, TWSLInvocationRequestWriter

public abstract class TInvocationRequestWriter
extends java.lang.Object

TInvocationRequestWriter defines the operations needed to write a Tamino specific command request (e.g. _process=Test&_sessionid=id&_sessionkey=key into an underlying request specific output stream. This abstract class has to be implemented for each communication specific implementation such as HTTP, XTS etc.

Version:
$Revision: 1.7 $
Author:
Marcus Schreyer

Nested Class Summary
protected  class TInvocationRequestWriter.TCommandItemPairWriter
          TCommandItemPairWriter
 
Constructor Summary
protected TInvocationRequestWriter()
          Initializes the request writer.
 
Method Summary
protected abstract  void close()
          Closes the invocation request.
 java.util.Locale getLocale()
          Gets the locale.
protected abstract  boolean isClosed()
          Indicates if request writer is currently closed meaning that it is not possible to write any command statements into a Tamino request.
 void setLocale(java.util.Locale locale)
          Sets the locale.
protected abstract  void write(java.lang.String key, java.lang.String value)
          Writes the given key/value pair into the invocation request.
protected abstract  void write(java.lang.String key, TStreamable value)
          Writes the given key/value pair into the invocation request.
 void write(TCommandStatement commandStatement)
          Writes the entire command statement into the invocation request and flushes the underlying output stream afterwards.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TInvocationRequestWriter

protected TInvocationRequestWriter()
Initializes the request writer.

Method Detail

write

public void write(TCommandStatement commandStatement)
           throws TInvocationRequestNotWritableException
Writes the entire command statement into the invocation request and flushes the underlying output stream afterwards.

Throws:
TInvocationRequestNotWritableException

write

protected abstract void write(java.lang.String key,
                              java.lang.String value)
                       throws TInvocationRequestNotWritableException
Writes the given key/value pair into the invocation request. Serves as a plug in method for this class.

Parameters:
key - that identifies a Tamino specific command key (e.g. _process).
value - is referred to the key and might be the content for a Tamino specific command.
Throws:
TRequestNotWritableException - if any problems during writing occur.
TInvocationRequestNotWritableException

write

protected abstract void write(java.lang.String key,
                              TStreamable value)
                       throws TInvocationRequestNotWritableException
Writes the given key/value pair into the invocation request. Serves as a plug in method for this class.

Parameters:
key - that identifies a Tamino specific command key (e.g. _process).
value - is referred to the key and might be the content for a Tamino specific command. The value is here given as a TStreamable instance.
Throws:
TRequestNotWritableException - if any problems during writing occur.
TInvocationRequestNotWritableException

close

protected abstract void close()
                       throws TInvocationRequestNotWritableException
Closes the invocation request. The data that has been written to an underlying output stream is flushed here. Serves as a plug in method for this class.

Throws:
TInvocationRequestNotWritableException

isClosed

protected abstract boolean isClosed()
Indicates if request writer is currently closed meaning that it is not possible to write any command statements into a Tamino request. Whether a closed invocation request writer can be reopenned depends on the concrete implementation. Please note that an invocation request writer is normally closed once a command statement has been written to the request. This might however depend on the concrete implementation.

Returns:
true if invocation writer has been closed, true otherwise.

setLocale

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


getLocale

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

Returns:
the locale.


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