Provides support for controlling repository functions beyond the basic operations for writing data from an application into a repository supported by classes in the org.ccnx.ccn.io package. More...
Static Public Member Functions | |
static boolean | localRepoSync (CCNHandle handle, CCNAbstractInputStream stream) throws IOException |
Request that a local repository preserve a copy of the exact contents of a given stream opened for reading with a given handle, and all links that were dereferenced to read the stream. | |
static boolean | localRepoSync (CCNHandle handle, CCNNetworkObject<?> obj) throws IOException |
Method to do the same as above but using CCNNetworkObjects instead of streams. | |
Static Protected Attributes | |
static Set< ContentName > | syncedObjects = Collections.synchronizedSet(new HashSet<ContentName>()) |
Temporary cache of blocks we have synced, to avoid double-syncing blocks. | |
Static Package Functions | |
static boolean | internalRepoSync (CCNHandle handle, ContentName baseName, Long startingSegmentNumber, byte[] firstDigest, ContentName fullName) throws IOException |
Provides support for controlling repository functions beyond the basic operations for writing data from an application into a repository supported by classes in the org.ccnx.ccn.io package.
static boolean org.ccnx.ccn.profiles.repo.RepositoryControl.localRepoSync | ( | CCNHandle | handle, | |
CCNNetworkObject<?> | obj | |||
) | throws IOException [static] |
Method to do the same as above but using CCNNetworkObjects instead of streams.
handle | ||
obj | ||
syncSigner |
IOException |
static boolean org.ccnx.ccn.profiles.repo.RepositoryControl.localRepoSync | ( | CCNHandle | handle, | |
CCNAbstractInputStream | stream | |||
) | throws IOException [static] |
Request that a local repository preserve a copy of the exact contents of a given stream opened for reading with a given handle, and all links that were dereferenced to read the stream.
A local repository is one connected directly to the same ccnd as the given handle; such a repository is likely to be special in the sense that it may be available to local applications even when there is no connectivity beyond the local machine. An application reading certain content that it did not originate may have reason to need that content to be available reliably as connectivity changes in the future. Since the application is not the source of the content, it need only ask the local repository to be interested in it rather than creating an output stream to write it. This method serves that purpose.
This method is experimental and the way of addressing this problem is likely to change in the future.
This method may fail (IOException) if the local repository is not already configured to support holding the data in question. For example, the repository policy might not admit the namespace in question and this method does not override such overall policy.
There may be more than one local repository but this method does not presently distinguish one if that is the case. Any one local repository that is available may be used, and at most one should be expected to respond to the request. This method should verify that a confirmation is from an acceptable local repository.
If the repository already holds the content it may confirm immediately, otherwise the repository will begin to retrieve and store the content but there is no guarantee that this is complete upon return from this method. The return value indicates whether data is already confirmed.
handle | the handle | |
stream | The stream for which the content should be preserved |
IOException | if no repository responds or another communication error occurs |