Package helma.objectmodel.db
Class WrappedNodeManager
java.lang.Object
helma.objectmodel.db.WrappedNodeManager
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
ConstructorsConstructorDescriptionCreates a new WrappedNodeManager object. -
Method Summary
Modifier and TypeMethodDescriptionint
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 databasevoid
Evict the object with the given key from the object cachevoid
Evict a node from the object cachevoid
evictNodeByKey
(Key key) Completely evict the object with the given key from the object cachegenerateID
(DbMapping map) Generate a new id for an object specified by the DbMappingObject[]
Get an array of all objects in the object cachegetDbMapping
(String name) Get the DbMapping corresponding to a type nameGet a node given its keyGet the node specified by the given id and Relation.Get a node given its id and DbMappinggetNodeIDs
(Node home, Relation rel) Get a list of IDs of nodes contained in the given Node's collection specified by the given Relation.Get the list of nodes contained in the collection of the given Node specified by the given Relation.getPropertyNames
(Node home, Relation rel) Get a list of property names from the given node.Gets the application's root node.boolean
isRootNode
(Node node) Checks if the given node is the application's root node.void
Write an entry to the application's event logvoid
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.
-
Constructor Details
-
WrappedNodeManager
Creates a new WrappedNodeManager object.- Parameters:
nmgr
- ...
-
-
Method Details
-
getNode
Get a node given its id and DbMapping- Parameters:
id
-dbmap
-- Returns:
-
getNode
Get a node given its key- Parameters:
key
-- Returns:
-
getNode
Get the node specified by the given id and Relation.- Parameters:
home
-id
-rel
-- Returns:
-
getNodes
Get the list of nodes contained in the collection of the given Node specified by the given Relation.- Parameters:
home
-rel
-- Returns:
-
getNodeIDs
Get a list of IDs of nodes contained in the given Node's collection specified by the given Relation.- Parameters:
home
-rel
-- Returns:
-
countNodes
Count the nodes contained in the given Node's collection specified by the given Relation.- Parameters:
home
-rel
-- Returns:
-
prefetchNodes
-
deleteNode
Delete a node from the database- Parameters:
node
-
-
getPropertyNames
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
Register a node with the object cache using its primary key.- Parameters:
node
-
-
registerNode
Register a node with the object cache using the given key.- Parameters:
node
-
-
evictNode
Evict a node from the object cache- Parameters:
node
-
-
evictNodeByKey
Completely evict the object with the given key from the object cache- Parameters:
key
-
-
evictKey
Evict the object with the given key from the object cache- Parameters:
key
-
-
generateID
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
Gets the application's root node. -
isRootNode
Checks if the given node is the application's root node. -
getCacheEntries
Get an array of all objects in the object cache -
logEvent
Write an entry to the application's event log- Parameters:
msg
- event message
-
getDbMapping
Get the DbMapping corresponding to a type name- Parameters:
name
- a type name- Returns:
- the corresponding DbMapping
-