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

java.lang.Object
  extended by com.softwareag.tamino.db.api.accessor.TAbstractAccessor
      extended by com.softwareag.tamino.db.api.accessor.TAbstractSchemaDefinitionAccessor
          extended by com.softwareag.tamino.db.api.accessor.TSchemaDefinition2AccessorImpl
              extended by com.softwareag.tamino.db.api.accessor.logging.TSchemaDefinition2AccessorTimeLoggingImpl
All Implemented Interfaces:
TAccessor, TInvalidatableAccessor, TSchemaDefinition2Accessor

public class TSchemaDefinition2AccessorTimeLoggingImpl
extends TSchemaDefinition2AccessorImpl

TSchemaDefinition2AccessorTimeLoggingImpl is an extension of TSchemaDefinition2AccessorImpl that support time logging for the methods of the TSchemaDefinition2Accessor interface.

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

Field Summary
 
Fields inherited from class com.softwareag.tamino.db.api.accessor.TAbstractAccessor
canBeCancelled, clientRequests, requestCounter, SGUAI
 
Constructor Summary
TSchemaDefinition2AccessorTimeLoggingImpl(TStreamAccessor streamAccessor, TResponseBuilder responseBuilder)
          Special Constructor.
 
Method Summary
 TResponse define(TXMLObject schemaObject)
          Defines a schema represented by the given schema within the specified collection.
 TResponse getCollection(java.lang.String collection)
          Gets the collection with the specified name and hands back the result as a TResponse object.
 java.util.Iterator<java.lang.String> getCollectionNames()
          Gets the iterator for the list of all collection names stored within Tamino.
 TResponse getSchema(java.lang.String collection, java.lang.String schema)
          Gets the schema or multiple schemas for the given collection and schema and hands back the result as a TResponse object.
 java.util.Iterator<java.lang.String> getSchemaNames(java.lang.String collection)
          Gets the iterator for the list of schema names given within the specified collection, or if no collection is given all schema names currently stored under the connected database.
 TResponse undefine(java.lang.String collection, java.lang.String schema)
          Undefines a schema represented by the given schema within the specified collection.
 
Methods inherited from class com.softwareag.tamino.db.api.accessor.TAbstractSchemaDefinitionAccessor
cancelRequests, getAccessFailureVerifier, getResponseBuilder, getStreamAccessor, setAccessLocation, setCanBeCancelled, setMaximumRequestDuration, undefine
 
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, setApplicationName, setInvocation, setLockMode, setLockwaitMode
 
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
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
 

Constructor Detail

TSchemaDefinition2AccessorTimeLoggingImpl

public TSchemaDefinition2AccessorTimeLoggingImpl(TStreamAccessor streamAccessor,
                                                 TResponseBuilder responseBuilder)
Special Constructor. Initializes the accessor with the given TXMLStreamAccessor and TResponseBuilder.

Parameters:
streamAccessor, - internally needed for core stream access.
responseBuilder, - needed for building high level response objects.
Method Detail

getCollectionNames

public java.util.Iterator<java.lang.String> getCollectionNames()
                                                        throws TQueryException
Gets the iterator for the list of all collection names stored within Tamino.

Specified by:
getCollectionNames in interface TSchemaDefinition2Accessor
Overrides:
getCollectionNames in class TSchemaDefinition2AccessorImpl
Returns:
Iterator The iterator over the collection names given as String instances. If none are given, the iterator indicates this with iterator.hasNext() == false.
Throws:
TQueryException - if the query for the collection names fails.

getSchemaNames

public java.util.Iterator<java.lang.String> getSchemaNames(java.lang.String collection)
                                                    throws TQueryException
Gets the iterator for the list of schema names given within the specified collection, or if no collection is given all schema names currently stored under the connected database.

Specified by:
getSchemaNames in interface TSchemaDefinition2Accessor
Overrides:
getSchemaNames in class TSchemaDefinition2AccessorImpl
Parameters:
collection - specifies the collection for which all schema names have to be delivered. If this is not specified all schema names are requested.
Returns:
Iterator The iterator over the schema names within the specified collection. In case no collection is given all schema names stored under Tamino are delivered. If no schema names are found, the iterator indicates this with iterator.hasNext() == false.
Throws:
TQueryException - if the query for the schema names fails.

getCollection

public TResponse getCollection(java.lang.String collection)
                        throws TQueryException
Gets the collection with the specified name and hands back the result as a TResponse object. Multiple collections are handed back if no collection name is given, these are then all collections that are stored under the connected Tamino database.

Specified by:
getCollection in interface TSchemaDefinition2Accessor
Overrides:
getCollection in class TSchemaDefinition2AccessorImpl
Parameters:
collection - specifies the collection for which the query has been invoked. If no collection is given all collections are referenced that are stored under the connected Tamino database.
Returns:
TResponse providing access to the collection information by getXMLObjectIterator indirectly or by getFirstXMLObject directly. Multiple collections are handed back in case no collection has been provided.
Throws:
TQueryException - if the query for the collection fails.

getSchema

public TResponse getSchema(java.lang.String collection,
                           java.lang.String schema)
                    throws TQueryException
Gets the schema or multiple schemas for the given collection and schema and hands back the result as a TResponse object. Whether a result set is handed back strongly depends on whether the collection and schema information are given. If this is the case only the relevant schema is handed back. Generally depending on the provided arguments the following results are handed back regarding the requested schemas:
  1. collection != null && schema != null , the schema within the specified collection and the given schema name.
  2. collection != null && schema == null , all schemas within the specified collection.
  3. collection == null && schema != null , all schemas with the given schema name.
  4. collection == null && schema == null , all schemas globally given.

Specified by:
getSchema in interface TSchemaDefinition2Accessor
Overrides:
getSchema in class TSchemaDefinition2AccessorImpl
Parameters:
collection - specifies the Tamino collection for which schemas are requested.
schema - specifies the schema name for which schemas are requested.
Returns:
TResponse containing the TXMLObjectIterator for the access to requested schemas. Note, that the first schema instance can also be accessed by the getFirstXMLObject method provided within TResponse.
Throws:
TQueryException - if the query for the given schema fails.

define

public TResponse define(TXMLObject schemaObject)
                 throws TDefineException
Defines a schema represented by the given schema within the specified collection.

Specified by:
define in interface TSchemaDefinition2Accessor
Overrides:
define in class TAbstractSchemaDefinitionAccessor
Parameters:
schemaObject - containing the schema that has to be defined on Tamino.
Returns:
TInputStream containing Tamino's response document as a core input stream.
Throws:
TDefineException - due to any problems that might occur when defining the schema.

undefine

public TResponse undefine(java.lang.String collection,
                          java.lang.String schema)
                   throws TUndefineException
Undefines a schema represented by the given schema within the specified collection. If no schema is specified Tamino is requested to undefine the entire specified collection.

Specified by:
undefine in interface TSchemaDefinition2Accessor
Overrides:
undefine in class TAbstractSchemaDefinitionAccessor
Parameters:
collection -
schema -
Returns:
TResponse containing Tamino's response document.
Throws:
TUndefineException - due to any problems that might occur when undefining the schema.


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