org.ccnx.ccn.test.Flosser Class Reference

A class to help write tests without a repository or setting up a separate thread to read data. More...

List of all members.

Public Member Functions

 Flosser () throws ConfigurationException, IOException
 Constructors that called handleNamespace() now throwing NullPointerException as this doesn't exist yet.
 Flosser (ContentName namespace) throws ConfigurationException, IOException
void stopMonitoringNamespace (String namespace) throws MalformedContentNameStringException
void stopMonitoringNamespace (ContentName namespace)
void stopMonitoringNamespaces ()
void handleNamespace (String namespace) throws MalformedContentNameStringException, IOException
void handleNamespace (ContentName namespace) throws IOException
 Handle a top-level namespace.
void handleNamespace (ContentName namespace, ContentName parent) throws IOException
Interest handleContent (ContentObject result, Interest interest)
 Callback called when we get new results for our query.
void stop ()
void logNamespaces ()
Set< ContentNamegetNamespaces ()

Protected Member Functions

void removeInterest (ContentName namespace)
void processContent (ContentObject result)
 Override in subclasses that want to do something more interesting than log.

Package Attributes

CCNHandle _handle
Map< ContentName, Interest_interests = new HashMap<ContentName, Interest>()
Map< ContentName, Set
< ContentName > > 
_subInterests = new HashMap<ContentName, Set<ContentName>>()
HashSet< ContentObject_processedObjects = new HashSet<ContentObject>()
boolean _shutdown = false

Detailed Description

A class to help write tests without a repository or setting up a separate thread to read data.

A Flosser tries to pull all content written under a set of specified namespaces; essentially loading that content into ccnd. Based on ccnslurp, uses excludes to not get the same data back. Not as efficient as it could be; currently stops enumerating underneath segments (assumes that there is only one content object per segment of a given version; very likely in the absence of adversarial data).

Call stopMonitoringNamespace as soon as you are done with a namespace to improve performance.

Still has a few performance snags -- mysterious delays for the interest reexpression interval; so Flosser-based tests can be slow. Shouldn't be like that, there is likely a lingering bug somewhere.

See CCNVersionedInputStream for related stream-based flossing code (basically a precursor to the full Flosser).

The "floss" term refers to "mental floss" -- think a picture of someone running dental floss in and out through their ears; here we are running content from an app, in through ccnd, to the flosser, so other parts of the (test) app can pull it back from ccnd later.


Constructor & Destructor Documentation

org.ccnx.ccn.test.Flosser.Flosser (  )  throws ConfigurationException, IOException

Constructors that called handleNamespace() now throwing NullPointerException as this doesn't exist yet.

Exceptions:
ConfigurationException 
IOException 

Member Function Documentation

Interest org.ccnx.ccn.test.Flosser.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.

void org.ccnx.ccn.test.Flosser.handleNamespace ( ContentName  namespace  )  throws IOException

Handle a top-level namespace.

Parameters:
namespace 
Exceptions:
IOException 
void org.ccnx.ccn.test.Flosser.processContent ( ContentObject  result  )  [protected]

Override in subclasses that want to do something more interesting than log.

Parameters:
result 

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