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< ContentName > | 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). | |
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>() |
Classes | |
class | SearchResults |
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.
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).
startingPoint | ||
stoppingPoint | ||
desiredPostfix | ||
closestOnPath | ||
goneOK | ||
timeout | ||
searchedPathCache | ||
handle |
IOException |
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.
Interest org.ccnx.ccn.profiles.search.Pathfinder.handleContent | ( | ContentObject | data, | |
Interest | interest | |||
) |
Callback called when we get new results for our query.
data | the ContentObject that matched our Interest | |
interest | Interest that was satisfied |
Implements org.ccnx.ccn.CCNContentHandler.