public class StorageConnector extends Object
| Modifier and Type | Field and Description |
|---|---|
protected MMObjectBuilder |
builder |
protected int |
maxNodesFromQuery
Maximum number of nodes to return on a query (-1 means no limit, and is also the default)
|
| Constructor and Description |
|---|
StorageConnector(MMObjectBuilder builder) |
| Modifier and Type | Method and Description |
|---|---|
void |
addIndex(Index index) |
void |
addIndices(List<Index> indexList) |
protected void |
addSubResult(NodeSearchQuery query,
List<Integer> subResult,
List<MMObjectNode> result) |
void |
addToIndex(String key,
Field field) |
protected boolean |
assertSizes(Collection<MMObjectNode> virtuals,
Collection<MMObjectNode> result) |
int |
count(SearchQuery query)
Counts number of nodes matching a specified constraint.
|
boolean |
created()
Check whether the table is accessible.
|
Index |
createIndex(String key) |
MMObjectBuilder |
getBuilderForNode(int number) |
protected QueryResultCache |
getCache(SearchQuery query)
Returns the Cache which should be used for the result of a certain query.
|
Index |
getIndex(String key) |
Map<String,Index> |
getIndices() |
MMObjectNode |
getNode(int number,
boolean useCache)
Retrieves a node based on it's number (a unique key).
|
List<MMObjectNode> |
getNodes()
Returns all the nodes from the associated builder.
|
List<MMObjectNode> |
getNodes(Collection<MMObjectNode> virtuals)
Convert virtual nodes to real nodes based on their otype
Normally a multirelations-search will return virtual nodes.
|
List<MMObjectNode> |
getNodes(SearchQuery query)
Returns nodes matching a specified constraint.
|
List<MMObjectNode> |
getNodes(SearchQuery query,
boolean useCache)
Returns nodes matching a specified constraint.
|
int |
getNodeType(int number)
Retrieves an object's type.
|
NodeSearchQuery |
getSearchQuery(String where)
Creates search query that retrieves nodes matching a specified
constraint.
|
boolean |
isInIndex(String key,
Field field) |
void |
removeFromIndex(String key,
Field field) |
int |
size()
Determine the number of objects in this table.
|
protected int maxNodesFromQuery
protected final MMObjectBuilder builder
public StorageConnector(MMObjectBuilder builder)
public int size()
public boolean created()
true if the table is accessible, false otherwise.public void addIndex(Index index)
public MMObjectNode getNode(int number, boolean useCache) throws StorageException
number - The number of the node to search foruseCache - If false, a fresh copy is returned.null if the node does not exist, the key is invalid,or a
MMObjectNode containing the contents of the requested node.StorageExceptionpublic MMObjectBuilder getBuilderForNode(int number)
public int getNodeType(int number)
throws StorageException
number - The number of the node to search forint value which is the object type (otype) of the node.StorageExceptionpublic List<MMObjectNode> getNodes(Collection<MMObjectNode> virtuals) throws SearchQueryException
virtuals - containing virtual nodesSearchQueryExceptionprotected void addSubResult(NodeSearchQuery query, List<Integer> subResult, List<MMObjectNode> result) throws SearchQueryException
query - Query with nodestep with added nodes.subResult - List of Integerresult - List to which the real nodes must be added.SearchQueryExceptionprotected boolean assertSizes(Collection<MMObjectNode> virtuals, Collection<MMObjectNode> result)
public int count(SearchQuery query) throws SearchQueryException
query - The query.IllegalArgumentException - when an invalid argument is supplied.SearchQueryException - when failing to retrieve the data.protected QueryResultCache getCache(SearchQuery query)
public List<MMObjectNode> getNodes(SearchQuery query) throws SearchQueryException
query - The query.IllegalArgumentException - When the nodetype specified
by the query is not the nodetype corresponding to this builder.SearchQueryExceptionpublic List<MMObjectNode> getNodes(SearchQuery query, boolean useCache) throws SearchQueryException
query - The query.useCache - if true, the querycache is usedIllegalArgumentException - When the nodetype specified
by the query is not the nodetype corresponding to this builder.SearchQueryExceptionpublic List<MMObjectNode> getNodes() throws SearchQueryException
SearchQueryExceptionpublic NodeSearchQuery getSearchQuery(String where)
where - The constraint, can be a SQL where-clause, a MMNODE
expression, an altavista-formatted expression, empty or
null.MMBase 1.9-SNAPSHOT - ${javadoctimestamp}