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...

Inheritance diagram for org.ccnx.ccn.test.Flosser:

org.ccnx.ccn.CCNContentHandler

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 setFlossSubNamespaces (boolean flag)
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 _flossSubNamespaces = false
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

By default does not floss namespaces below segments. This is because most commonly we will receive a file with a segmented namespace and no hierarchy below that. Trying to floss below this will lead to large numbers of unsatisfied interests being expressed, adversely affecting performance.

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

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

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

Handle a top-level namespace.

Parameters:
namespace 
Exceptions:
IOException 

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.CCNContentHandler.

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 Thu Feb 16 00:45:08 2012 for Content-Centric Networking in Java by  doxygen 1.5.6