com.softwareag.tamino.db.api.invocation.http
Class THTTPInvocationRequestWriter

java.lang.Object
  extended by com.softwareag.tamino.db.api.invocation.TInvocationRequestWriter
      extended by com.softwareag.tamino.db.api.invocation.http.THTTPInvocationRequestWriter

public class THTTPInvocationRequestWriter
extends TInvocationRequestWriter

THTTPInvocationRequestWriter is the HTTP specific implementation class for TInvocationRequestWriter. A Tamino specific command statement is written to a HTTP request according the content-type Multipart/Form-data.

Version:
$Revision: 1.19 $
Author:
Marcus Schreyer

Nested Class Summary
 
Nested classes/interfaces inherited from class com.softwareag.tamino.db.api.invocation.TInvocationRequestWriter
TInvocationRequestWriter.TCommandItemPairWriter
 
Constructor Summary
THTTPInvocationRequestWriter()
          Initializes the request writer.
THTTPInvocationRequestWriter(java.net.HttpURLConnection httpConnection)
          Initializes the request writer.
 
Method Summary
protected  void close()
          Closes the invocation request.
protected  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 setConnection(java.net.HttpURLConnection httpConnection)
          Sets a new HttpURLConnection so that a new invocation request can be written.
protected  void write(java.lang.String key, java.lang.String value)
          Writes the given key/value pair into the invocation request.
protected  void write(java.lang.String key, TStreamable value)
          Writes the given key/value pair into the invocation request.
 
Methods inherited from class com.softwareag.tamino.db.api.invocation.TInvocationRequestWriter
getLocale, setLocale, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

THTTPInvocationRequestWriter

public THTTPInvocationRequestWriter()
Initializes the request writer.


THTTPInvocationRequestWriter

public THTTPInvocationRequestWriter(java.net.HttpURLConnection httpConnection)
                             throws TInvocationRequestNotWritableException
Initializes the request writer.

Throws:
TInvocationRequestNotWritableException
Method Detail

setConnection

public void setConnection(java.net.HttpURLConnection httpConnection)
                   throws TInvocationRequestNotWritableException
Sets a new HttpURLConnection so that a new invocation request can be written.

Parameters:
httpConnection - to which the invocation request is written.
Throws:
TInvocationRequestNotWritableException

write

protected 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.

Specified by:
write in class TInvocationRequestWriter
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 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.

Specified by:
write in class TInvocationRequestWriter
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 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.

Specified by:
close in class TInvocationRequestWriter
Throws:
TInvocationRequestNotWritableException

isClosed

protected 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.

Specified by:
isClosed in class TInvocationRequestWriter
Returns:
true if invocation writer has been closed, true otherwise.


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