com.metamatrix.query.processor.xml
Class XMLPlan

java.lang.Object
  extended by com.metamatrix.query.processor.BaseProcessorPlan
      extended by com.metamatrix.query.processor.xml.XMLPlan
All Implemented Interfaces:
Describable, ProcessorPlan, java.lang.Cloneable

public class XMLPlan
extends BaseProcessorPlan


Field Summary
 
Fields inherited from interface com.metamatrix.query.processor.Describable
PROP_BINDINGS, PROP_CHILDREN, PROP_CONDITIONS, PROP_CRITERIA, PROP_DATA_COL, PROP_DEFAULT, PROP_DEFAULT_PROGRAM, PROP_ELSE, PROP_ENCODING, PROP_EXECUTION_PLAN, PROP_EXPRESSION, PROP_FORMATTED, PROP_GROUP, PROP_GROUP_COLS, PROP_IN_MEMORY, PROP_INTO_GROUP, PROP_IS_STAGING, PROP_JOIN_CRITERIA, PROP_JOIN_STRATEGY, PROP_JOIN_TYPE, PROP_MESSAGE, PROP_MODEL_NAME, PROP_NAMESPACE, PROP_NAMESPACE_DECL, PROP_NODE_COST_ESTIMATES, PROP_NODE_STATS_LIST, PROP_NODE_STATS_PROPS, PROP_OPTIONAL, PROP_OUTPUT_COLS, PROP_PROGRAM, PROP_PROGRAMS, PROP_RECURSE_DIR, PROP_REMOVE_DUPS, PROP_RESULT_SET, PROP_ROW_LIMIT, PROP_ROW_OFFSET, PROP_SELECT_COLS, PROP_SORT_COLS, PROP_SQL, PROP_TAG, PROP_THEN, PROP_TYPE, PROP_VARIABLE
 
Constructor Summary
XMLPlan(XMLProcessorEnvironment env)
          Constructor for XMLPlan.
 
Method Summary
 java.lang.Object 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.
 java.util.Collection getChildPlans()
          Finds all nested plans and returns them.
 ProcessorDataManager getDataManager()
           
 java.util.Map getDescriptionProperties()
          Get a description as a set of properties of primitive types such as String, Integer, etc.
 GroupSymbol getDocumentGroup()
           
 Program getOriginalProgram()
           
 java.util.List getOutputElements()
          Get list of resolved elements describing output columns for this plan.
 java.util.Collection 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 setShouldValidate(boolean validate)
          Set the validation mode on this plan.
 void setStylesheet(java.lang.String styleSheet)
           This method sets a style sheet to this object.
 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 xmlSchema)
          Sets the XML schema
 java.lang.String toString()
           
 
Methods inherited from class com.metamatrix.query.processor.BaseProcessorPlan
addWarning, getAndClearWarnings, getContext, setContext
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 interface: 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.

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 interface: ProcessorPlan
Reset a plan so that it can be processed again.

Specified by:
reset in interface ProcessorPlan
Overrides:
reset in class BaseProcessorPlan

getDataManager

public ProcessorDataManager getDataManager()

getOutputElements

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

Returns:
List of SingleElementSymbol

open

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

Throws:
MetaMatrixComponentException

nextBatch

public TupleBatch nextBatch()
                     throws MetaMatrixComponentException,
                            MetaMatrixProcessingException,
                            BlockedException
Description copied from interface: ProcessorPlan
Get a batch of results or possibly an Exception.

Returns:
Batch of results
Throws:
BlockedException - indicating next batch is not available yet
MetaMatrixComponentException - for non-business rule exception
MetaMatrixProcessingException - for business rule exception, related to user input or modeling
See Also:
ProcessorPlan.nextBatch()

setXMLSchemas

public void setXMLSchemas(java.util.Collection xmlSchema)
Sets the XML schema

Parameters:
xmlSchema -

getXMLSchemas

public java.util.Collection getXMLSchemas()
Returns the XML Schema

Returns:
xmlSchema

setStylesheet

public void setStylesheet(java.lang.String styleSheet)

This method sets a style sheet to this object. The style sheet is used to perform transformations on XML results

Parameters:
styleSheet - A string representing a xslt styleSheet

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

setShouldValidate

public void setShouldValidate(boolean validate)
Set the validation mode on this plan. By default validation is off.

Parameters:
validate - True to validate, false to not validate

close

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

Throws:
MetaMatrixComponentException
See Also:
ProcessorPlan.close()

toString

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

clone

public java.lang.Object 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 interface ProcessorPlan
Specified by:
clone in class BaseProcessorPlan
Returns:
safe clone of this ProcessorPlan, as long as it is not open for processing

getDescriptionProperties

public java.util.Map getDescriptionProperties()
Description copied from interface: Describable
Get a description as a set of properties of primitive types such as String, Integer, etc.

Returns:
Map of properties

getChildPlans

public java.util.Collection getChildPlans()
Description copied from interface: ProcessorPlan
Finds all nested plans and returns them.

Returns:
List of ProcessorPlan
Since:
4.2
See Also:
ProcessorPlan.getChildPlans()

getDocumentGroup

public GroupSymbol getDocumentGroup()

getOriginalProgram

public Program getOriginalProgram()
Returns:
Returns the originalProgram.


Copyright © 2009. All Rights Reserved.