public interface Request
Modifier and Type | Method and Description |
---|---|
void |
clearVariable(XdmVariable variable)
Remove the given variable from this Request context.
|
void |
clearVariables()
Remove any variables set in this Request.
|
long |
getCount()
Get count of result items for this request.
|
RequestOptions |
getEffectiveOptions()
Returns a
RequestOptions instance that reflects the execution options that will be
applied to this request. |
RequestOptions |
getOptions()
Returns the currently set
RequestOptions object. |
long |
getPosition()
Get starting position of results for this request.
|
Session |
getSession()
The session which created this Request.
|
XdmVariable[] |
getVariables()
Return an array (possibly zero length) of all the
XdmVariable objects currently set
on this Request. |
void |
setCount(long count)
Set count of result items for this request.
|
XdmVariable |
setNewIntegerVariable(java.lang.String localname,
long value)
|
XdmVariable |
setNewIntegerVariable(java.lang.String namespace,
java.lang.String localname,
long value)
|
XdmVariable |
setNewStringVariable(java.lang.String localname,
java.lang.String value)
|
XdmVariable |
setNewStringVariable(java.lang.String namespace,
java.lang.String localname,
java.lang.String value)
|
XdmVariable |
setNewVariable(java.lang.String namespace,
java.lang.String localname,
ValueType type,
java.lang.Object value)
Convenience method that creates a new
XdmVariable , binds it to this Request and then
returns the new XdmVariable object. |
XdmVariable |
setNewVariable(java.lang.String localname,
ValueType type,
java.lang.Object value)
Convenience method that creates a new
XdmVariable , binds it to this Request and then
returns the new XdmVariable . |
XdmVariable |
setNewVariable(XName xname,
XdmValue value)
Convenience method that creates a new
XdmVariable , binds it to this Request and then
returns the new XdmVariable object. |
void |
setNewVariables(java.lang.String namespace,
java.lang.String localname,
ValueType type,
java.lang.Object[] values)
Creates a sequence
XdmVariable from the input values and
binds it to this Request. |
void |
setNewVariables(java.lang.String localname,
ValueType type,
java.lang.Object[] values)
Creates a sequence
XdmVariable from the input values and
binds it to this Request. |
void |
setNewVariables(XName xname,
XdmValue[] values)
Creates a sequence
XdmVariable from the input values and
binds it to this Request. |
void |
setOptions(RequestOptions options)
Associate the given
RequestOptions object with this Request. |
void |
setPosition(long position)
Set starting position of results for this request.
|
void |
setVariable(XdmVariable variable)
Associate the given
XdmVariable with this Request. |
Session getSession()
Session
and their implementations are interdependent.Session
reference.void setOptions(RequestOptions options)
RequestOptions
object with this Request.options
- An RequestOptions
instance or null to use default values.RequestOptions getOptions()
RequestOptions
object.RequestOptions
or null if none is currently in effect.RequestOptions getEffectiveOptions()
Returns a RequestOptions
instance that reflects the execution options that will be
applied to this request. This may be a blend of the option values set on the Request and
those set on the Session
. This method will always return a newly created, non-null
result.
The object returned is NOT the RequestOptions
object associated with
either the Request or the Session
. Making changes to the returned
RequestOptions
object will not affect subsequent submissions of this Request.
Although it's possible to modify and pass the returned object back to
setOptions(RequestOptions)
, this is not recommended. In general, you should create
your own instance of RequestOptions
and set only those options you explictly want to
override. When submitted, the options set on the Request are merged with those, if any, set
for the Session
.
This method mainly used internally. It can be used to determine which values will be submitted with a request. Most client code will not need this method.
RequestOptions
.void setVariable(XdmVariable variable)
XdmVariable
with this Request. If another
variable with the same name is already set, it is replaced. When an invocation of
Session.submitRequest(Request)
is made, all currently set variables are sent with the
request and defined as XQuery external variables when the query runs in the server.variable
- A XdmVariable
instance to be associated with this
Request. If another variable with the same name (
XName
) is already bound, it will be replaced with
this one. Note that XName
instances with the same
namespace/local name values are considered to be equal.UnimplementedFeatureException
- If the variable is not a type that can be passed with the Request,
e.g. XdmSequence is not a supported type for external variables.XdmVariable setNewVariable(XName xname, XdmValue value)
Convenience method that creates a new XdmVariable
, binds it to this Request and then
returns the new XdmVariable
object. This method is equivalent to:
XdmVariable temp = ValueFactory.newVariable (xname, value);
request.setVariable (temp);
return temp;
xname
- An instance of XName
, which defines a namespace (optional) and a
localname.value
- An instance of XdmValue
which will be the value of the XdmVariable
.XdmVariable
instance.void setNewVariables(XName xname, XdmValue[] values)
Creates a sequence XdmVariable
from the input values and
binds it to this Request.
XdmVariable setNewVariable(java.lang.String namespace, java.lang.String localname, ValueType type, java.lang.Object value)
Convenience method that creates a new XdmVariable
, binds it to this Request and then
returns the new XdmVariable
object. This method is equivalent to:
XdmVariable temp = ValueFactory.newVariable (
new XName (namespace, localname),
ValueFactory.newValue (type, value));
request.setVariable (temp);
return temp;
namespace
- A namespace String, or null for the default namespace.localname
- The local name as a String.type
- An instance of ValueType
that indicates which specific subclass of
XdmValue
to instantiate.value
- An object that contains the value. The concrete type that should be passed is
dependent on the ValueType
instance provided as the "type" parameter.void setNewVariables(java.lang.String namespace, java.lang.String localname, ValueType type, java.lang.Object[] values)
Creates a sequence XdmVariable
from the input values and
binds it to this Request.
namespace
- A namespace String, or null for the default namespace.localname
- The local name as a String.type
- An instance of ValueType
that indicates
specific subclass of XdmValue
to instantiate in the sequence.values
- An array of objects that contains the value. The concrete
type that should be passed is dependent on the
ValueType
instance provided as the "type" parameter.XdmVariable setNewVariable(java.lang.String localname, ValueType type, java.lang.Object value)
Convenience method that creates a new XdmVariable
, binds it to this Request and then
returns the new XdmVariable
. This method is equivalent to:
XdmVariable temp = ValueFactory.newVariable (
new XName (null, localname),
ValueFactory.newValue (type, value));
request.setVariable (temp);
return temp;
localname
- The local name as a String.type
- An instance of ValueType
that indicates which specific subclass of
XdmValue
to instantiate.value
- An object that contains the value. The concrete type that should be passed is
dependent on the ValueType
instance provided as the "type" parameter.void setNewVariables(java.lang.String localname, ValueType type, java.lang.Object[] values)
Creates a sequence XdmVariable
from the input values and
binds it to this Request.
localname
- The local name as a String.type
- An instance of ValueType
that indicates specific
subclass of XdmValue
to
instantiate in the sequence.values
- An array of objects that contains the values. The concrete
type that should be passed is dependent on the ValueType
instance provided as the "type" parameter.XdmVariable setNewStringVariable(java.lang.String namespace, java.lang.String localname, java.lang.String value)
Convenience method that creates a new XSString
, binds it to
this Request and then returns the new XSString
instance. This
method is equivalent to:
XdmVariable temp = ValueFactory.newVariable (
new XName (namespace, localname),
ValueFactory.newValue (ValueType.XS_STRING, value));
request.setVariable (temp);
return temp;
namespace
- A namespace String, or null for the default namespace.localname
- The local name as a String.value
- A String that contains the value.XSString
XdmVariable setNewStringVariable(java.lang.String localname, java.lang.String value)
Convenience method that creates a new XSString
, binds it to
this Request and then returns the new XSString
instance. This
method is equivalent to:
request.setNewStringVariable (null, localname, value)
localname
- The local name as a String.value
- A String that contains the value.XSString
setNewStringVariable(String, String, String)
XdmVariable setNewIntegerVariable(java.lang.String namespace, java.lang.String localname, long value)
Convenience method that creates a new XSInteger
, binds it to
this Request and then returns the new XSInteger
instance.
This method is equivalent to:
XdmVariable temp = ValueFactory.newVariable (
new XName (namespace, localname),
ValueFactory.newValue (ValueType.XS_INTEGER, value));
request.setVariable (temp);
return temp;
namespace
- A namespace String, or null for the default namespace.localname
- The local name as a String.value
- A long that contains the value. Note that XQuery integers may contain much larger
values that Java ints. If you need to specify a value larger than can be expressed
by a long, use
ValueFactory.newValue(com.marklogic.xcc.types.ValueType, Object)
and pass
a BigInteger
object as the value.XSInteger
XdmVariable setNewIntegerVariable(java.lang.String localname, long value)
Convenience method that creates a new XSInteger
, binds it to
this Request and then returns the new XSInteger
instance.
This method is equivalent to:
request.setNewIntegerVariable (null, localname, value)
localname
- The local name as a String.value
- A long that contains the value.XSInteger
setNewIntegerVariable(String, String, long)
void clearVariable(XdmVariable variable)
setVariable(com.marklogic.xcc.types.XdmVariable)
.variable
- A XdmVariable
instance to be diassociated from this Request.void clearVariables()
XdmVariable[] getVariables()
XdmVariable
objects currently set
on this Request.XdmVariable
objects.long getPosition()
void setPosition(long position)
position
- starting position.long getCount()
void setCount(long count)
count
- count.Copyright © 2017 MarkLogic Corporation. All Rights Reserved.
Complete online documentation for MarkLogic Server, XQuery and related components may be found at developer.marklogic.com