Given a base name, retrieve all versions. More...
Classes | |
class | BasenameState |
Public Member Functions | |
VersioningInterest (CCNHandle handle) | |
void | expressInterest (ContentName name, CCNInterestListener listener) throws IOException |
Express an interest for name. | |
void | expressInterest (ContentName name, CCNInterestListener listener, Set< VersionNumber > exclusions) throws IOException |
As above, and provide a set of versions to exclude The return value from listener is ignored, the listener does not need to re-express an interest. | |
void | expressInterest (ContentName name, CCNInterestListener listener, Set< VersionNumber > exclusions, VersionNumber startingVeersion) throws IOException |
As above, and provide a set of versions to exclude and a hard floor startingVersion, any version before that will be ignored. | |
void | close () |
Kill off all interests. | |
void | cancelInterest (ContentName name, CCNInterestListener listener) |
Cancel a specific interest. | |
CCNStats | getStatsByName (Object name) throws ClassCastException |
return the statistics for the interests corresponding to name | |
Object[] | getCategoryNames () |
Get a list of the category keys. | |
Protected Member Functions | |
void | finalize () throws Throwable |
in case we're GC'd without a close(). |
Given a base name, retrieve all versions.
We have maintained a similar method naming to CCNHandle (expressInterest, cancelInterest, close), except we take a ContentName input instead of an Interest input. A future extension might be to take an Interest to make it more drop-in replacement for existing CCNHandle methods.
IMPORTANT: The CCNInterestListener that gets the data should not block for long and should not hijack the incoming thread.
NOTE: The retry is not implemented. Interests are re-expressed every 4 seconds as per normal, and they continue to be expressed until canceled.
This object is meant to be private for one application, which provides the CCNHandle to use. It may be shared between multiple threads. The way the retry expression works is intended for one app to use that has an understanding of its needs.
The class will:
Because the list of excluded version can be very long, this class manages expressing multiple interests.
All the work is done down in the inner class BasenameState, which is the state stored per basename and tracks the interests issued for that basename. It is really just a holder for VersioningInterestManager plus state about the set of listeners.
org.ccnx.ccn.profiles.versioning.VersioningInterest.VersioningInterest | ( | CCNHandle | handle | ) |
handle | ||
listener |
void org.ccnx.ccn.profiles.versioning.VersioningInterest.cancelInterest | ( | ContentName | name, | |
CCNInterestListener | listener | |||
) |
Cancel a specific interest.
name | ||
listener |
void org.ccnx.ccn.profiles.versioning.VersioningInterest.expressInterest | ( | ContentName | name, | |
CCNInterestListener | listener, | |||
Set< VersionNumber > | exclusions, | |||
VersionNumber | startingVeersion | |||
) | throws IOException |
As above, and provide a set of versions to exclude and a hard floor startingVersion, any version before that will be ignored.
The return value from listener is ignored, the listener does not need to re-express an interest. Interests are re-expressed automatically until canceled.
name | ||
listener | ||
retrySeconds | ||
exclusions | may be null | |
startingVersion | the minimum version to include (may be null) |
IOException |
void org.ccnx.ccn.profiles.versioning.VersioningInterest.expressInterest | ( | ContentName | name, | |
CCNInterestListener | listener, | |||
Set< VersionNumber > | exclusions | |||
) | throws IOException |
As above, and provide a set of versions to exclude The return value from listener is ignored, the listener does not need to re-express an interest.
Interests are re-expressed automatically until canceled.
name | ||
listener | ||
retrySeconds | ||
exclusions | may be null |
IOException |
void org.ccnx.ccn.profiles.versioning.VersioningInterest.expressInterest | ( | ContentName | name, | |
CCNInterestListener | listener | |||
) | throws IOException |
Express an interest for name.
We will assume that name does not include a version, and we construct an interest that will only match 3 additional components to name (version/segment/digest).
When the default CCN timeout is exceeded, we stop responding.
If there is already an interest for the same (name, listener), no action is taken.
The return value from listener is ignored, the listener does not need to re-express an interest. Interests are re-expressed automatically until canceled.
name | ||
listener |
IOException |
void org.ccnx.ccn.profiles.versioning.VersioningInterest.finalize | ( | ) | throws Throwable [protected] |
in case we're GC'd without a close().
Don't rely on this.
Object [] org.ccnx.ccn.profiles.versioning.VersioningInterest.getCategoryNames | ( | ) |
Get a list of the category keys.
The toString() method of the key should be meaningful.
Implements org.ccnx.ccn.impl.CCNStats.CCNCategorizedStatistics.
CCNStats org.ccnx.ccn.profiles.versioning.VersioningInterest.getStatsByName | ( | Object | name | ) | throws ClassCastException |
return the statistics for the interests corresponding to name
name | A ContentName or a URI-encoded string |
Implements org.ccnx.ccn.impl.CCNStats.CCNCategorizedStatistics.