MemoryRepoStore is a transient, in-memory store for applications that wish to provide a repo for their own content as long as they are running. More...
Classes | |
class | MemRef |
Public Member Functions | |
MemoryRepoStore (ContentName namespace) | |
String | getVersion () |
Returns the current version of the repository instance. | |
void | initialize (String repositoryRoot, File policyFile, String localName, String globalPrefix, String nameSpace, CCNHandle handle) throws RepositoryException |
Initialize the repository. | |
ContentObject | get (ContentRef ref) |
NameEnumerationResponse | saveContent (ContentObject content) throws RepositoryException |
Save the specified content in the repository. | |
ContentObject | getContent (Interest interest) throws RepositoryException |
Return the matching content if it exists. | |
boolean | hasContent (ContentName name) throws RepositoryException |
Check for content matching the given name, without retrieving the content itself. | |
NameEnumerationResponse | getNamesWithPrefix (Interest i, ContentName responseName) |
Get names to respond to name enumeration requests. | |
void | shutDown () |
Hook to shutdown the store (close files for example). | |
Object | getStatus (String type) |
Get implementation defined status. | |
boolean | bulkImport (String name) throws RepositoryException |
Bulk import of data from a file. | |
Static Public Attributes | |
static final String | CURRENT_VERSION = "1.0" |
Protected Attributes | |
ContentTree | _index |
ContentName | _namespace = null |
MemoryRepoStore is a transient, in-memory store for applications that wish to provide a repo for their own content as long as they are running.
Given that it is transient, this implementation breaks the usual convention that a repository provides persistent storage. *
boolean org.ccnx.ccn.impl.repo.MemoryRepoStore.bulkImport | ( | String | name | ) | throws RepositoryException |
Bulk import of data from a file.
Data must be in a format compatible with the repository store. This would normally mean wire format
fileName | the name of the file to import data from. |
RepositoryException |
Implements org.ccnx.ccn.impl.repo.RepositoryStore.
ContentObject org.ccnx.ccn.impl.repo.MemoryRepoStore.getContent | ( | Interest | interest | ) | throws RepositoryException |
Return the matching content if it exists.
interest | Interest to match |
Implements org.ccnx.ccn.impl.repo.RepositoryStore.
NameEnumerationResponse org.ccnx.ccn.impl.repo.MemoryRepoStore.getNamesWithPrefix | ( | Interest | i, | |
ContentName | responseName | |||
) |
Get names to respond to name enumeration requests.
Returns null if there is nothing after the prefix or if there is nothing new after the prefix if there is a version on the incoming interest
i | NameEnumeration Interest defining which names to get | |
responseName |
Implements org.ccnx.ccn.impl.repo.RepositoryStore.
String org.ccnx.ccn.impl.repo.MemoryRepoStore.getVersion | ( | ) | [virtual] |
Returns the current version of the repository instance.
Subclasses must implement this method to report their version for returning repository information.
Implements org.ccnx.ccn.impl.repo.RepositoryStoreBase.
boolean org.ccnx.ccn.impl.repo.MemoryRepoStore.hasContent | ( | ContentName | name | ) | throws RepositoryException |
Check for content matching the given name, without retrieving the content itself.
name | ContentName to match exactly, including digest as final explicit component |
Implements org.ccnx.ccn.impl.repo.RepositoryStore.
void org.ccnx.ccn.impl.repo.MemoryRepoStore.initialize | ( | String | repositoryRoot, | |
File | policyFile, | |||
String | localName, | |||
String | globalPrefix, | |||
String | nameSpace, | |||
CCNHandle | handle | |||
) | throws RepositoryException |
Initialize the repository.
repositoryRoot | ||
policyFile | policy file to use or null | |
localName | may be null | |
globalPrefix | may be null | |
nameSpace | initial namespace for repository | |
handle | optional CCNHandle if caller wants to override the default connection/identity behavior of the repository -- this provides a KeyManager and handle for the repository to use to obtain its keys and communicate with ccnd. If null, the repository will configure its own based on policy, or if none, create one using the executing user's defaults. |
RepositoryException |
Implements org.ccnx.ccn.impl.repo.RepositoryStore.
NameEnumerationResponse org.ccnx.ccn.impl.repo.MemoryRepoStore.saveContent | ( | ContentObject | content | ) | throws RepositoryException |
Save the specified content in the repository.
If content is added to a name that has been the subject of a name enumeration request without a newer version at that time, the save will trigger a response to avoid forcing the enumerating node to wait for an Interest timeout to ask again.
content |
Implements org.ccnx.ccn.impl.repo.RepositoryStore.