com.softwareag.tamino.db.api.invocation
Interface TInvocation

All Known Subinterfaces:
TRetryInvocation
All Known Implementing Classes:
TAbstractInvocation, THTTPInvocation, THTTPSInvocation, TWSLInvocation

public interface TInvocation

TInvocation defines operations needed to invoke a command statement on Tamino. Such command statements are reflected by TCommandStatement instances. By abstracting the invocation of a command statement, the client is not concerned with implementing communication specific code once it comes up to the invocation of a TCommandStatement instance. Each invocation leads to a TInputStream that represents the obtained input input stream.

Version:
$Revision: 1.19 $
Author:
Marcus Schreyer

Method Summary
 void close()
          Closes the invocation capability on Tamino.
 TUri getDatabaseUri()
          Gets the database uri of this invocation.
 TCommandStatement getLastExecutedCommandStatement()
          Gets the last executed command statement!
 long getLastNonActivityTimeoutRelevantInvokeTimeMillis()
          Gets the time of the last invoke which is relevant for the nonActivityTimeout!
 java.util.Locale getLocale()
          Gets Locale
 TPooledConnectionReconnectHandler getPooledConnectionReconnectHandler()
          Gets the handler for automatic reconnects of pooled connections
 int getSocketTimeout()
           
 TInputStream invoke(TCommandStatement commandStatement)
          Invokes a specific command given by a TCommandStatement on an underlying Tamino database.
 TInputStream invoke(TCommandStatement commandStatement, java.lang.String collection)
          Invokes a specific command given by a TCommandStatement on an underlying Tamino database.
 TInputStream invoke(TCommandStatement commandStatement, java.lang.String collection, java.lang.String doctype, java.lang.String docname)
          Invokes a specific command given by a TCommandStatement on an underlying Tamino database.
 boolean isClosed()
          Indicates if the invocation is closed.
 void setLocale(java.util.Locale locale)
          Sets Locale
 void setPooledConnectionReconnectHandler(TPooledConnectionReconnectHandler handler)
          Sets the handler for automatic reconnects of pooled connections
 void setSocketTimeout(int timeout)
          This value indicates to use Tamino default values for the timeout parameters.
 void setTransactionModeCoordinator(TTransactionModeCoordinator transactionModeCoordinator)
          Sets a TTransactionModeCoordinator on the instance.
 boolean supports(TCommand command)
          Indicates if the given command is supported for invocation in the current state.
 

Method Detail

invoke

TInputStream invoke(TCommandStatement commandStatement)
                    throws TInvocationException
Invokes a specific command given by a TCommandStatement on an underlying Tamino database. The result is handed back as a TInputStream instance. This version of invoke always uses a potential given transaction state. For a more explicit control whether a transaction state should be considered use the overloaded method with the additional useTransactionState method.

Parameters:
commandStatement - spcifies the concrete XML specific action that should be fullfilled.
Returns:
TInputStream representing Tamino's response as a core input stream.
Throws:
TInvocationException - due to any problems that can occur when performing the invocation on Tamino.

invoke

TInputStream invoke(TCommandStatement commandStatement,
                    java.lang.String collection)
                    throws TInvocationException
Invokes a specific command given by a TCommandStatement on an underlying Tamino database. This version always uses a transaction state that might has been set. If this has to be omitted use the overloaded version of this method with the additional useTransactionState parameter. The result is handed back as a TInputStream instance.

Parameters:
commandStatement - spcifies the concrete action that should be fullfilled.
collection - is the collection of the Tamino DB where the object is contained in.
Returns:
TInputStream representing Tamino's response as a core input stream.
Throws:
TInvocationException - due to any problems that can occur when performing the invocation on Tamino.

invoke

TInputStream invoke(TCommandStatement commandStatement,
                    java.lang.String collection,
                    java.lang.String doctype,
                    java.lang.String docname)
                    throws TInvocationException
Invokes a specific command given by a TCommandStatement on an underlying Tamino database. This version always uses a transaction state that might has been set. If this has to be omitted use the overloaded version of this method with the additional useTransactionState parameter. The result is handed back as a TInputStream instance.

Parameters:
commandStatement - spcifies the concrete action that should be fullfilled.
collection - is the collection of the Tamino DB where the object is contained in.
doctype - within a schema of a collection to which the statement is related.
docname - denotes the docname under which a specific document might be accessible.
Returns:
TInputStream representing Tamino's response as a core input stream.
Throws:
TInvocationException - due to any problems that can occur when performing the invocation on Tamino.

supports

boolean supports(TCommand command)
Indicates if the given command is supported for invocation in the current state.

Parameters:
command - is checked wheter it can be invoked the current state of the TInvocation instance.
Returns:
true if the given command can be invoked in the current state, false otherwise.

setTransactionModeCoordinator

void setTransactionModeCoordinator(TTransactionModeCoordinator transactionModeCoordinator)
Sets a TTransactionModeCoordinator on the instance. TCommandInvocation probably needs this to update a transaction mode when transaction specific commands are invoked.

Parameters:
TTransactionModeCoordinator - needed to update session state for session specific operations.

close

void close()
           throws TInvocationException
Closes the invocation capability on Tamino. As a result any internal resources needed for the invocation on Tamino are closed. This invocation instance can afterwards not be used any longer.

Throws:
TInvocationException - due to any problems that can occur when performing the invocation on Tamino.

isClosed

boolean isClosed()
Indicates if the invocation is closed.

Returns:
true if connection is closed, false otherwise.

getDatabaseUri

TUri getDatabaseUri()
Gets the database uri of this invocation.

Returns:
the database uri if given, otherwise null.

getLastNonActivityTimeoutRelevantInvokeTimeMillis

long getLastNonActivityTimeoutRelevantInvokeTimeMillis()
Gets the time of the last invoke which is relevant for the nonActivityTimeout!

Returns:
the time in milli seconds. A value of -1 indicates that a command has not yet been executed.

getLastExecutedCommandStatement

TCommandStatement getLastExecutedCommandStatement()
Gets the last executed command statement!

Returns:
last executed command statement.

setPooledConnectionReconnectHandler

void setPooledConnectionReconnectHandler(TPooledConnectionReconnectHandler handler)
Sets the handler for automatic reconnects of pooled connections


getPooledConnectionReconnectHandler

TPooledConnectionReconnectHandler getPooledConnectionReconnectHandler()
Gets the handler for automatic reconnects of pooled connections

Returns:
the TPooledConnectionReconnectHandler for automatic reconnects of pooled connections.

setLocale

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


getLocale

java.util.Locale getLocale()
Gets Locale

Returns:
Locale.

setSocketTimeout

void setSocketTimeout(int timeout)
This value indicates to use Tamino default values for the timeout parameters.


getSocketTimeout

int getSocketTimeout()


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