MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.query.impl
Class PreparedStatementImpl

java.lang.Object
  extended by ch.ethz.mxquery.query.impl.PreparedStatementImpl
All Implemented Interfaces:
PreparedStatement

public class PreparedStatementImpl
extends java.lang.Object
implements PreparedStatement


Constructor Summary
PreparedStatementImpl(Context ctx, XDMIterator iter, CompilerOptions cop)
           
 
Method Summary
 void addExternalResource(QName varname, XDMIterator resource)
          Add a binding to an external variable using an MXQuery XDM Iterator
 void addExternalResource(java.lang.String varname, java.lang.String resource)
          Add a binding to an external variable.
 void applyPUL()
          Apply the pending update list for this statement
 void close()
          Release all the resources acquired by running the statement.
 PreparedStatement copy()
          Create a copy of this prepared statement.
 XDMIterator evaluate()
          Initialize the dynamic context with the relevant dynamic information (e.g.
 void exposeModule()
           
 java.lang.String generateWSDL(java.lang.String serverURL)
          Generate the WSDL describing the functions and variables of the module expressed in this statement
 XQDynamicContext getContext()
          Retrieves the dynamic context of this statement
 java.util.Vector getExternalVariables()
          Get all external variables declared by this statement
 TypeInfo getStaticReturnType()
          Get the static return type of the statement
 StoreSet getStores()
          Get the collection of stores associated with this statement
 java.util.Vector getUnresolvedExternalVariables()
          Get all external variables declared by this statement that have not yet a value assigned
 java.lang.StringBuffer handleSOAP(java.lang.String inputSoap)
          Handle a SOAP call by extracting the payload, transforming into a sequence of XDM values, calling the referred function in the module and then packaging the result into SOAP Errors in the invocation are put into the SOAP payload as error messages
 boolean isModuleDecl()
           
 boolean isWebService()
           
 void serializeStores(boolean createBackup)
          Serialize the stores modified by this statement to disk/network
 void setContextItem(XDMIterator resource)
          Set the context item to values produces by an XDM iterator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreparedStatementImpl

public PreparedStatementImpl(Context ctx,
                             XDMIterator iter,
                             CompilerOptions cop)
Method Detail

evaluate

public XDMIterator evaluate()
                     throws MXQueryException
Description copied from interface: PreparedStatement
Initialize the dynamic context with the relevant dynamic information (e.g. time) and

Specified by:
evaluate in interface PreparedStatement
Returns:
an MXQuery XDM Iterator
Throws:
MXQueryException - if setting up the dynamic context fails

getContext

public XQDynamicContext getContext()
Description copied from interface: PreparedStatement
Retrieves the dynamic context of this statement

Specified by:
getContext in interface PreparedStatement
Returns:
the dynamic context of this statement

addExternalResource

public void addExternalResource(QName varname,
                                XDMIterator resource)
                         throws MXQueryException
Description copied from interface: PreparedStatement
Add a binding to an external variable using an MXQuery XDM Iterator

Specified by:
addExternalResource in interface PreparedStatement
Parameters:
varname - a QName describing the
resource - a MXQuery iterator producing XDM
Throws:
MXQueryException - if the binding failed

addExternalResource

public void addExternalResource(java.lang.String varname,
                                java.lang.String resource)
                         throws MXQueryException
Description copied from interface: PreparedStatement
Add a binding to an external variable. This is mainly a convenience method in order to easily bind textual XML content Most likely, this method will be deprecated

Specified by:
addExternalResource in interface PreparedStatement
Throws:
MXQueryException

isModuleDecl

public boolean isModuleDecl()
Specified by:
isModuleDecl in interface PreparedStatement

exposeModule

public void exposeModule()
Specified by:
exposeModule in interface PreparedStatement

isWebService

public boolean isWebService()
Specified by:
isWebService in interface PreparedStatement

generateWSDL

public java.lang.String generateWSDL(java.lang.String serverURL)
                              throws MXQueryException
Description copied from interface: PreparedStatement
Generate the WSDL describing the functions and variables of the module expressed in this statement

Specified by:
generateWSDL in interface PreparedStatement
Parameters:
serverURL - the Server URL describing where to call the functions, will be embedded into the WSDL
Returns:
a WSDL describing all the functions and variables exposed by the module
Throws:
MXQueryException - if generating the WSDL failed

handleSOAP

public java.lang.StringBuffer handleSOAP(java.lang.String inputSoap)
Description copied from interface: PreparedStatement
Handle a SOAP call by extracting the payload, transforming into a sequence of XDM values, calling the referred function in the module and then packaging the result into SOAP Errors in the invocation are put into the SOAP payload as error messages

Specified by:
handleSOAP in interface PreparedStatement
Parameters:
inputSoap - textual representation of SOAP
Returns:
a StringBuffer containing the SOAP result

getStores

public StoreSet getStores()
Description copied from interface: PreparedStatement
Get the collection of stores associated with this statement

Specified by:
getStores in interface PreparedStatement
Returns:
the StoreSet containing the stores associated with the statement

getStaticReturnType

public TypeInfo getStaticReturnType()
Description copied from interface: PreparedStatement
Get the static return type of the statement

Specified by:
getStaticReturnType in interface PreparedStatement
Returns:
a TypeInfo containing the

applyPUL

public void applyPUL()
              throws MXQueryException
Description copied from interface: PreparedStatement
Apply the pending update list for this statement

Specified by:
applyPUL in interface PreparedStatement
Throws:
MXQueryException

serializeStores

public void serializeStores(boolean createBackup)
                     throws MXQueryException
Description copied from interface: PreparedStatement
Serialize the stores modified by this statement to disk/network

Specified by:
serializeStores in interface PreparedStatement
Parameters:
createBackup - if true, a backup copy for each of the serialized/overwritten files
Throws:
MXQueryException - if an

getExternalVariables

public java.util.Vector getExternalVariables()
Description copied from interface: PreparedStatement
Get all external variables declared by this statement

Specified by:
getExternalVariables in interface PreparedStatement
Returns:
A vector of QNames, denoting the external variables

getUnresolvedExternalVariables

public java.util.Vector getUnresolvedExternalVariables()
Description copied from interface: PreparedStatement
Get all external variables declared by this statement that have not yet a value assigned

Specified by:
getUnresolvedExternalVariables in interface PreparedStatement
Returns:
A vector of QNames, denoting the external variables without a value binding

close

public void close()
           throws MXQueryException
Description copied from interface: PreparedStatement
Release all the resources acquired by running the statement. After calling this function, new external values can be assigned, an the statement be run again (by calling evaluate)

Specified by:
close in interface PreparedStatement
Throws:
MXQueryException

copy

public PreparedStatement copy()
                       throws MXQueryException
Description copied from interface: PreparedStatement
Create a copy of this prepared statement. Can only be run if the prepared statement has not been evaluated before and has no bound values

Specified by:
copy in interface PreparedStatement
Returns:
A copy of this statement
Throws:
MXQueryException

setContextItem

public void setContextItem(XDMIterator resource)
                    throws MXQueryException
Description copied from interface: PreparedStatement
Set the context item to values produces by an XDM iterator

Specified by:
setContextItem in interface PreparedStatement
Parameters:
resource - a MXQuery iterator producing XDM
Throws:
MXQueryException

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich