com.softwareag.tamino.db.api.accessor
Class TAbstractSchemaDefinitionAccessor

java.lang.Object
  extended by com.softwareag.tamino.db.api.accessor.TAbstractAccessor
      extended by com.softwareag.tamino.db.api.accessor.TAbstractSchemaDefinitionAccessor
All Implemented Interfaces:
TAccessor, TInvalidatableAccessor
Direct Known Subclasses:
TSchemaDefinition2AccessorImpl, TSchemaDefinition3AccessorImpl

public abstract class TAbstractSchemaDefinitionAccessor
extends TAbstractAccessor

This class provides a skeletal implementation for the schema specific accessor classes to minimize the effort required to implement a concrete schema accessor class.

Version:
$Revision: 1.21 $
Author:
Marcus Schreyer

Field Summary
 
Fields inherited from class com.softwareag.tamino.db.api.accessor.TAbstractAccessor
canBeCancelled, clientRequests, requestCounter, SGUAI
 
Constructor Summary
TAbstractSchemaDefinitionAccessor(TStreamAccessor streamAccessor, TResponseBuilder responseBuilder)
          Special Constructor.
 
Method Summary
 void cancelRequests()
          Cancels all requests issued using current accessor.
 TResponse define(TXMLObject schemaObject)
          Defines a schema represented by the given schema within the specified collection.
protected  TAccessFailureVerifier getAccessFailureVerifier()
          Provides direct access to the access failure verifier.
protected  TResponseBuilder getResponseBuilder()
          Provides direct access to the response builder.
protected  TStreamAccessor getStreamAccessor()
          Provides direct access to the stream accessor.
 void setAccessLocation(TAccessLocation accessLocation)
          Sets the accessor's properties.
 void setCanBeCancelled(boolean canBeCancelled)
          Sets whether request can be canBeCancelled.
 void setMaximumRequestDuration(long maximumRequestDuration)
          Sets the maximum request duration in seconds.
 TResponse undefine(java.lang.String collection, java.lang.String schema)
          Undefines a schema represented by the given schema within the specified collection.
 TResponse undefine(TUndefineItem[] undefineItems)
          In order to undefine a schema cluster, it is possible to specify a list of objects in an _UNDEFINE command: _UNDEFINE=undefineList where- undefineList -> undefineItem[, undefineItem]* undefineItem -> collection[/schema[/doctype]]
 
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
 

Constructor Detail

TAbstractSchemaDefinitionAccessor

public TAbstractSchemaDefinitionAccessor(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

define

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

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.

Parameters:
collection -
schema -
Returns:
TResponse containing Tamino's response document.
Throws:
TUndefineException - due to any problems that might occur when undefining the schema.

undefine

public TResponse undefine(TUndefineItem[] undefineItems)
                   throws TUndefineException
In order to undefine a schema cluster, it is possible to specify a list of objects in an _UNDEFINE command: _UNDEFINE=undefineList where- undefineList -> undefineItem[, undefineItem]* undefineItem -> collection[/schema[/doctype]]

Parameters:
undefineItems - Array of undefineItems.
Returns:
TResponse containing the Tamino result information of the undefine operation.
Throws:
TUndefineException - signals an error while attempting the undefine operation.
See Also:
TUndefineItem

setAccessLocation

public void setAccessLocation(TAccessLocation accessLocation)
Sets the accessor's properties. Please note, that setting a new access location is not possible here. As a consequence a ViolatedPrecondition is thrown.

Specified by:
setAccessLocation in interface TAccessor
Overrides:
setAccessLocation in class TAbstractAccessor
Parameters:
accessLocation - the TAccessLocation instance to be used by the accessor.

getStreamAccessor

protected final TStreamAccessor getStreamAccessor()
Provides direct access to the stream accessor.

Returns:
the TXMLStreamAccessor instance currently in use.

getResponseBuilder

protected final TResponseBuilder getResponseBuilder()
Provides direct access to the response builder.

Returns:
the TResponseBuilder instance currently in use.

getAccessFailureVerifier

protected final TAccessFailureVerifier getAccessFailureVerifier()
Provides direct access to the access failure verifier.

Returns:
the TAccessFailureVerifier instance that is in use.

setCanBeCancelled

public void setCanBeCancelled(boolean canBeCancelled)
                       throws TAdminException
Sets whether request can be canBeCancelled.

Specified by:
setCanBeCancelled in interface TAccessor
Overrides:
setCanBeCancelled in class TAbstractAccessor
Throws:
TAdminException

cancelRequests

public void cancelRequests()
                    throws TAdminException
Cancels all requests issued using current accessor.

Specified by:
cancelRequests in interface TAccessor
Overrides:
cancelRequests in class TAbstractAccessor
Throws:
TAdminException

setMaximumRequestDuration

public void setMaximumRequestDuration(long maximumRequestDuration)
Sets the maximum request duration in seconds.
Note that for pooled connections obtained frlom a connection pool which configured to pool Tamino physical connections, the invocation of this method has no effect. The default value is set once and for all for all connections in a pool when the pool is created.

Specified by:
setMaximumRequestDuration in interface TAccessor
Overrides:
setMaximumRequestDuration in class TAbstractAccessor
Parameters:
maximumRequestDuration - the maximum request duration in seconds in seconds be set, TConnection.DEFAULT_TIMEOUT for Tamino default.


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