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< ContentObject > | enumerate (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 |
Most clients will prefer the higher-level interfaces offered by CCNInputStream and its subclasses, or CCNNetworkObject and its subclasses.
ContentObject org.ccnx.ccn.io.CCNReader.get | ( | ContentName | name, | |
PublisherPublicKeyDigest | publisher, | |||
long | timeout | |||
) | throws IOException |
Gets a ContentObject matching this name and publisher.
name | desired name or prefix for data | |
publisher | desired publisher or null for any publisher | |
timeout | milliseconds to wait for data |
IOException |
ContentObject org.ccnx.ccn.io.CCNReader.get | ( | Interest | interest, | |
long | timeout | |||
) | throws IOException |
Gets a ContentObject matching this interest, CURRENTLY UNVERIFIED.
interest | interest for desired object | |
timeout | milliseconds to wait for data |
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.
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.
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.
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 |
IOException |
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
query | an Interest defining the highest level of the query | |
timeout | - milliseconds to wait for each individual get of data, default is 5 seconds |
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.
Deprecated - instead use RepositoryControl.localRepoSync which will sync data if its not in the repository which is what we want to do if this returns false.
availableContent | ||
timeout | ||
handle |
IOException |
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.
Deprecated - instead use RepositoryControl.localRepoSync which will sync data if its not in the repository which is what we want to do if this returns false.
contentName | ||
desiredType | ||
desiredContentDigest | ||
verifier | ||
timeout | ||
handle |
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.
contentName | ||
desiredType | ||
desiredContentDigest | ||
desiredPublisher | ||
verifier | ||
timeout |
IOException |
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.
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 |