Package helma.objectmodel.db

# Class WrappedNodeManager

java.lang.Object
helma.objectmodel.db.WrappedNodeManager

public final class WrappedNodeManager extends Object
A wrapper around NodeManager that catches most Exceptions, or rethrows them as RuntimeExceptions. The idea behind this is that we don't care a lot about Exception classes, since Hop programming is done in JavaScript which doesn't know about them (except for the exception message).

## Constructor Summary

Constructors
Constructor
Description
`WrappedNodeManager(NodeManager nmgr)`
Creates a new WrappedNodeManager object.

## Method Summary

Modifier and Type
Method
Description
`int`
`countNodes(Node home, Relation rel)`
Count the nodes contained in the given Node's collection specified by the given Relation.
`void`
`deleteNode(Node node)`
Delete a node from the database
`void`
`evictKey(Key key)`
Evict the object with the given key from the object cache
`void`
`evictNode(Node node)`
Evict a node from the object cache
`void`
`evictNodeByKey(Key key)`
Completely evict the object with the given key from the object cache
`String`
`generateID(DbMapping map)`
Generate a new id for an object specified by the DbMapping
`Object[]`
`getCacheEntries()`
Get an array of all objects in the object cache
`DbMapping`
`getDbMapping(String name)`
Get the DbMapping corresponding to a type name
`Node`
`getNode(Key key)`
Get a node given its key
`Node`
`getNode(Node home, String id, Relation rel)`
Get the node specified by the given id and Relation.
`Node`
`getNode(String id, DbMapping dbmap)`
Get a node given its id and DbMapping
`List`
`getNodeIDs(Node home, Relation rel)`
Get a list of IDs of nodes contained in the given Node's collection specified by the given Relation.
`List`
`getNodes(Node home, Relation rel)`
Get the list of nodes contained in the collection of the given Node specified by the given Relation.
`Vector`
`getPropertyNames(Node home, Relation rel)`
Get a list of property names from the given node.
`Node`
`getRootNode()`
Gets the application's root node.
`boolean`
`isRootNode(Node node)`
Checks if the given node is the application's root node.
`void`
`logEvent(String msg)`
Write an entry to the application's event log
`void`
`prefetchNodes(Node node, Relation rel, SubnodeList list, int start, int length)`
`void`
`registerNode(Node node)`
Register a node with the object cache using its primary key.
`void`
`registerNode(Node node, Key key)`
Register a node with the object cache using the given key.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### WrappedNodeManager

public WrappedNodeManager(NodeManager nmgr)
Creates a new WrappedNodeManager object.

Parameters:
  `nmgr` - ...

## Method Details

### getNode

public Node getNode(String id, DbMapping dbmap)
Get a node given its id and DbMapping

Parameters:
  `id` -
  `dbmap` -
Returns:

### getNode

public Node getNode(Key key)
Get a node given its key

Parameters:
  `key` -
Returns:

### getNode

public Node getNode(Node home, String id, Relation rel)
Get the node specified by the given id and Relation.

Parameters:
  `home` -
  `id` -
  `rel` -
Returns:

### getNodes

public List getNodes(Node home, Relation rel)
Get the list of nodes contained in the collection of the given Node specified by the given Relation.

Parameters:
  `home` -
  `rel` -
Returns:

### getNodeIDs

public List getNodeIDs(Node home, Relation rel)
Get a list of IDs of nodes contained in the given Node's collection specified by the given Relation.

Parameters:
  `home` -
  `rel` -
Returns:

### countNodes

public int countNodes(Node home, Relation rel)
Count the nodes contained in the given Node's collection specified by the given Relation.

Parameters:
  `home` -
  `rel` -
Returns:

### prefetchNodes

public void prefetchNodes(Node node, Relation rel, SubnodeList list, int start, int length)

### deleteNode

public void deleteNode(Node node)
Delete a node from the database

Parameters:
  `node` -

### getPropertyNames

public Vector getPropertyNames(Node home, Relation rel)
Get a list of property names from the given node. TODO: this retrieves access names of child nodes, not property names

Parameters:
  `home` -
  `rel` -
Returns:

### registerNode

public void registerNode(Node node)
Register a node with the object cache using its primary key.

Parameters:
  `node` -

### registerNode

public void registerNode(Node node, Key key)
Register a node with the object cache using the given key.

Parameters:
  `node` -

### evictNode

public void evictNode(Node node)
Evict a node from the object cache

Parameters:
  `node` -

### evictNodeByKey

public void evictNodeByKey(Key key)
Completely evict the object with the given key from the object cache

Parameters:
  `key` -

### evictKey

public void evictKey(Key key)
Evict the object with the given key from the object cache

Parameters:
  `key` -

### generateID

public String generateID(DbMapping map)
Generate a new id for an object specified by the DbMapping

Parameters:
  `map` - the DbMapping to generate an id for
Returns:
  a new unique id

### getRootNode

public Node getRootNode()
Gets the application's root node.

### isRootNode

public boolean isRootNode(Node node)
Checks if the given node is the application's root node.

### getCacheEntries

public Object[] getCacheEntries()
Get an array of all objects in the object cache

### logEvent

public void logEvent(String msg)
Write an entry to the application's event log

Parameters:
  `msg` - event message

### getDbMapping

public DbMapping getDbMapping(String name)
Get the DbMapping corresponding to a type name

Parameters:
  `name` - a type name
Returns:
  the corresponding DbMapping