public class QuerySources extends Object
NodeSequence
instances.Modifier and Type | Class and Description |
---|---|
protected static class |
QuerySources.BatchWriter |
protected static class |
QuerySources.CompositeNodeFilter |
Modifier and Type | Field and Description |
---|---|
protected boolean |
includeSystemContent |
protected NodeTypes |
nodeTypes |
protected NodeCacheIterator.NodeFilter |
queryableAndNonSystemFilter |
protected NodeCacheIterator.NodeFilter |
queryableFilter |
protected RepositoryCache |
repo |
protected String |
systemWorkspaceName |
protected String |
workspaceName |
Constructor and Description |
---|
QuerySources(RepositoryCache repository,
NodeTypes nodeTypes,
String workspaceName,
boolean includeSystemContent)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
NodeSequence |
allNodes(float score,
long nodeCount)
Obtain a
NodeSequence that returns all (queryable) nodes in the workspace, where each node is assigned the given
score. |
NodeSequence |
childNodes(Path parentPath,
float score)
Obtain a
NodeSequence that returns the (queryable) children of the node at the given path in the workspace, where
each child node is assigned the given score. |
NodeSequence |
descendantNodes(Path ancestorPath,
float score)
Obtain a
NodeSequence that returns the (queryable) descendants of the node at the given path in the workspace,
where each descendant node is assigned the given score. |
NodeSequence |
fromIndex(Index index,
Collection<Constraint> constraints,
Collection<JoinCondition> joinConditions,
Map<String,Object> variables,
Map<String,Object> parameters,
ValueFactories valueFactories,
int batchSize)
Obtain a
NodeSequence that uses the supplied index to find the node that satisfy the given constraints. |
protected String |
getIdentifier(CachedNode node,
NodeKey workspaceRootKey) |
protected CachedNode |
getNodeAtPath(Path path,
NodeCache cache) |
String |
getWorkspaceName() |
protected String |
getWorkspaceName(Path path) |
boolean |
includeSystemContent() |
protected NodeCacheIterator.NodeFilter |
nodeFilterForWorkspace(String workspaceName) |
protected NodeCacheIterator |
nodes(String workspaceName,
Path path)
Return an iterator over all nodes at or below the specified path in the named workspace, using the supplied filter.
|
protected NodeCacheIterator.NodeFilter |
sharedNodesFilter()
Creates a node filter which doesn't include any of the nodes from the shared set in the query result.
|
NodeSequence |
singleNode(Path path,
float score)
Obtain a
NodeSequence that returns the (queryable) node at the given path in the workspace, where the node is
assigned the given score. |
NodeSequence |
singleNode(String workspaceName,
String identifier,
float score)
Obtain a
NodeSequence that returns the (queryable) node with the given key in the workspace, where the node is
assigned the given score. |
String |
toString() |
protected final RepositoryCache repo
protected final String workspaceName
protected final String systemWorkspaceName
protected final boolean includeSystemContent
protected final NodeCacheIterator.NodeFilter queryableFilter
protected final NodeCacheIterator.NodeFilter queryableAndNonSystemFilter
protected final NodeTypes nodeTypes
public QuerySources(RepositoryCache repository, NodeTypes nodeTypes, String workspaceName, boolean includeSystemContent)
repository
- the repository cache; may not be nullnodeTypes
- the node types cache; may not be nullworkspaceName
- the name of the main workspace to be queried; may not be nullincludeSystemContent
- true if the system content is to be included in the query results, or false otherwisepublic boolean includeSystemContent()
public String getWorkspaceName()
public NodeSequence allNodes(float score, long nodeCount)
NodeSequence
that returns all (queryable) nodes in the workspace, where each node is assigned the given
score.score
- the score for each nodenodeCount
- the number of nodes (or an estimate) that will be returnedpublic NodeSequence singleNode(Path path, float score)
NodeSequence
that returns the (queryable) node at the given path in the workspace, where the node is
assigned the given score.path
- the path of the node; may not be nullscore
- the score for the nodepublic NodeSequence singleNode(String workspaceName, String identifier, float score)
NodeSequence
that returns the (queryable) node with the given key in the workspace, where the node is
assigned the given score.workspaceName
- the name of the workspace; may not be nullidentifier
- the identifier
of the node; may not be nullscore
- the score for the nodeprotected String getIdentifier(CachedNode node, NodeKey workspaceRootKey)
public NodeSequence childNodes(Path parentPath, float score)
NodeSequence
that returns the (queryable) children of the node at the given path in the workspace, where
each child node is assigned the given score.parentPath
- the path of the parent node; may not be nullscore
- the score for the nodespublic NodeSequence descendantNodes(Path ancestorPath, float score)
NodeSequence
that returns the (queryable) descendants of the node at the given path in the workspace,
where each descendant node is assigned the given score.ancestorPath
- the path of the ancestor of all descendants; may not be nullscore
- the score for the nodespublic NodeSequence fromIndex(Index index, Collection<Constraint> constraints, Collection<JoinCondition> joinConditions, Map<String,Object> variables, Map<String,Object> parameters, ValueFactories valueFactories, int batchSize)
NodeSequence
that uses the supplied index to find the node that satisfy the given constraints.index
- the index; may not be nullconstraints
- the constraints that apply to the index; may not be null but can be emptyjoinConditions
- the join constraints that apply to the index; may not be but can be emptyvariables
- the immutable map of variable values keyed by their name; never null but possibly emptyparameters
- the provider-specific index parameters; may not be null, but may be emptyvalueFactories
- the value factories; never nullbatchSize
- the ideal number of nodes that are to be included in each batch; always positiveprotected NodeCacheIterator.NodeFilter sharedNodesFilter()
NodeCacheIterator.NodeFilter
instanceprotected NodeCacheIterator nodes(String workspaceName, Path path)
workspaceName
- the name of the workspacepath
- the path of the root node of the subgraph, or null if all nodes in the workspace are to be includedprotected NodeCacheIterator.NodeFilter nodeFilterForWorkspace(String workspaceName)
protected CachedNode getNodeAtPath(Path path, NodeCache cache)
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.