org.ccnx.ccn.impl.repo.ContentTree Class Reference

Creates a tree structure to track the data stored within a LogStructRepoStore RepositoryStore. More...

List of all members.

Classes

interface  ContentGetter
class  InterestPreScreener
 Prescreen candidates against elements of an interest that we can so we don't need to consider candidates that have no chance of matching. More...
class  LeftSearch
 Search for data matching an interest that specifies either the leftmost (canonically smallest) match or doesn't specify a specific way to match data within several pieces of matching data. More...
class  RightIterator
 Create an iterator that goes backwards through the candidates for right search. More...
class  RightSearch
 Search for data matching an interest in which the rightmost (canonically largest) data among several matching pieces should be returned. More...
class  Search
 Implements the generic pieces of both left and right searches. More...
class  TreeNode
 TreeNode is the data structure representing one node of a tree which may have children and/or content. More...

Public Member Functions

boolean insert (ContentObject content, ContentRef ref, long ts, ContentGetter getter, NameEnumerationResponse ner)
 Insert entry for the given ContentObject.
void dumpNamesTree (PrintStream output, int maxNodeLen)
 Dump current names to an output file for debugging.
final NameEnumerationResponse getNamesWithPrefix (Interest interest, ContentName responseName)
 Return all names with a prefix matching the name within the interest for name enumeration.
final ContentObject get (Interest interest, ContentGetter getter)
 Retrieve the data from the store that best matches the given interest.
boolean matchContent (ContentName name)
 Determine if there is data with exactly the given name.

Protected Member Functions

TreeNode lookupNode (ContentName name, int count)
 Find the node for the given name.
final List< ContentReflookup (ContentName name)
 Return the content objects with exactly the given name.
void dumpRecurse (PrintStream output, TreeNode node, String indent, int maxNodeLen)

Protected Attributes

TreeNode _root

Detailed Description

Creates a tree structure to track the data stored within a LogStructRepoStore RepositoryStore.

Implements binary tree based algorithms to store and retrieve data based on interests and NameEnumeration


Member Function Documentation

void org.ccnx.ccn.impl.repo.ContentTree.dumpNamesTree ( PrintStream  output,
int  maxNodeLen 
)

Dump current names to an output file for debugging.

Parameters:
output the output file
maxNodeLen max characters to include in a component name in the output
final ContentObject org.ccnx.ccn.impl.repo.ContentTree.get ( Interest  interest,
ContentGetter  getter 
)

Retrieve the data from the store that best matches the given interest.

Parameters:
interest the interest to match
getter used to read a possible match for final matching
Returns:
the matching ContentObject or null if none
final NameEnumerationResponse org.ccnx.ccn.impl.repo.ContentTree.getNamesWithPrefix ( Interest  interest,
ContentName  responseName 
)

Return all names with a prefix matching the name within the interest for name enumeration.

The current implementation of name enumeration in the repository uses the object save dates to determine whether there is new information to send back. If the name matches the incoming interest, the child names are collected from the tree and sent back in a NameEnumerationResponse object. If there is not any new information under the prefix, an interest flag is set. This will trigger a NameEnumerationResponse when a new child is added to the prefix. Interests attempting to enumerate under a prefix that does not exist on the repo are dropped.

Parameters:
interest the interest to base the enumeration on using the rules of name enumeration
Returns:
the name enumeration response containing the list of matching names
boolean org.ccnx.ccn.impl.repo.ContentTree.insert ( ContentObject  content,
ContentRef  ref,
long  ts,
ContentGetter  getter,
NameEnumerationResponse  ner 
)

Insert entry for the given ContentObject.

Inserts at a parent with the interest flag set create a NameEnumerationResponse object to send out in response to a name enumeration request that was not answered do to no new information existing. If the interest flag is not set at the parent, a name enumeration response is not written.

Parameters:
content the data to insert
ref pointer to position of data in the file storage
ts last modification time of the data
getter to retrieve previous content to check for duplication
ner NameEnumerationResponse object to populate if the insert occurs at a parent with the interest flag set
Returns:
- true if content is not exact duplicate of existing content.
final List<ContentRef> org.ccnx.ccn.impl.repo.ContentTree.lookup ( ContentName  name  )  [protected]

Return the content objects with exactly the given name.

Parameters:
name ContentName to lookup
Returns:
node containing the name
TreeNode org.ccnx.ccn.impl.repo.ContentTree.lookupNode ( ContentName  name,
int  count 
) [protected]

Find the node for the given name.

Parameters:
name ContentName to search for
count depth to search
Returns:
node containing the name
boolean org.ccnx.ccn.impl.repo.ContentTree.matchContent ( ContentName  name  ) 

Determine if there is data with exactly the given name.

Parameters:
name to match, including explicit digest as final component
Returns:
true if there is data with the given complete name, false otherwise

The documentation for this class was generated from the following file:
Generated on Fri May 13 16:27:39 2011 for Content-Centric Networking in Java by  doxygen 1.6.3