MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.query
Interface PreparedStatement

All Known Implementing Classes:
PreparedStatementImpl

public interface PreparedStatement

Represents a compiled XQuery statement with it dynamic context and associated stores


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
 

Method Detail

evaluate

XDMIterator evaluate()
                     throws MXQueryException
Initialize the dynamic context with the relevant dynamic information (e.g. time) and

Returns:
an MXQuery XDM Iterator
Throws:
MXQueryException - if setting up the dynamic context fails

addExternalResource

void addExternalResource(java.lang.String varname,
                         java.lang.String resource)
                         throws MXQueryException
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

Parameters:
varname -
resource -
Throws:
MXQueryException

addExternalResource

void addExternalResource(QName varname,
                         XDMIterator resource)
                         throws MXQueryException
Add a binding to an external variable using an MXQuery XDM Iterator

Parameters:
varname - a QName describing the
resource - a MXQuery iterator producing XDM
Throws:
MXQueryException - if the binding failed

setContextItem

void setContextItem(XDMIterator resource)
                    throws MXQueryException
Set the context item to values produces by an XDM iterator

Parameters:
resource - a MXQuery iterator producing XDM
Throws:
MXQueryException

getContext

XQDynamicContext getContext()
Retrieves the dynamic context of this statement

Returns:
the dynamic context of this statement

isModuleDecl

boolean isModuleDecl()

exposeModule

void exposeModule()

isWebService

boolean isWebService()

generateWSDL

java.lang.String generateWSDL(java.lang.String serverURL)
                              throws MXQueryException
Generate the WSDL describing the functions and variables of the module expressed in this statement

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

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

Parameters:
inputSoap - textual representation of SOAP
Returns:
a StringBuffer containing the SOAP result

getStores

StoreSet getStores()
Get the collection of stores associated with this statement

Returns:
the StoreSet containing the stores associated with the statement

getStaticReturnType

TypeInfo getStaticReturnType()
Get the static return type of the statement

Returns:
a TypeInfo containing the

getExternalVariables

java.util.Vector getExternalVariables()
Get all external variables declared by this statement

Returns:
A vector of QNames, denoting the external variables

getUnresolvedExternalVariables

java.util.Vector getUnresolvedExternalVariables()
Get all external variables declared by this statement that have not yet a value assigned

Returns:
A vector of QNames, denoting the external variables without a value binding

applyPUL

void applyPUL()
              throws MXQueryException
Apply the pending update list for this statement

Throws:
MXQueryException

serializeStores

void serializeStores(boolean createBackup)
                     throws java.io.IOException,
                            MXQueryException
Serialize the stores modified by this statement to disk/network

Parameters:
createBackup - if true, a backup copy for each of the serialized/overwritten files
Throws:
java.io.IOException - if an I/O error occured
MXQueryException - if an

close

void close()
           throws MXQueryException
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)

Throws:
MXQueryException

copy

PreparedStatement copy()
                       throws MXQueryException
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

Returns:
A copy of this statement
Throws:
MXQueryException

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich