org.ccnx.ccn.profiles.search.Pathfinder Class Reference

Implementation of some very specific, first pass search functionality. More...

List of all members.

Classes

class  SearchResults

Public Member Functions

 Pathfinder (ContentName startingPoint, ContentName stoppingPoint, ContentName desiredPostfix, boolean closestOnPath, boolean goneOK, int timeout, Set< ContentName > searchedPathCache, CCNHandle handle) throws IOException
 Search from startingPoint to stoppingPoint *inclusive* (i.e.
synchronized Set< ContentNamestopSearch ()
 We want to hand back a list of paths we have checked and ruled out to our caller, who can opt to keep them and not ask about them again (or to cache them for some time before asking).
boolean goneOK ()
boolean seekingClosestMatchOnPath ()
synchronized SearchResults waitForResults ()
boolean timedOut ()
Interest handleContent (ContentObject result, Interest interest)
 Callback called when we get new results for our query.
boolean done ()

Protected Member Functions

synchronized void startSearch () throws IOException
Interest constructInterest (ContentName searchPoint)
 Separate out so subclasses can override.

Protected Attributes

ContentName _startingPoint
ContentName _stoppingPoint
ContentName _postfix
boolean _closestOnPath
boolean _goneOK
long _timeout
CCNHandle _handle
long _startingTime
boolean _timedOut = false
Set< ContentName_searchedPathCache
SearchResults _searchResult
LinkedList< Interest_outstandingInterests = new LinkedList<Interest>()

Detailed Description

Implementation of some very specific, first pass search functionality.

Assume we have a starting point node N, e.g.

N.name() = /a/b/c/d/e

and we want to find a piece of content at some node along that path with the final name components <postfix>, e.g. valid data would be one of: /a/b/c/d/e/<postfix> /a/b/c/d/<postfix> /a/b/c/<postfix> /a/b/<postfix> /a/<postfix> /<postfix>

Depending on the requested search, we might want to find either the node with the postfix <postfix> closest to the starting node (along the path to the root); or the one farthest from the starting node (closest to the root).

Eventually allow interests to be more sophisticated, at least via subclassing.


Constructor & Destructor Documentation

org.ccnx.ccn.profiles.search.Pathfinder.Pathfinder ( ContentName  startingPoint,
ContentName  stoppingPoint,
ContentName  desiredPostfix,
boolean  closestOnPath,
boolean  goneOK,
int  timeout,
Set< ContentName searchedPathCache,
CCNHandle  handle 
) throws IOException

Search from startingPoint to stoppingPoint *inclusive* (i.e.

stoppingPoint will be searched).

Parameters:
startingPoint 
stoppingPoint 
desiredPostfix 
closestOnPath 
goneOK 
timeout 
searchedPathCache 
handle 
Exceptions:
IOException 

Member Function Documentation

Interest org.ccnx.ccn.profiles.search.Pathfinder.handleContent ( ContentObject  data,
Interest  interest 
)

Callback called when we get new results for our query.

Parameters:
data the ContentObject that matched our Interest
interest Interest that was satisfied
Returns:
new Interest to be expressed

Implements org.ccnx.ccn.CCNInterestListener.

synchronized Set<ContentName> org.ccnx.ccn.profiles.search.Pathfinder.stopSearch (  ) 

We want to hand back a list of paths we have checked and ruled out to our caller, who can opt to keep them and not ask about them again (or to cache them for some time before asking).

These would basically be all the prefixes we timed out on, not the prefixes we removed because we found something at a closer point and were looking for the closest entry, or at a farther point and were looking for the farthest entry.


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