|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.mmbase.core.util.StorageConnector
public class StorageConnector
A StorageConnector object is associated with a specific builder. It provides methods for loading nodes from the cloud (using the search query classes), either individual nodes or nodelists.
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
StorageConnector(MMObjectBuilder builder)
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int maxNodesFromQuery
protected final MMObjectBuilder builder
| Constructor Detail |
|---|
public StorageConnector(MMObjectBuilder builder)
| Method Detail |
|---|
public int size()
public boolean created()
true if the table is accessible, false otherwise.public Map<String,Index> getIndices()
public void addIndex(Index index)
public void addIndices(List<Index> indexList)
public Index getIndex(String key)
public Index createIndex(String key)
public void addToIndex(String key,
Field field)
public void removeFromIndex(String key,
Field field)
public boolean isInIndex(String key,
Field field)
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 for
int value which is the object type (otype) of the node.
StorageException
public List<MMObjectNode> getNodes(Collection<MMObjectNode> virtuals)
throws SearchQueryException
virtuals - containing virtual nodes
SearchQueryException
protected 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.
SearchQueryException
protected 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.
SearchQueryException
public List<MMObjectNode> getNodes(SearchQuery query,
boolean useCache)
throws SearchQueryException
query - The query.useCache - if true, the querycache is used
IllegalArgumentException - When the nodetype specified
by the query is not the nodetype corresponding to this builder.
SearchQueryException
public 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||