|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.core.util.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 indivbidual 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 indexList)
|
void |
addToIndex(String key,
Field field)
|
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 Map |
getCache(SearchQuery query)
Returns the Cache which should be used for the result of a certain query. |
Index |
getIndex(String key)
|
Map |
getIndices()
|
MMObjectNode |
getNode(int number,
boolean useCache)
Retrieves a node based on it's number (a unique key). |
List |
getNodes()
Returns all the nodes from the associated builder. |
List |
getNodes(Collection virtuals)
Convert virtual nodes to real nodes based on their otype Normally a multirelations-search will return virtual nodes. |
List |
getNodes(SearchQuery query)
Returns nodes matching a specified constraint. |
List |
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 getIndices()
public void addIndex(Index index)
public void addIndices(List 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 getNodes(Collection virtuals)
throws SearchQueryException
virtuals - containing virtual nodes
SearchQueryException
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 Map getCache(SearchQuery query)
public List 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 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 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 | |||||||||