org.ccnx.ccn.io.CCNReader Class Reference

Miscellaneous helper functions to read data. More...

List of all members.

Public Member Functions

 CCNReader (CCNHandle handle) throws ConfigurationException, IOException
ContentObject get (ContentName name, PublisherPublicKeyDigest publisher, long timeout) throws IOException
 Gets a ContentObject matching this name and publisher.
ContentObject get (Interest interest, long timeout) throws IOException
 Gets a ContentObject matching this interest, CURRENTLY UNVERIFIED.
byte[] getData (ContentName name, PublisherPublicKeyDigest publisher, int timeout) throws IOException
 Helper method to retrieve a set of segmented content blocks and rebuild them into a single buffer.
byte[] getVersionedData (ContentName name, PublisherPublicKeyDigest publisher, int timeout) throws IOException
 Helper method to retrieve a set of segmented content blocks and rebuild them into a single buffer.
ContentObject getLower (ContentName name, int level, PublisherPublicKeyDigest publisher, long timeout) throws IOException
 Return data the specified number of levels below us in the hierarchy, with order preference of leftmost.
ArrayList< ContentObjectenumerate (Interest query, long timeout) throws IOException
 Enumerate matches below query name in the hierarchy, looking at raw content.

Static Public Member Functions

static ContentObject isContentInRepository (ContentObject availableContent, long timeout, CCNHandle handle) throws IOException
 API to determine whether a piece of content exists in the repository.
static ContentObject isContentInRepository (ContentName contentName, ContentType desiredType, byte[] desiredContentDigest, PublisherPublicKeyDigest desiredPublisher, ContentVerifier verifier, long timeout, CCNHandle handle) throws IOException
 API to determine whether a piece of content exists in the repository.
static ContentObject isVersionedContentAvailable (ContentName contentName, ContentType desiredType, byte[] desiredContentDigest, PublisherPublicKeyDigest desiredPublisher, ContentVerifier verifier, long timeout, CCNHandle handle) throws IOException
 Checks to see if the named content or its latest version is available on the network; if it is, returns its first segment as a ContentObject.
static ContentObject isAnyContentAvailable (ContentName contentPrefix, PublisherPublicKeyDigest requiredPublisher, long timeout, CCNHandle handle) throws IOException
 Is there anything available below this name that we can find in the available time? This really just wraps get, but puts a place for us to hang verification and other checks, and makes intent clear.

Protected Attributes

CCNHandle _handle

Detailed Description

Miscellaneous helper functions to read data.

Most clients will prefer the higher-level interfaces offered by CCNInputStream and its subclasses, or CCNNetworkObject and its subclasses.


Member Function Documentation

ArrayList<ContentObject> org.ccnx.ccn.io.CCNReader.enumerate ( Interest  query,
long  timeout 
) throws IOException

Enumerate matches below query name in the hierarchy, looking at raw content.

For a higher-level enumeration protocol see the name enumeration protocol. Note this method is also quite slow because it has to timeout requests at every search level

Parameters:
query an Interest defining the highest level of the query
timeout - milliseconds to wait for each individual get of data, default is 5 seconds
Returns:
a list of the content objects matching this query
Exceptions:
IOException 
ContentObject org.ccnx.ccn.io.CCNReader.get ( Interest  interest,
long  timeout 
) throws IOException

Gets a ContentObject matching this interest, CURRENTLY UNVERIFIED.

Parameters:
interest interest for desired object
timeout milliseconds to wait for data
Returns:
data matching the interest or null
Exceptions:
IOException 
ContentObject org.ccnx.ccn.io.CCNReader.get ( ContentName  name,
PublisherPublicKeyDigest  publisher,
long  timeout 
) throws IOException

Gets a ContentObject matching this name and publisher.

Parameters:
name desired name or prefix for data
publisher desired publisher or null for any publisher
timeout milliseconds to wait for data
Returns:
data matching the name and publisher or null
Exceptions:
IOException 
byte [] org.ccnx.ccn.io.CCNReader.getData ( ContentName  name,
PublisherPublicKeyDigest  publisher,
int  timeout 
) throws IOException

Helper method to retrieve a set of segmented content blocks and rebuild them into a single buffer.

Equivalent to CCNWriter's put. Does not do anything about versioning.

ContentObject org.ccnx.ccn.io.CCNReader.getLower ( ContentName  name,
int  level,
PublisherPublicKeyDigest  publisher,
long  timeout 
) throws IOException

Return data the specified number of levels below us in the hierarchy, with order preference of leftmost.

Parameters:
handle handle to use for requests
name of content to get
level number of levels below name in the hierarchy content should sit
publisher the desired publisher of this content, or null for any publisher.
timeout timeout for retrieval
Returns:
matching content, if found
Exceptions:
IOException 
byte [] org.ccnx.ccn.io.CCNReader.getVersionedData ( ContentName  name,
PublisherPublicKeyDigest  publisher,
int  timeout 
) throws IOException

Helper method to retrieve a set of segmented content blocks and rebuild them into a single buffer.

Equivalent to CCNWriter's put. Does not do anything about versioning.

static ContentObject org.ccnx.ccn.io.CCNReader.isAnyContentAvailable ( ContentName  contentPrefix,
PublisherPublicKeyDigest  requiredPublisher,
long  timeout,
CCNHandle  handle 
) throws IOException [static]

Is there anything available below this name that we can find in the available time? This really just wraps get, but puts a place for us to hang verification and other checks, and makes intent clear.

Parameters:
contentPrefix Prefix content must start with.
requiredPublisher Publisher that must have signed content, null for any.
timeout How long to wait for content. If 0, returns immediately.
handle 
static ContentObject org.ccnx.ccn.io.CCNReader.isContentInRepository ( ContentName  contentName,
ContentType  desiredType,
byte[]  desiredContentDigest,
PublisherPublicKeyDigest  desiredPublisher,
ContentVerifier  verifier,
long  timeout,
CCNHandle  handle 
) throws IOException [static]

API to determine whether a piece of content exists in the repository.

Currently uses name enumeration. Will change to alternative protocol whenever repository supports one.

Parameters:
contentName 
desiredType 
desiredContentDigest 
verifier 
timeout 
handle 
Returns:
Exceptions:
IOException 
static ContentObject org.ccnx.ccn.io.CCNReader.isContentInRepository ( ContentObject  availableContent,
long  timeout,
CCNHandle  handle 
) throws IOException [static]

API to determine whether a piece of content exists in the repository.

Currently uses name enumeration. Will change to alternative protocol whenever repository supports one.

Parameters:
availableContent 
timeout 
handle 
Returns:
Exceptions:
IOException 
static ContentObject org.ccnx.ccn.io.CCNReader.isVersionedContentAvailable ( ContentName  contentName,
ContentType  desiredType,
byte[]  desiredContentDigest,
PublisherPublicKeyDigest  desiredPublisher,
ContentVerifier  verifier,
long  timeout,
CCNHandle  handle 
) throws IOException [static]

Checks to see if the named content or its latest version is available on the network; if it is, returns its first segment as a ContentObject.

Actually should dereference links, as actual reads are done via input streams. Could remove our separate pull if we plumb content verifiers up through streams.

Parameters:
contentName 
desiredType 
desiredContentDigest 
desiredPublisher 
verifier 
timeout 
Returns:
Exceptions:
IOException 

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