org.ccnx.ccn.profiles.versioning.VersioningInterest Class Reference

Given a base name, retrieve all versions. More...

Inheritance diagram for org.ccnx.ccn.profiles.versioning.VersioningInterest:

List of all members.

Public Member Functions

 VersioningInterest (CCNHandle handle)
void expressInterest (ContentName name, CCNContentHandler handler) throws IOException
 Express an interest for name.
void expressInterest (ContentName name, CCNContentHandler handler, 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, CCNContentHandler handler, 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, CCNContentHandler handler)
 Cancel a specific interest.
CCNStats getStatsByName (Object name) throws ClassCastException
 return the statistics for the interests corresponding to name
Object[] getCategoryNames ()

Protected Member Functions

void finalize () throws Throwable
 in case we're GC'd without a close().

Classes

class  BasenameState


Detailed Description

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.


Constructor & Destructor Documentation

org.ccnx.ccn.profiles.versioning.VersioningInterest.VersioningInterest ( CCNHandle  handle  ) 

Parameters:
handle 
listener 


Member Function Documentation

void org.ccnx.ccn.profiles.versioning.VersioningInterest.expressInterest ( ContentName  name,
CCNContentHandler  handler 
) 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.

Parameters:
name 
listener 
Exceptions:
IOException 

void org.ccnx.ccn.profiles.versioning.VersioningInterest.expressInterest ( ContentName  name,
CCNContentHandler  handler,
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.

Parameters:
name 
handler 
retrySeconds 
exclusions may be null
Exceptions:
IOException 

void org.ccnx.ccn.profiles.versioning.VersioningInterest.expressInterest ( ContentName  name,
CCNContentHandler  handler,
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.

Parameters:
name 
handler 
retrySeconds 
exclusions may be null
startingVersion the minimum version to include (may be null)
Exceptions:
IOException 

void org.ccnx.ccn.profiles.versioning.VersioningInterest.cancelInterest ( ContentName  name,
CCNContentHandler  handler 
)

Cancel a specific interest.

Parameters:
name 
handler 

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.

CCNStats org.ccnx.ccn.profiles.versioning.VersioningInterest.getStatsByName ( Object  name  )  throws ClassCastException

return the statistics for the interests corresponding to name

Parameters:
name A ContentName or a URI-encoded string
Returns:
May be null if no interest expressed for name


The documentation for this class was generated from the following file:

Generated on Thu Feb 16 00:45:05 2012 for Content-Centric Networking in Java by  doxygen 1.5.6