com.softwareag.tamino.db.api.accessor.logging
Class TNonXMLObjectAccessorTimeLoggingImpl

java.lang.Object
  extended by com.softwareag.tamino.db.api.accessor.TAbstractAccessor
      extended by com.softwareag.tamino.db.api.accessor.TNonXMLObjectAccessorImpl
          extended by com.softwareag.tamino.db.api.accessor.logging.TNonXMLObjectAccessorTimeLoggingImpl
All Implemented Interfaces:
TAccessor, TInvalidatableAccessor, TNonXMLObjectAccessor

public class TNonXMLObjectAccessorTimeLoggingImpl
extends TNonXMLObjectAccessorImpl

TNonXMLObjectAccessorTimeLoggingImpl is an extension of TNonXMLObjectAccessorImpl that support time logging for the methods of the TNonXMLObjectAccessor interface.

Version:
$Revision: 1.4 $
Author:
Oliver.Kleber@softwareag.com

Field Summary
 
Fields inherited from class com.softwareag.tamino.db.api.accessor.TAbstractAccessor
canBeCancelled, clientRequests, requestCounter, SGUAI
 
Constructor Summary
TNonXMLObjectAccessorTimeLoggingImpl(TAccessLocation accessLocation, TInvocation invocation, TResponseBuilder responseBuilder, java.util.Locale locale)
          Special Constructor.
 
Method Summary
 TResponse delete(TNonXMLObject nonXMLObject)
          Deletes the non XML document represented by the TNonXMLObject from the Tamino database.
 TResponse delete(TQuery xPath)
          Deletes the non XML document implicitly given by the specified xpath query.
 TResponse insert(TNonXMLObject nonXMLObject)
          Inserts the Non-XML document represented by the TNonXMLObject instance into the Tamino database.
 TResponse query(TQuery xPath)
          Queries for a single non XML document specified by the given TNonXMLQuery.
 TNonXMLObject retrieve(TNonXMLObject nonXMLObject)
          Retrieves a single Non-XML document from Tamino in the state as it has been inserted.
 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 within the Tamino database.
 
Methods inherited from class com.softwareag.tamino.db.api.accessor.TNonXMLObjectAccessorImpl
cancelRequests, xquery
 
Methods inherited from class com.softwareag.tamino.db.api.accessor.TAbstractAccessor
getAccessCollection, getAccessLocation, getApplicationName, getCanBeCancelled, getDatabaseUri, getInvocation, getLocale, getLockMode, getLockwaitMode, getMaximumRequestDuration, invalidate, invoke, invoke, invoke, setAccessLocation, setApplicationName, setCanBeCancelled, setInvocation, setLockMode, setLockwaitMode, setMaximumRequestDuration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.softwareag.tamino.db.api.accessor.TAccessor
getAccessLocation, getApplicationName, getCanBeCancelled, getLockMode, getLockwaitMode, getMaximumRequestDuration, setAccessLocation, setApplicationName, setCanBeCancelled, setLockMode, setLockwaitMode, setMaximumRequestDuration
 
Methods inherited from interface com.softwareag.tamino.db.api.accessor.TInvalidatableAccessor
invalidate
 

Constructor Detail

TNonXMLObjectAccessorTimeLoggingImpl

public TNonXMLObjectAccessorTimeLoggingImpl(TAccessLocation accessLocation,
                                            TInvocation invocation,
                                            TResponseBuilder responseBuilder,
                                            java.util.Locale locale)
Special Constructor. Initializes the accessor with the given TNonXMLStreamAccessor and TResponseBuilder.

Parameters:
streamAccessor -
responseBuilder -
Method Detail

insert

public TResponse insert(TNonXMLObject nonXMLObject)
                 throws TInsertException
Inserts the Non-XML document represented by the TNonXMLObject instance into the Tamino database. Before inserting the instance's id property is resetted if given. If the insert succeeds the id property is set on the TNonXMLObject instance. An insert operation can be assured on Tamino when no id and no docname property is given. When a docname property is given, an insert operation can only be assured when no such instance with this docname already exists on Tamino for the given collection and doctype. Please note, that the insert operation might lead for specific settings of the docname property to an update operation on Tamino if such an object is already given. The following describes regarding the setting of the docname property what operation takes place on the Tamino database:
  1. !nonXMLObject.hasDocname() Insert. If id is given, it is resetted.
  2. nonXMLObject.hasDocname() Insert, if a document with the given ino:docname is not given yet.
  3. nonXMLObject.hasDocname() Update, if a document with the given ino:docname is already given yet.

Specified by:
insert in interface TNonXMLObjectAccessor
Overrides:
insert in class TNonXMLObjectAccessorImpl
Parameters:
nonXmlObject - is the representation of the non XML document that should be stored within Tamino.
Returns:
TResponse containing the Tamino result information that is contained within the Tamino response XML document.
Throws:
TInsertException - due to failures when inserting the instance.

update

public TResponse update(TNonXMLObject nonXMLObject)
                 throws TUpdateException
Updates the Non-XML document represented by the TNonXMLObject instance within the Tamino database. An update operation can only be assured if an id or docname property is given for which a Non-XML document is given on Tamino. The id property is only used for the update if no docname property is available. Please note, that the update operation might lead for specific settings of id and docname properties to an insert operation on Tamino if such a document is not given yet. The following characterizes regarding the setting of the id and docname properties which operation takes place on Tamino database:
  1. nonXMLObject.hasId() && !nonXMLObject.hasDocname() Update, if the document with the given id is existant.
  2. nonXMLObject.hasId() && !nonXMLObject.hasDocname() Insert, if the document with the given id is not existant. Please note, that the document will then have the docname @id.
  3. nonXMLObject.hasDocname() Update, if the document with the given docname is existant.
  4. nonXMLObject.hasDocname() Insert, if the document with the given docname is not existant.

Specified by:
update in interface TNonXMLObjectAccessor
Overrides:
update in class TNonXMLObjectAccessorImpl
Parameters:
nonXMLObject - is the representation of the Non-XML document that should be updated within Tamino. If the document is not already given yet it might be inserted into Tamino.
Returns:
TResponse containing the Tamino result information that is contained within the Tamino response XML document.
Throws:
TUpdateException - due to any problems during the update of the given TNonXMLObject instance.

delete

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

Specified by:
delete in interface TNonXMLObjectAccessor
Overrides:
delete in class TNonXMLObjectAccessorImpl
Parameters:
nonXmlObject - is the representation of the non XML document that should be deleted from Tamino.
Returns:
TResponse containing the Tamino result information that is contained within the Tamino response XML document.
Throws:
TDeleteException - due to failures when deleting the specified instance.

delete

public TResponse delete(TQuery xPath)
                 throws TDeleteException
Deletes the non XML document implicitly given by the specified xpath query.

Specified by:
delete in interface TNonXMLObjectAccessor
Overrides:
delete in class TNonXMLObjectAccessorImpl
Parameters:
xpath - is the TQuery instance that referrs to the specific set of TNonXMLObject instances that shall be deleted.
Returns:
TResponse containing the Tamino result information that is contained within the Tamino response XML document.
Throws:
TDeleteException - due to failures when deleting the instances.

query

public TResponse query(TQuery xPath)
                throws TQueryException
Queries for a single non XML document specified by the given TNonXMLQuery. If the document can be found the appropiate TInputStream is handed back.

Specified by:
query in interface TNonXMLObjectAccessor
Overrides:
query in class TNonXMLObjectAccessorImpl
Parameters:
nonXmlQuery - is the TNonXMLQuery instance that referrs to the specific TNonXMLObject.
Returns:
TResponse containing the Tamino result for the given query. In case the query leads to a result set a TNonXMLObjectIterator can be used to navigate typesafe over the TNonXMLObject instances.
Throws:
TQueryException - due to failures when the query is performed.

retrieve

public TNonXMLObject retrieve(TNonXMLObject nonXMLObject)
                       throws TRetrieveException
Retrieves a single Non-XML document from Tamino in the state as it has been inserted. Please note that the object is retrieved either by id or the docname property given within the TNonXMLObject instance. The document is retrieved by a single document retrieval mechanism. The prerequesite for this is, that the TNonXMLObject instance needs to provide a doctype and either the id or docname information.

Specified by:
retrieve in interface TNonXMLObjectAccessor
Overrides:
retrieve in class TNonXMLObjectAccessorImpl
Parameters:
nonXMLObject - represents an instance for which the Non-XML document shall be retrieved 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 - due to any problems during the retrieval of the single document.

retrieveHeader

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

Specified by:
retrieveHeader in interface TNonXMLObjectAccessor
Overrides:
retrieveHeader in class TNonXMLObjectAccessorImpl
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.