Public Member Functions | |
void | initialize (String repositoryRoot, File policyFile, String localName, String globalPrefix, String nameSpace, CCNHandle handle) throws RepositoryException |
Initialize the repository. | |
CCNHandle | getHandle () |
Get the handle the repository is using to communicate with ccnd. | |
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. | |
boolean | bulkImport (String name) throws RepositoryException |
Bulk import of data from a file. | |
ArrayList< ContentName > | getNamespace () |
Get namespace interest. | |
void | setPolicy (Policy policy) |
Set the policy with XML based policy. | |
Policy | getPolicy () |
Get the current policy. | |
RepositoryInfoObject | getRepoInfo (ContentName name, String info, ArrayList< ContentName > names) |
Get information about repository to return to write requestor, possibly with confirmation filename for sync. | |
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). | |
ContentName | getGlobalPrefix () |
Get the global prefix for this repository. | |
String | getLocalName () |
Get the local name for this repository. | |
boolean | diagnostic (String name) |
Execute diagnostic operation. | |
KeyManager | getKeyManager () |
Get the repo's key manager. | |
Object | getStatus (String type) |
Get implementation defined status. | |
void | policyUpdate () throws RepositoryException |
We can't read/write policy files until after we have started the server so this is a hook to do it at the right time. | |
Static Public Attributes | |
static final String | REPO_POLICY = "policy.xml" |
static final String | REPO_NAMESPACE = "/ccn/repository" |
static final String | REPO_DATA = "data" |
static final String | REPO_LOGGING = "repo" |
static final String | REPO_SIMPLE_STATUS_REQUEST = "simpleStatus" |
A variety of different implementations are possible; typically RepositoryStores will provide persistence of content through use of an external stable store like a filesystem. A RepositoryStore is the lower half of a full persistent Repository, the part that handles the storage, as opposed to the Repository Protocol which is implemented by a RepositoryServer.
void org.ccnx.ccn.impl.repo.RepositoryStore.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 |
Implemented in org.ccnx.ccn.impl.repo.LogStructRepoStore, org.ccnx.ccn.impl.repo.MemoryRepoStore, org.ccnx.ccn.impl.repo.RepositoryStoreBase, and org.ccnx.ccn.test.BitBucketRepository.
CCNHandle org.ccnx.ccn.impl.repo.RepositoryStore.getHandle | ( | ) |
Get the handle the repository is using to communicate with ccnd.
This encapsulates the repository's KeyManager, which determines the identity (set of keys) the repository uses to sign messages it generates. That handle couuld be created by the repository or provided in a constructor.
Implemented in org.ccnx.ccn.impl.repo.RepositoryStoreBase.
NameEnumerationResponse org.ccnx.ccn.impl.repo.RepositoryStore.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 |
Implemented in org.ccnx.ccn.impl.repo.LogStructRepoStore, org.ccnx.ccn.impl.repo.MemoryRepoStore, org.ccnx.ccn.impl.repo.RepositoryStoreBase, and org.ccnx.ccn.test.BitBucketRepository.
ContentObject org.ccnx.ccn.impl.repo.RepositoryStore.getContent | ( | Interest | interest | ) | throws RepositoryException |
Return the matching content if it exists.
interest | Interest to match |
Implemented in org.ccnx.ccn.impl.repo.LogStructRepoStore, org.ccnx.ccn.impl.repo.MemoryRepoStore, org.ccnx.ccn.impl.repo.RepositoryStoreBase, and org.ccnx.ccn.test.BitBucketRepository.
boolean org.ccnx.ccn.impl.repo.RepositoryStore.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 |
Implemented in org.ccnx.ccn.impl.repo.LogStructRepoStore, org.ccnx.ccn.impl.repo.MemoryRepoStore, and org.ccnx.ccn.test.BitBucketRepository.
boolean org.ccnx.ccn.impl.repo.RepositoryStore.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 |
Implemented in org.ccnx.ccn.impl.repo.LogStructRepoStore, org.ccnx.ccn.impl.repo.MemoryRepoStore, and org.ccnx.ccn.test.BitBucketRepository.
ArrayList<ContentName> org.ccnx.ccn.impl.repo.RepositoryStore.getNamespace | ( | ) |
Get namespace interest.
Implemented in org.ccnx.ccn.impl.repo.RepositoryStoreBase, and org.ccnx.ccn.test.BitBucketRepository.
void org.ccnx.ccn.impl.repo.RepositoryStore.setPolicy | ( | Policy | policy | ) |
Set the policy with XML based policy.
policy |
Implemented in org.ccnx.ccn.impl.repo.RepositoryStoreBase, and org.ccnx.ccn.test.BitBucketRepository.
Policy org.ccnx.ccn.impl.repo.RepositoryStore.getPolicy | ( | ) |
Get the current policy.
Implemented in org.ccnx.ccn.impl.repo.LogStructRepoStore, org.ccnx.ccn.impl.repo.RepositoryStoreBase, and org.ccnx.ccn.test.BitBucketRepository.
RepositoryInfoObject org.ccnx.ccn.impl.repo.RepositoryStore.getRepoInfo | ( | ContentName | name, | |
String | info, | |||
ArrayList< ContentName > | names | |||
) |
Get information about repository to return to write requestor, possibly with confirmation filename for sync.
name | ContentName of netobject to write back out | |
info | arbitrary String info to be returned | |
names | Names of acked data for Ack protocol (currently unused) |
Implemented in org.ccnx.ccn.impl.repo.RepositoryStoreBase.
NameEnumerationResponse org.ccnx.ccn.impl.repo.RepositoryStore.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 |
Implemented in org.ccnx.ccn.impl.repo.LogStructRepoStore, org.ccnx.ccn.impl.repo.MemoryRepoStore, org.ccnx.ccn.impl.repo.RepositoryStoreBase, and org.ccnx.ccn.test.BitBucketRepository.
boolean org.ccnx.ccn.impl.repo.RepositoryStore.diagnostic | ( | String | name | ) |
Execute diagnostic operation.
The diagnostic operations are particular to the implementation and are intended for testing and debugging only.
name | the name of the implementation-specific diagnostic operation to perform |
Implemented in org.ccnx.ccn.impl.repo.LogStructRepoStore, org.ccnx.ccn.impl.repo.RepositoryStoreBase, and org.ccnx.ccn.test.BitBucketRepository.
KeyManager org.ccnx.ccn.impl.repo.RepositoryStore.getKeyManager | ( | ) |
Get the repo's key manager.
We should sign all repo data using this keymanager
Implemented in org.ccnx.ccn.impl.repo.RepositoryStoreBase.