org.openanzo.common.rdb.layout
Interface INodeLayout<T extends org.openrdf.model.Value>

Type Parameters:
T - Type of Node this layout handles
All Known Implementing Classes:
NodeLayoutBase, NodeLayoutCacheProxy, NodeLiteralLayout, NodeURILayout, NodeXMLLiteralLayout

public interface INodeLayout<T extends org.openrdf.model.Value>

Provides read/write access to persisted nodes.

Author:
Joe Betz, Stephen Evanchik

Method Summary
 T convert(java.lang.String value, java.lang.Long modifier)
          Convert raw value from database into Node of appropriate type
 java.lang.Long fetchId(T n)
          Fetches a node's ID from the database
 T fetchValue(java.lang.Long id)
          Fetches a nodes value from the database based on its long identifier and NodeType.
 NodeType getType()
           
 java.util.Map<java.lang.Long,T> resolveStoredIds(java.util.Set<java.lang.Long> ids)
          This method will determine which IDs in a list of given Ids are already stored in the database.
 java.util.Map<T,java.lang.Long> resolveStoredNodes(java.util.Set<T> nodes, boolean storeUnresolvedNodes)
          This method will determine which nodes in a list of given nodes are already stored in the database.
 java.lang.Long store(T n)
          Stores a node in the database
 

Method Detail

store

java.lang.Long store(T n)
Stores a node in the database

Parameters:
n - The node to be stored
Returns:
The ID of the node stored

fetchId

java.lang.Long fetchId(T n)
Fetches a node's ID from the database

Parameters:
n - The node who's ID is to be found
Returns:
The ID of the node or null if not found

fetchValue

T fetchValue(java.lang.Long id)
Fetches a nodes value from the database based on its long identifier and NodeType.

Parameters:
id - The ID of the node to be found
Returns:
The node

resolveStoredNodes

java.util.Map<T,java.lang.Long> resolveStoredNodes(java.util.Set<T> nodes,
                                                   boolean storeUnresolvedNodes)
This method will determine which nodes in a list of given nodes are already stored in the database. If storeUnresolvedNodes is true, then any node that is unresolved will be stored.

Parameters:
nodes - The nodes which need to be resolved to whether they are already stored or need to be stored.
storeUnresolvedNodes - Store nodes that are not already stored
Returns:
A Map of the nodes already stored in the database.

resolveStoredIds

java.util.Map<java.lang.Long,T> resolveStoredIds(java.util.Set<java.lang.Long> ids)
This method will determine which IDs in a list of given Ids are already stored in the database.

Parameters:
ids - The ids which need to be resolved to whether they are already stored.
Returns:
A Map of the ids already stored in the database.

getType

NodeType getType()
Returns:
type of Nodes this layout handles

convert

T convert(java.lang.String value,
          java.lang.Long modifier)
Convert raw value from database into Node of appropriate type

Parameters:
value - raw value of node from database
modifier - for literal values
Returns:
converted Node of appropriate type


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.