org.teiid.query.processor.xml
Class XMLPlan

java.lang.Object
  extended by org.teiid.query.processor.ProcessorPlan
      extended by org.teiid.query.processor.xml.XMLPlan
All Implemented Interfaces:
java.lang.Cloneable, BatchCollector.BatchProducer

public class XMLPlan
extends ProcessorPlan


Field Summary
static java.lang.String XML_COMPACT_FORMAT
          XML results format: XML results displayed in compact form
static java.lang.String XML_TREE_FORMAT
          XML results format: XML results displayed as a tree
 
Constructor Summary
XMLPlan(XMLProcessorEnvironment env)
          Constructor for XMLPlan.
 
Method Summary
 XMLPlan clone()
          The plan is only clonable in the pre-execution stage, not the execution state (things like program state, result sets, etc).
 void close()
          Clean up the tuple source when the plan is closed.
 ProcessorDataManager getDataManager()
           
 PlanNode getDescriptionProperties()
           
 GroupSymbol getDocumentGroup()
           
 Program getOriginalProgram()
           
 java.util.List getOutputElements()
          Get list of resolved elements describing output columns for this plan.
 java.util.Collection<java.sql.SQLXML> getXMLSchemas()
          Returns the XML Schema
 void initialize(CommandContext context, ProcessorDataManager dataMgr, BufferManager bufferMgr)
          Initialize the plan with some required pieces of data for making queries.
 TupleBatch nextBatch()
          Get a batch of results or possibly an Exception.
 void open()
          Open the plan for processing.
 void reset()
          Reset a plan so that it can be processed again.
 void setXMLFormat(java.lang.String xmlFormat)
          This method sets whether the documents should be returned in compact format (no extraneous whitespace).
 void setXMLSchemas(java.util.Collection<java.sql.SQLXML> xmlSchema)
          Sets the XML schema
 java.lang.String toString()
           
 
Methods inherited from class org.teiid.query.processor.ProcessorPlan
addWarning, getAndClearWarnings, getContext, requiresTransaction, setContext
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

XML_TREE_FORMAT

public static final java.lang.String XML_TREE_FORMAT
XML results format: XML results displayed as a tree

See Also:
Constant Field Values

XML_COMPACT_FORMAT

public static final java.lang.String XML_COMPACT_FORMAT
XML results format: XML results displayed in compact form

See Also:
Constant Field Values
Constructor Detail

XMLPlan

public XMLPlan(XMLProcessorEnvironment env)
Constructor for XMLPlan.

Method Detail

initialize

public void initialize(CommandContext context,
                       ProcessorDataManager dataMgr,
                       BufferManager bufferMgr)
Description copied from class: ProcessorPlan
Initialize the plan with some required pieces of data for making queries. The data manager is used to make queries and the processorID must be passed with the request so the data manager can find the processor again.

Specified by:
initialize in class ProcessorPlan
Parameters:
context - Process execution context
dataMgr - Data manager reference
bufferMgr - Buffer manager reference
See Also:
ProcessorPlan#initialize(ProcessorDataManager, Object)

reset

public void reset()
Description copied from class: ProcessorPlan
Reset a plan so that it can be processed again.

Overrides:
reset in class ProcessorPlan

getDataManager

public ProcessorDataManager getDataManager()

getOutputElements

public java.util.List getOutputElements()
Get list of resolved elements describing output columns for this plan.

Specified by:
getOutputElements in interface BatchCollector.BatchProducer
Specified by:
getOutputElements in class ProcessorPlan
Returns:
List of SingleElementSymbol

open

public void open()
          throws TeiidComponentException
Description copied from class: ProcessorPlan
Open the plan for processing.

Specified by:
open in class ProcessorPlan
Throws:
TeiidComponentException

nextBatch

public TupleBatch nextBatch()
                     throws TeiidComponentException,
                            TeiidProcessingException,
                            BlockedException
Description copied from class: ProcessorPlan
Get a batch of results or possibly an Exception.

Specified by:
nextBatch in interface BatchCollector.BatchProducer
Specified by:
nextBatch in class ProcessorPlan
Returns:
Batch of results
Throws:
BlockedException - indicating next batch is not available yet
TeiidComponentException - for non-business rule exception
TeiidProcessingException - for business rule exception, related to user input or modeling
See Also:
ProcessorPlan.nextBatch()

setXMLSchemas

public void setXMLSchemas(java.util.Collection<java.sql.SQLXML> xmlSchema)
Sets the XML schema

Parameters:
xmlSchema -

getXMLSchemas

public java.util.Collection<java.sql.SQLXML> getXMLSchemas()
Returns the XML Schema

Returns:
xmlSchema

setXMLFormat

public void setXMLFormat(java.lang.String xmlFormat)
This method sets whether the documents should be returned in compact format (no extraneous whitespace). Non-compact format is more human-readable (and bigger). Additional formats may be possible in future.

Parameters:
xmlFormat - A string giving the format in which xml results need to be returned

close

public void close()
           throws TeiidComponentException
Clean up the tuple source when the plan is closed.

Specified by:
close in class ProcessorPlan
Throws:
TeiidComponentException
See Also:
ProcessorPlan.close()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

clone

public XMLPlan clone()
The plan is only clonable in the pre-execution stage, not the execution state (things like program state, result sets, etc). It's only safe to call that method in between query processings, in other words, it's only safe to call clone() on a plan after nextTuple() returns null, meaning the plan has finished processing.

Specified by:
clone in class ProcessorPlan
Returns:
safe clone of this ProcessorPlan, as long as it is not open for processing

getDescriptionProperties

public PlanNode getDescriptionProperties()
Overrides:
getDescriptionProperties in class ProcessorPlan

getDocumentGroup

public GroupSymbol getDocumentGroup()

getOriginalProgram

public Program getOriginalProgram()
Returns:
Returns the originalProgram.


Copyright © 2010. All Rights Reserved.