Interface DimensionQueryRunner
-
public interface DimensionQueryRunner
A one-time runner, used to execute a DimensionQuery.This object contains run-time configurations to the DimensionQuery, and is the starting point for query execution.
DimensionQueryRunner objects are not thread safe, and should only be used once. If you need to re-run a query, get a new runner object from the query.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DimensionQueryRunner
activeNode(int dimensionId)
Specifies which node in the tree shall be considered the active one.DimensionQueryRunner
activeNode(ObjectReference objectReference)
Specifies which node in the tree shall be considered the active one.DimensionQueryRunner
activeNode(String externalKey)
Specifies which node in the tree shall be considered the active one.DimensionQueryRunner
childrenOf(int dimensionId)
Specifies that the runner shall only return the children of a given node, to facility partial loading of the dimension tree.DimensionQueryRunner
childrenOf(ObjectReference objectReference)
Specifies that the runner shall only return the children of a given node, to facility partial loading of the dimension tree.DimensionQueryRunner
childrenOf(String externalKey)
Specifies that the runner shall only return the children of a given node, to facility partial loading of the dimension tree.<U> DimensionQueryRunner
configure(BiConsumer<DimensionQueryRunner,U> configurator, U parameter)
Calls a configuration function with this runner, to allow reusable configuration logic.DimensionQueryRunner
configure(Consumer<DimensionQueryRunner> configurator)
Calls a configuration function with this runner, to allow reusable configuration logic.DimensionQueryRunner
includingNode(int dimensionId)
Specifies that the runner shall always include the specified node, even if this is in a subtree below the number of levels specified.DimensionQueryRunner
includingNode(ObjectReference objectReference)
Specifies that the runner shall always include the specified node, even if this is in a subtree below the number of levels specified.DimensionQueryRunner
includingNode(String externalKey)
Specifies that the runner shall always include the specified node, even if this is in a subtree below the number of levels specified.DimensionQueryRunner
levels(int levels)
Specifies the number of levels to be returned by the query.DimensionQueryRunner
query(String value)
DimensionQueryResult
run(ContentServicesClient client)
Runs the configured query, returning the query result.
-
-
-
Method Detail
-
levels
DimensionQueryRunner levels(int levels)
Specifies the number of levels to be returned by the query.The limit set in the runner will override the limit already specified by the DimensionQuery, if set. If neither the builder nor the runner specifies the number of levels, the default is all levels.
- Parameters:
levels
- the number of levels to return- Returns:
- this DimensionQueryRunner
-
childrenOf
DimensionQueryRunner childrenOf(ObjectReference objectReference)
Specifies that the runner shall only return the children of a given node, to facility partial loading of the dimension tree. The returned tree will still be constrained to children of the root nodes specified by the DimensionQuery.- Parameters:
objectReference
- object reference of the node to load children of- Returns:
- this DimensionQueryRunner
-
childrenOf
DimensionQueryRunner childrenOf(String externalKey)
Specifies that the runner shall only return the children of a given node, to facility partial loading of the dimension tree. The returned tree will still be constrained to children of the root nodes specified by the DimensionQuery.- Parameters:
externalKey
- external key of the node to load children of- Returns:
- this DimensionQueryRunner
-
childrenOf
DimensionQueryRunner childrenOf(int dimensionId)
Specifies that the runner shall only return the children of a given node, to facility partial loading of the dimension tree. The returned tree will still be constrained to children of the root nodes specified by the DimensionQuery.- Parameters:
dimensionId
- id of the node to load children of- Returns:
- this DimensionQueryRunner
-
includingNode
DimensionQueryRunner includingNode(ObjectReference objectReference)
Specifies that the runner shall always include the specified node, even if this is in a subtree below the number of levels specified. This enables loading fewer levels of the entire tree, while still getting the subtree required to show a particular node.- Parameters:
objectReference
- object reference of the node to always include- Returns:
- this DimensionQueryRunner
-
includingNode
DimensionQueryRunner includingNode(String externalKey)
Specifies that the runner shall always include the specified node, even if this is in a subtree below the number of levels specified. This enables loading fewer levels of the entire tree, while still getting the subtree required to show a particular node.- Parameters:
externalKey
- external key of the node to always include- Returns:
- this DimensionQueryRunner
-
includingNode
DimensionQueryRunner includingNode(int dimensionId)
Specifies that the runner shall always include the specified node, even if this is in a subtree below the number of levels specified. This enables loading fewer levels of the entire tree, while still getting the subtree required to show a particular node.- Parameters:
dimensionId
- id of the node to always include- Returns:
- this DimensionQueryRunner
-
activeNode
DimensionQueryRunner activeNode(ObjectReference objectReference)
Specifies which node in the tree shall be considered the active one. Setting an active node will also influence its parents, which will then have the hasActiveChild property set to true.Note that this function only affects the results if the active node is returned by the query. If the active node is on a lower level not loaded by the query, the function will have no affect. It will often be natural to also call includingNode() to ensure that the active node is loaded.
- Parameters:
objectReference
- object reference of the active node- Returns:
- this DimensionQueryRunner
-
activeNode
DimensionQueryRunner activeNode(String externalKey)
Specifies which node in the tree shall be considered the active one. Setting an active node will also influence its parents, which will then have the hasActiveChild property set to true.Note that this function only affects the results if the active node is returned by the query. If the active node is on a lower level not loaded by the query, the function will have no affect. It will often be natural to also call includingNode() to ensure that the active node is loaded.
- Parameters:
externalKey
- external key of the active node- Returns:
- this DimensionQueryRunner
-
activeNode
DimensionQueryRunner activeNode(int dimensionId)
Specifies which node in the tree shall be considered the active one. Setting an active node will also influence its parents, which will then have the hasActiveChild property set to true.Note that this function only affects the results if the active node is returned by the query. If the active node is on a lower level not loaded by the query, the function will have no affect. It will often be natural to also call includingNode() to ensure that the active node is loaded.
- Parameters:
dimensionId
- id of the active node- Returns:
- this DimensionQueryRunner
-
query
DimensionQueryRunner query(String value)
-
configure
DimensionQueryRunner configure(Consumer<DimensionQueryRunner> configurator)
Calls a configuration function with this runner, to allow reusable configuration logic.This function calls a separate configurator function with this runner as a parameter. The configurator can then configure this runner as it sees fit. The main use case of this is to include a shared configuration as part of a fluent builder-pattern.
- Parameters:
configurator
- the configurator function- Returns:
- this ContentQueryRunner
-
configure
<U> DimensionQueryRunner configure(BiConsumer<DimensionQueryRunner,U> configurator, U parameter)
Calls a configuration function with this runner, to allow reusable configuration logic.This function calls a separate configurator function with this runner as the first parameter, and a user specified value as the second. The configurator can then configure this builder as it sees fit. The main use case of this is to include a shared configuration as part of a fluent builder-pattern.
- Parameters:
configurator
- the configurator function- Returns:
- this DimensionQueryBuilder
-
run
DimensionQueryResult run(ContentServicesClient client)
Runs the configured query, returning the query result.- Parameters:
client
- the content services client in which the query shall be run- Returns:
- the query result
-
-