com.softwareag.tamino.db.api.response
Interface TResponse

All Superinterfaces:
TResponseContent
All Known Subinterfaces:
TResponseHandle
All Known Implementing Classes:
TAbstractResponse, TResponseHandleImpl, TSerializedResponse

public interface TResponse
extends TResponseContent

Defines operations for accessing the information provided by Tamino in response to a database request (e.g. query, insert operations).

This includes the return value and the result of the current operation. If database objects are returned, you can access them either by using getXMLObjectIterator and getNonXMLObjectIterator, or by using getFirstXMLObject and getFirstNonXMLObject. You can access the result string by using getQueryContentAsString.

When an XQuery has been executed and response wrapping has been switched off, than if the content type of the pure unwrapped response is xml content, the content may be accessed via getFirstXMLObject(), otherwise if it is a non xml content, it may be accessed via getQueryContentAsString().

Version:
$Revision: 1.12 $
Author:
Marcus Schreyer

Method Summary
 TNonXMLObject getFirstNonXMLObject()
          Gets the first non-XML object returned.
 TXMLObject getFirstXMLObject()
          Gets the first XML object returned.
 TNonXMLObjectIterator getNonXMLObjectIterator()
          Gets the non-XML object iterator.
 TInputStream getQueryContentAsStream()
          Gets the result of a query as a InputStream.
 java.lang.String getQueryContentAsString()
          Gets the result of a query as a string.
 java.lang.String getReturnValue()
          Gets the Tamino return code.
 java.util.Iterator getWarnings()
          Gets an iterator for the list of TWarning instances containing the Tamino warnings.
 TXMLObjectIterator getXMLObjectIterator()
          Gets the XML object iterator.
 boolean hasFirstNonXMLObject()
          Indicates if the response provides a first TNonXMLObject instance.
 boolean hasFirstXMLObject()
          Indicates if the response provides a first TXMLObject instance.
 boolean hasQueryContent()
          Indicates if the response of Tamino contained any result information.
 boolean hasWarnings()
          Indicates if the response of Tamino contained any warning information.
 

Method Detail

getReturnValue

java.lang.String getReturnValue()
Gets the Tamino return code.

Returns:
The Tamino return code.

getXMLObjectIterator

TXMLObjectIterator getXMLObjectIterator()
Gets the XML object iterator. A TXMLObjectIterator instance is only available for a query operation and if the query produced a result (hasQueryContent() == true) containing at least one TXMLObject instance (hasFirstXMLObject() == true).

Returns:
The TXMLObjectIterator instance. This is only available if the current operation is a query operation, otherwise null is returned.

getFirstXMLObject

TXMLObject getFirstXMLObject()
Gets the first XML object returned. The first TXMLObject instance is only available for a query operation and if the query produced a result (hasQueryContent() == true) containing at least one TXMLObject instance (hasFirstXMLObject() == true).

Returns:
the first TXMLObject if present, null otherwise.

hasFirstXMLObject

boolean hasFirstXMLObject()
Indicates if the response provides a first TXMLObject instance. Indicates whether the response provides XML nodes or not.

Returns:
true if the response contains at least one TXMLObject, false otherwise.

getNonXMLObjectIterator

TNonXMLObjectIterator getNonXMLObjectIterator()
Gets the non-XML object iterator. A TNonXMLObjectIterator instance is only available for a query operation and if the query produced a result (hasQueryContent() == true) containing at least one TNonXMLObject instance (hasFirstNonXMLObject() == true).

Returns:
The TNonXMLObjectIterator instance. This is only available if the current operation is a query operation, otherwise null is returned.

getFirstNonXMLObject

TNonXMLObject getFirstNonXMLObject()
Gets the first non-XML object returned. The first TNonXMLObject instance is only available for a query operation and if the query produced a result (hasQueryContent() == true) containing at least one TNonXMLObject instance (hasFirstNonXMLObject() == true).

Returns:
the first TNonXMLObject if present, null otherwise.

hasFirstNonXMLObject

boolean hasFirstNonXMLObject()
Indicates if the response provides a first TNonXMLObject instance. Indicates whether the response provides non-XML documents or not.

Returns:
true if the response contains at least one TNonXMLObject, false otherwise.

hasQueryContent

boolean hasQueryContent()
Indicates if the response of Tamino contained any result information. Result information is only produced for queries, not for any other operations. Returns false if the query did not produce any results.

Returns:
true if the response of Tamino contained any result information, false otherwise.

getQueryContentAsString

java.lang.String getQueryContentAsString()
Gets the result of a query as a string. If the result is a set of XML nodes, the string contains the root element of each node without any children elements. Each root node is delivered with its attributes including the ino: attributes. If the result is a value or a set of values, the string returned is the concatenation of these values. In the special case, where the query results in a single value(e.g. count(*)), the string returned represents this value.

Returns:
the result of a query as a string, if available. Otherwise, an empty string is returned.

getQueryContentAsStream

TInputStream getQueryContentAsStream()
Gets the result of a query as a InputStream.

Returns:
the result of a query as a Stream, if available. Otherwise, an empty stream is returned.

hasWarnings

boolean hasWarnings()
Indicates if the response of Tamino contained any warning information.

Returns:
true if the response of Tamino contained any warning information, false otherwise.

getWarnings

java.util.Iterator getWarnings()
Gets an iterator for the list of TWarning instances containing the Tamino warnings.

Returns:
an iterator over the TWarning instances.


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