com.softwareag.tamino.db.api.accessor
Interface TNonXMLObjectAccessor

All Superinterfaces:
TAccessor, TInvalidatableAccessor
All Known Implementing Classes:
TNonXMLObjectAccessorImpl, TNonXMLObjectAccessorTimeLoggingImpl

public interface TNonXMLObjectAccessor
extends TAccessor

TNonXMLAccessor is the interface for the access of non-XML data stored in a Tamino database. The basic operations are insert, update, delete and query. Each of these operations returns a TResponse object that contains the information as returned by Tamino in its response document. The TResponse instance returned by a query operation also contains a TNonXMLObjectIterator which can be used to iterate over the result set of non-XML documents.

Version:
$Revision: 1.25 $
Author:
Marcus Schreyer

Method Summary
 TResponse delete(TNonXMLObject nonXMLObject)
          Deletes the non-XML document represented by the TNonXMLObject in the Tamino database.
 TResponse delete(TQuery query)
          Deletes the non-XML document the specified by the query expression.
 TResponse insert(TNonXMLObject nonXmlObject)
          Inserts the non-XML document represented by the TNonXMLObject instance into the Tamino database.
 TResponse query(TQuery query)
          Queries a set of non-XML documents that satisfy the query expression.
 TNonXMLObject retrieve(TNonXMLObject nonXMLObject)
          Retrieves a single non-XML document from Tamino.
 TStreamHeader retrieveHeader(TNonXMLObject nonXMLObject)
          Just retrieves the �meta� data of a single document from Tamino.
 TResponse update(TNonXMLObject nonXMLObject)
          Updates the non-XML document represented by the TNonXMLObject instance in the Tamino database.
 TResponse xquery(TXQuery xquery)
          Queries a set of non-XML documents that satisfy the xquery expression.
 
Methods inherited from interface com.softwareag.tamino.db.api.accessor.TAccessor
cancelRequests, getAccessLocation, getApplicationName, getCanBeCancelled, getLockMode, getLockwaitMode, getMaximumRequestDuration, setAccessLocation, setApplicationName, setCanBeCancelled, setLockMode, setLockwaitMode, setMaximumRequestDuration
 
Methods inherited from interface com.softwareag.tamino.db.api.accessor.TInvalidatableAccessor
invalidate
 

Method Detail

insert

TResponse insert(TNonXMLObject nonXmlObject)
                 throws TInsertException
Inserts the non-XML document represented by the TNonXMLObject instance into the Tamino database. If the TNonXMLObject carries an id, the insert operation ignores it. If a non-XML object already exists with the same docname this object will be replaced and no new object will be inserted. If the insert succeeds, the id, collection and doctype properties are set on the TNonXMLObject instance.

The following characterizes this behavior:

!nonXMLObject.hasDocname() Insert.
nonXMLObject.hasDocname() Insert, if a document with the given ino:docname does not exist.
nonXMLObject.hasDocname() Update, if a document with the given ino:docname already exists.

Parameters:
nonXmlObject - is the representation of the non XML document to be stored in Tamino.
Returns:
TResponse containing the Tamino result information of the insert operation.
Throws:
TInsertException - signals an error while attempting the insert operation.

update

TResponse update(TNonXMLObject nonXMLObject)
                 throws TUpdateException
Updates the non-XML document represented by the TNonXMLObject instance in the Tamino database. As a prerequisite, the TNonXMLObject either has to provide an id or docname. The docname has a higher priority than the id, which means that if both are given, the docname is taken as the update parameter instead of the id.

If an update is done based on an id and the non-XML object being updated had a docname, the docname is deleted, i.e. the non-XML object no longer has a docname after the update operation.

If the TNonXMLObject instance carries no id and no non-XML object exists with the same docname a new object will be inserted, otherwise the object will be replaced.

The following characterizes this behavior:

nonXMLObject.hasId() && !nonXMLObject.hasDocname() Update, if the document with the given id exists, otherwise TUpdateException will be thrown.
!xmlObject.hasId() && nonXMLObject.hasDocname() Update, if the document with the given docname exists, otherwise Insert.
xmlObject.hasId() && nonXMLObject.hasDocname() Update, if the document with the given docname does exist, otherwise Insert.

Parameters:
nonXMLObject - is the representation of the non-XML document to be updated in Tamino.
Returns:
TResponse containing the Tamino result information of the update operation.
Throws:
TUpdateException - signals an error while attempting the update operation.

delete

TResponse delete(TNonXMLObject nonXMLObject)
                 throws TDeleteException
Deletes the non-XML document represented by the TNonXMLObject in the Tamino database.

Parameters:
nonXmlObject - is the representation of the non-XML document to be deleted from Tamino.
Returns:
TResponse containing the Tamino result information of the delete operation.
Throws:
TDeleteException - signals an error while attempting the delete operation.

delete

TResponse delete(TQuery query)
                 throws TDeleteException
Deletes the non-XML document the specified by the query expression.

Parameters:
query - query expression which specifies a set of non-XML documents to be deleted.
Returns:
TResponse containing the Tamino result information of the delete operation.
Throws:
TDeleteException - signals an error while attempting the delete operation.

query

TResponse query(TQuery query)
                throws TQueryException
Queries a set of non-XML documents that satisfy the query expression. You can iterate over the result set of TNonXMLObject instances by using a TNonXMLObjectIterator instance.

Parameters:
query - query expression which specifies a set of non-XML documents to be retrieved.
Returns:
TResponse containing the Tamino result information of the query operation. You can use the TResponse object to obtain a TNonXMLObjectIterator to iterate over the result set of TNonXMLObject instances.
Throws:
TQueryException - signals an error while attempting the query operation.

xquery

TResponse xquery(TXQuery xquery)
                 throws TXQueryException
Queries a set of non-XML documents that satisfy the xquery expression. You can iterate over the result set of TNonXMLObject instances by using a TNonXMLObjectIterator instance.

This feature requires Tamino 4.1

Parameters:
xquery - query expression which specifies a set of non-XML documents to be retrieved.
Returns:
TResponse containing the Tamino result information of the xquery operation. You can use the TResponse object to obtain a TNonXMLObjectIterator to iterate over the result set of TNonXMLObject instances.
Throws:
TXQueryException - signals an error while attempting the query operation.

retrieve

TNonXMLObject retrieve(TNonXMLObject nonXMLObject)
                       throws TRetrieveException

Retrieves a single non-XML document from Tamino. The document is retrieved by its docname or id as set in the TNonXMLObject instance passed as input parameter and not by a query expression. If both docname and id are present in the TNonXMLObject instance, the docname is used.

Parameters:
nonXMLObject - a TNonXMLObject instance specifying by its doctype, id or docname information which non-XML document to retrieve from Tamino.
Returns:
a TNonXMLObject instance containing the non-XML document retrieved from Tamino. The instance returned is the same instance passed as the input parameter.
Throws:
TRetrieveException - signals an error while attempting the retrieve operation.

retrieveHeader

TStreamHeader retrieveHeader(TNonXMLObject nonXMLObject)
                             throws TRetrieveException

Just retrieves the �meta� data of a single document from Tamino. This data is retrieved by its docname or id as set in the TNonXMLObject instance passed as input parameter and not by a query expression. If both docname and id are present in the TNonXMLObject instance, the docname is used.

This method behaves like the retrieve() method except that it does not retieve the whole document but only its �meta� data, which is contained in the TStreamHeader.

Parameters:
xmlObject - a TNonXMLObject instance specifying by its doctype, id or docname information which document to retrieve from Tamino.
Returns:
a TStreamHeader instance containing the documents �meta� data.
Throws:
TRetrieveException - signals an error while attempting the retrieve operation.
See Also:
com.softwareag.tamino.db.api.accessor.TStreamAccessor#retrieve(TNonXMLObject)


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