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

All Superinterfaces:
TAccessor, TInvalidatableAccessor
All Known Implementing Classes:
TSchemaDefinition2AccessorImpl, TSchemaDefinition2AccessorTimeLoggingImpl

public interface TSchemaDefinition2Accessor
extends TAccessor

TSchemaDefinition2Accessor is the interface for the access of TSD2 schema information. The basic operations are define and undefine. Each of these operations returns a TResponse instance containing the information as returned by Tamino in its response document. TSD3 schema information can not be accessed by this type of accessor.
The TSD2 schema is only supported with Tamino version 3.X and below.

Version:
$Revision: 1.13 $
Author:
Marcus Schreyer

Method Summary
 TResponse define(TXMLObject schemaObject)
          Defines a schema represented by the schemaObject in the Tamino database.
 TResponse getCollection(java.lang.String collection)
          Gets the collection or set of collections for the given collection name.
 java.util.Iterator<java.lang.String> getCollectionNames()
          Gets an iterator for the list of all collection names referenced by TSD2 schemas.
 TResponse getSchema(java.lang.String collection, java.lang.String schema)
          Gets the schema or set of schemas for the given collection and schema name.
 java.util.Iterator<java.lang.String> getSchemaNames(java.lang.String collection)
          Gets an iterator for the list of all TSD2 schema names in the specified collection.
 TResponse undefine(java.lang.String collection, java.lang.String schema)
          Undefines a schema specified by its name from the specified collection.
 
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

getCollectionNames

java.util.Iterator<java.lang.String> getCollectionNames()
                                                        throws TQueryException
Gets an iterator for the list of all collection names referenced by TSD2 schemas. The iterator returns the names of the collections as strings.

Returns:
Iterator an iterator over the collection names as strings. If no such collections are present, the iterator returned indicates this with iterator.hasNext() == false.
Throws:
TQueryException - signals an error while attempting to query for the collection names.

getSchemaNames

java.util.Iterator<java.lang.String> getSchemaNames(java.lang.String collection)
                                                    throws TQueryException
Gets an iterator for the list of all TSD2 schema names in the specified collection. The iterator returns the names of the schemas as strings. The collection parameter is optional. Depending on the parameter provided the following list of schema names is returned:
  1. collection != null, all schema names for the given collection.
  2. collection == null, all schema names in the database.

Parameters:
collection - the collection for which all TSD2 schema names are to be returned. null or an empty string indicates no collection is specified.
Returns:
Iterator an iterator over the list of returned schema names. If no schema names are found, the iterator indicates this with iterator.hasNext() == false.
Throws:
TQueryException - signals an error while attempting to query for the schema names.

getCollection

TResponse getCollection(java.lang.String collection)
                        throws TQueryException
Gets the collection or set of collections for the given collection name. The collection parameter is optional. Depending on the parameter provided the following list of collections is returned:
  1. collection != null, the collection with the given collection name.
  2. collection == null, all collections in the database.

Parameters:
collection - the collection to be returned; null or an empty string indicates no collection is specified.
Returns:
TResponse containing the Tamino result information of the schema query operation. You can use the TResponse object to obtain a TXMLObjectIterator to iterate over the result set of TXMLObject instances each representing a TSD2 collection.
Throws:
TQueryException - signals an error while attempting to query for the schemas.

getSchema

TResponse getSchema(java.lang.String collection,
                    java.lang.String schema)
                    throws TQueryException
Gets the schema or set of schemas for the given collection and schema name. The collection and schema parameters are optional. Depending on the parameters provided the following list of schemas is returned:
  1. collection != null && schema != null , the schema with the given schema name in the given collection.
  2. collection != null && schema == null , all schemas in the given collection.
  3. collection == null && schema != null , all schemas with the given schema name.
  4. collection == null && schema == null , all schemas in the database.

Parameters:
collection - the collection for which all TSD2 schemas are to be returned; null or an empty string indicates no collection is specified.
schema - the schema which is to be returned; null or an empty string indicates no schema is specified.
Returns:
TResponse containing the Tamino result information of the schema query operation. You can use the TResponse object to obtain a TXMLObjectIterator to iterate over the result set of TXMLObject instances each representing a TSD2 schema.
Throws:
TQueryException - signals an error while attempting to query for the schemas.

define

TResponse define(TXMLObject schemaObject)
                 throws TDefineException
Defines a schema represented by the schemaObject in the Tamino database. The input schema must be TSD2 schema. If the schema already exists in the same collection, Tamino attempts to update the schema, otherwise a new schema is created. If the TXMLObject instance carries an id and/or a docname, these are ignored for the define operation.

Parameters:
schemaObject - containing the TSD2 schema to be defined in Tamino.
Returns:
TResponse containing the Tamino result information of the define operation.
Throws:
TDefineException - signals an error while attempting the define operation.

undefine

TResponse undefine(java.lang.String collection,
                   java.lang.String schema)
                   throws TUndefineException
Undefines a schema specified by its name from the specified collection. If no schema name is specified Tamino is requested to undefine the entire collection.

Parameters:
collection - name of the Tamino collection.
schema - name of a Tamino schema, if null or an empty string the collection is undefined.
Returns:
TResponse containing the Tamino result information of the define operation.
Throws:
TUndefineException - signals an error while attempting the undefine operation.


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