org.ccnx.ccn.io.CCNVersionedInputStream Class Reference

A CCNInputStream that reads and writes versioned streams. More...

Inheritance diagram for org.ccnx.ccn.io.CCNVersionedInputStream:

org.ccnx.ccn.io.CCNInputStream org.ccnx.ccn.io.CCNAbstractInputStream org.ccnx.ccn.CCNContentHandler org.ccnx.ccn.io.CCNFileInputStream

List of all members.

Public Member Functions

 CCNVersionedInputStream (ContentName baseName) throws IOException
 Set up an input stream to read segmented CCN content under a given versioned name.
 CCNVersionedInputStream (ContentName baseName, CCNHandle handle) throws IOException
 Set up an input stream to read segmented CCN content under a given versioned name.
 CCNVersionedInputStream (ContentName baseName, PublisherPublicKeyDigest publisher, CCNHandle handle) throws IOException
 Set up an input stream to read segmented CCN content under a given versioned name.
 CCNVersionedInputStream (ContentName baseName, Long startingSegmentNumber, CCNHandle handle) throws IOException
 Set up an input stream to read segmented CCN content under a given versioned name.
 CCNVersionedInputStream (ContentName baseName, Long startingSegmentNumber, PublisherPublicKeyDigest publisher, CCNHandle handle) throws IOException
 Set up an input stream to read segmented CCN content under a given versioned name.
 CCNVersionedInputStream (ContentName baseName, Long startingSegmentNumber, PublisherPublicKeyDigest publisher, ContentKeys keys, CCNHandle handle) throws IOException
 Set up an input stream to read segmented CCN content under a given versioned name.
 CCNVersionedInputStream (ContentObject startingSegment, EnumSet< FlagTypes > flags, CCNHandle handle) throws IOException
 Set up an input stream to read segmented CCN content starting with a given ContentObject that has already been retrieved.
 CCNVersionedInputStream (ContentObject startingSegment, ContentKeys keys, EnumSet< FlagTypes > flags, CCNHandle handle) throws IOException
 Set up an input stream to read segmented CCN content starting with a given ContentObject that has already been retrieved.
ContentObject getFirstSegment () throws IOException
 Implementation of getFirstSegment() that expects segments to be versioned.
CCNTime getVersionAsTimestamp () throws VersionMissingException
 Convenience method.

Protected Member Functions

boolean isFirstSegment (ContentName desiredName, ContentObject potentialFirstSegment)
 Determines whether a given content object is the first block of the versioned stream specified.


Detailed Description

A CCNInputStream that reads and writes versioned streams.

Names are versioned using the VersioningProfile. If you ask to open a name that is already versioned, it opens that version for you. If you ask to open a name without a version, it attempts to open the latest version of that name. If you attempt to open a name with a segment marker on it as well, it opens that version of that content at that segment.

The only behavior we have to change from superclass is that involved in getting the first segment -- header or regular segment. We need to make an interest that gets the latest version, and then fills in the version information on the name we are working with, to make sure we continue to get blocks from the same version (even if, say someone writes another version on top of us).


Constructor & Destructor Documentation

org.ccnx.ccn.io.CCNVersionedInputStream.CCNVersionedInputStream ( ContentName  baseName  )  throws IOException

Set up an input stream to read segmented CCN content under a given versioned name.

Content is assumed to be unencrypted, or keys will be retrieved automatically via another process. Will use the default handle given by CCNHandle.getHandle(). Note that this constructor does not currently retrieve any data; data is not retrieved until read() is called. This will change in the future, and this constructor will retrieve the first block.

Parameters:
baseName Name to read from. If it ends with a version, will retrieve that specific version. If not, will find the latest version available. If it ends with both a version and a segment number, will start to read from that segment of that version.
Exceptions:
IOException Not currently thrown, will be thrown when constructors retrieve first block.

org.ccnx.ccn.io.CCNVersionedInputStream.CCNVersionedInputStream ( ContentName  baseName,
CCNHandle  handle 
) throws IOException

Set up an input stream to read segmented CCN content under a given versioned name.

Content is assumed to be unencrypted, or keys will be retrieved automatically via another process. Will use the default handle given by CCNHandle.getHandle(). Note that this constructor does not currently retrieve any data; data is not retrieved until read() is called. This will change in the future, and this constructor will retrieve the first block.

Parameters:
baseName Name to read from. If it ends with a version, will retrieve that specific version. If not, will find the latest version available. If it ends with both a version and a segment number, will start to read from that segment of that version.
handle The CCN handle to use for data retrieval. If null, the default handle given by CCNHandle.getHandle() will be used.
Exceptions:
IOException Not currently thrown, will be thrown when constructors retrieve first block.

org.ccnx.ccn.io.CCNVersionedInputStream.CCNVersionedInputStream ( ContentName  baseName,
PublisherPublicKeyDigest  publisher,
CCNHandle  handle 
) throws IOException

Set up an input stream to read segmented CCN content under a given versioned name.

Content is assumed to be unencrypted, or keys will be retrieved automatically via another process. Will use the default handle given by CCNHandle.getHandle(). Note that this constructor does not currently retrieve any data; data is not retrieved until read() is called. This will change in the future, and this constructor will retrieve the first block.

Parameters:
baseName Name to read from. If it ends with a version, will retrieve that specific version. If not, will find the latest version available. If it ends with both a version and a segment number, will start to read from that segment of that version.
publisher The key we require to have signed this content. If null, will accept any publisher (subject to higher-level verification).
handle The CCN handle to use for data retrieval. If null, the default handle given by CCNHandle.getHandle() will be used.
Exceptions:
IOException Not currently thrown, will be thrown when constructors retrieve first block.

org.ccnx.ccn.io.CCNVersionedInputStream.CCNVersionedInputStream ( ContentName  baseName,
Long  startingSegmentNumber,
CCNHandle  handle 
) throws IOException

Set up an input stream to read segmented CCN content under a given versioned name.

Content is assumed to be unencrypted, or keys will be retrieved automatically via another process. Will use the default handle given by CCNHandle.getHandle(). Note that this constructor does not currently retrieve any data; data is not retrieved until read() is called. This will change in the future, and this constructor will retrieve the first block.

Parameters:
baseName Name to read from. If it ends with a version, will retrieve that specific version. If not, will find the latest version available. If it ends with both a version and a segment number, will start to read from that segment of that version.
startingSegmentNumber Alternative specification of starting segment number. If null, will be SegmentationProfile.baseSegment().
handle The CCN handle to use for data retrieval. If null, the default handle given by CCNHandle.getHandle() will be used.
Exceptions:
IOException Not currently thrown, will be thrown when constructors retrieve first block.

org.ccnx.ccn.io.CCNVersionedInputStream.CCNVersionedInputStream ( ContentName  baseName,
Long  startingSegmentNumber,
PublisherPublicKeyDigest  publisher,
CCNHandle  handle 
) throws IOException

Set up an input stream to read segmented CCN content under a given versioned name.

Content is assumed to be unencrypted, or keys will be retrieved automatically via another process. Will use the default handle given by CCNHandle.getHandle(). Note that this constructor does not currently retrieve any data; data is not retrieved until read() is called. This will change in the future, and this constructor will retrieve the first block.

Parameters:
baseName Name to read from. If it ends with a version, will retrieve that specific version. If not, will find the latest version available. If it ends with both a version and a segment number, will start to read from that segment of that version.
startingSegmentNumber Alternative specification of starting segment number. If null, will beSegmentationProfile.baseSegment().
publisher The key we require to have signed this content. If null, will accept any publisher (subject to higher-level verification).
handle The CCN handle to use for data retrieval. If null, the default handle given by CCNHandle.getHandle() will be used.
Exceptions:
IOException Not currently thrown, will be thrown when constructors retrieve first block.

org.ccnx.ccn.io.CCNVersionedInputStream.CCNVersionedInputStream ( ContentName  baseName,
Long  startingSegmentNumber,
PublisherPublicKeyDigest  publisher,
ContentKeys  keys,
CCNHandle  handle 
) throws IOException

Set up an input stream to read segmented CCN content under a given versioned name.

Will use the default handle given by CCNHandle.getHandle(). Note that this constructor does not currently retrieve any data; data is not retrieved until read() is called. This will change in the future, and this constructor will retrieve the first block.

Parameters:
baseName Name to read from. If it ends with a version, will retrieve that specific version. If not, will find the latest version available. If it ends with both a version and a segment number, will start to read from that segment of that version.
startingSegmentNumber Alternative specification of starting segment number. If null, will be SegmentationProfile.baseSegment().
publisher The key we require to have signed this content. If null, will accept any publisher (subject to higher-level verification).
keys The keys to use to decrypt this content. If null, assumes content unencrypted, or another process will be used to retrieve the keys.
handle The CCN handle to use for data retrieval. If null, the default handle given by CCNHandle.getHandle() will be used.
Exceptions:
IOException Not currently thrown, will be thrown when constructors retrieve first block.

org.ccnx.ccn.io.CCNVersionedInputStream.CCNVersionedInputStream ( ContentObject  startingSegment,
EnumSet< FlagTypes >  flags,
CCNHandle  handle 
) throws IOException

Set up an input stream to read segmented CCN content starting with a given ContentObject that has already been retrieved.

Content is assumed to be unencrypted, or keys will be retrieved automatically via another process.

Parameters:
startingSegment The first segment to read from. If this is not the first segment of the stream, reading will begin from this point. We assume that the signature on this segment was verified by our caller.
flags any stream flags that must be set to handle even this first block (otherwise they can be set with setFlags prior to read). Can be null.
handle The CCN handle to use for data retrieval. If null, the default handle given by CCNHandle.getHandle() will be used.
Exceptions:
IOException if startingSegment does not contain a valid segment ID

org.ccnx.ccn.io.CCNVersionedInputStream.CCNVersionedInputStream ( ContentObject  startingSegment,
ContentKeys  keys,
EnumSet< FlagTypes >  flags,
CCNHandle  handle 
) throws IOException

Set up an input stream to read segmented CCN content starting with a given ContentObject that has already been retrieved.

Parameters:
startingSegment The first segment to read from. If this is not the first segment of the stream, reading will begin from this point. We assume that the signature on this segment was verified by our caller.
keys The keys to use to decrypt this content. Null if content unencrypted, or another process will be used to retrieve the keys.
flags any stream flags that must be set to handle even this first block (otherwise they can be set with setFlags prior to read). Can be null.
handle The CCN handle to use for data retrieval. If null, the default handle given by CCNHandle.getHandle() will be used.
Exceptions:
IOException if startingSegment does not contain a valid segment ID


Member Function Documentation

ContentObject org.ccnx.ccn.io.CCNVersionedInputStream.getFirstSegment (  )  throws IOException

Implementation of getFirstSegment() that expects segments to be versioned.

If a version (and optionally a segment) is specified in the name, gets that specific version (and segment). Otherwise, gets the latest version available. Uses VersioningProfile.getFirstBlockOfLatestVersion(ContentName, Long, PublisherPublicKeyDigest, long, org.ccnx.ccn.ContentVerifier, CCNHandle).

Exceptions:
IOException If no block found (NoMatchingContentFoundException}), or there is an error retrieving the block.

Reimplemented from org.ccnx.ccn.io.CCNAbstractInputStream.

Reimplemented in org.ccnx.ccn.io.CCNFileInputStream.

CCNTime org.ccnx.ccn.io.CCNVersionedInputStream.getVersionAsTimestamp (  )  throws VersionMissingException

Convenience method.

Returns:
The version of this content as a CCNTime.
Exceptions:
VersionMissingException If we do not yet have a versioned content name.


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

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