Provide the generic policy-handling features of a RepositoryStore to simplify implementation of subclasses for different storage systems. More...
Public Member Functions | |
boolean | diagnostic (String name) |
Handle diagnostic requests. | |
abstract ContentObject | getContent (Interest interest) throws RepositoryException |
Return the matching content if it exists. | |
abstract NameEnumerationResponse | getNamesWithPrefix (Interest i, ContentName responseName) |
Get names to respond to name enumeration requests. | |
CCNHandle | getHandle () |
KeyManager | getKeyManager () |
Get the repo's key manager. | |
ArrayList< ContentName > | getNamespace () |
Gets the currently valid namespace for this repository. | |
Policy | getPolicy () |
Gets the current policy for this repository. | |
abstract String | getVersion () |
Returns the current version of the repository instance. | |
RepositoryInfoObject | getRepoInfo (ContentName name, String info, ArrayList< ContentName > names) |
Gets current repository information to be used as content in a ContentObject. | |
abstract void | initialize (String repositoryRoot, File policyFile, String localName, String globalPrefix, String nameSpace, CCNHandle handle) throws RepositoryException |
Initialize a repository. | |
PolicyXML | startInitPolicy (File policyFile, String nameSpace) throws RepositoryException |
Initialize internal policy state, from file if policyFile != null This method is intended to be called at the beginning of a subclass initialize() method to handle the generic policy setup, after which the subclass initialize() should adjust policy (including calling readPolicy) as appropriate. | |
void | readPolicy (String localName, KeyManager km) throws RepositoryException, ContentDecodingException |
Read policy from persistent storage under standard naming convention. | |
void | finishInitPolicy (String globalPrefix, String localName) throws MalformedContentNameStringException |
Complete policy initialization, to be called after subclass has adjusted policy state based on persistent stored records. | |
abstract NameEnumerationResponse | saveContent (ContentObject content) throws RepositoryException |
Save the specified content in the repository. | |
void | setPolicy (Policy policy) |
Set the policy with XML based policy. | |
ContentName | getGlobalPrefix () |
Get the global prefix for this repository. | |
String | getLocalName () |
Get the local name for this repository. | |
void | shutDown () |
Hook to shutdown the store (close files for example). | |
Protected Attributes | |
Policy | _policy = null |
RepositoryInfo | _info = null |
CCNHandle | _handle = null |
KeyManager | _km = null |
Provide the generic policy-handling features of a RepositoryStore to simplify implementation of subclasses for different storage systems.
boolean org.ccnx.ccn.impl.repo.RepositoryStoreBase.diagnostic | ( | String | name | ) |
Handle diagnostic requests.
Implements org.ccnx.ccn.impl.repo.RepositoryStore.
Reimplemented in org.ccnx.ccn.impl.repo.LogStructRepoStore, and org.ccnx.ccn.test.BitBucketRepository.
void org.ccnx.ccn.impl.repo.RepositoryStoreBase.finishInitPolicy | ( | String | globalPrefix, | |
String | localName | |||
) | throws MalformedContentNameStringException |
Complete policy initialization, to be called after subclass has adjusted policy state based on persistent stored records.
MalformedContentNameStringException |
abstract ContentObject org.ccnx.ccn.impl.repo.RepositoryStoreBase.getContent | ( | Interest | interest | ) | throws RepositoryException [pure virtual] |
Return the matching content if it exists.
interest | Interest to match |
Implements org.ccnx.ccn.impl.repo.RepositoryStore.
Implemented in org.ccnx.ccn.impl.repo.LogStructRepoStore, org.ccnx.ccn.impl.repo.MemoryRepoStore, and org.ccnx.ccn.test.BitBucketRepository.
CCNHandle org.ccnx.ccn.impl.repo.RepositoryStoreBase.getHandle | ( | ) |
Implements org.ccnx.ccn.impl.repo.RepositoryStore.
KeyManager org.ccnx.ccn.impl.repo.RepositoryStoreBase.getKeyManager | ( | ) |
Get the repo's key manager.
We should sign all repo data using this keymanager
Implements org.ccnx.ccn.impl.repo.RepositoryStore.
ArrayList<ContentName> org.ccnx.ccn.impl.repo.RepositoryStoreBase.getNamespace | ( | ) |
Gets the currently valid namespace for this repository.
Implements org.ccnx.ccn.impl.repo.RepositoryStore.
Reimplemented in org.ccnx.ccn.test.BitBucketRepository.
abstract NameEnumerationResponse org.ccnx.ccn.impl.repo.RepositoryStoreBase.getNamesWithPrefix | ( | Interest | i, | |
ContentName | responseName | |||
) | [pure virtual] |
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.
Implemented in org.ccnx.ccn.impl.repo.LogStructRepoStore, org.ccnx.ccn.impl.repo.MemoryRepoStore, and org.ccnx.ccn.test.BitBucketRepository.
RepositoryInfoObject org.ccnx.ccn.impl.repo.RepositoryStoreBase.getRepoInfo | ( | ContentName | name, | |
String | info, | |||
ArrayList< ContentName > | names | |||
) |
Gets current repository information to be used as content in a ContentObject.
names | intended for nonimplemented repository ACK protocol - currently unused |
Implements org.ccnx.ccn.impl.repo.RepositoryStore.
abstract String org.ccnx.ccn.impl.repo.RepositoryStoreBase.getVersion | ( | ) | [pure virtual] |
Returns the current version of the repository instance.
Subclasses must implement this method to report their version for returning repository information.
Implemented in org.ccnx.ccn.impl.repo.LogStructRepoStore, org.ccnx.ccn.impl.repo.MemoryRepoStore, and org.ccnx.ccn.test.BitBucketRepository.
void org.ccnx.ccn.impl.repo.RepositoryStoreBase.readPolicy | ( | String | localName, | |
KeyManager | km | |||
) | throws RepositoryException, ContentDecodingException |
Read policy from persistent storage under standard naming convention.
This method may be called optionally during initialization by a subclass after it is initialized enough to process getContent() calls
localName |
RepositoryException | ||
ContentDecodingException |
abstract NameEnumerationResponse org.ccnx.ccn.impl.repo.RepositoryStoreBase.saveContent | ( | ContentObject | content | ) | throws RepositoryException [pure virtual] |
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.
Implemented in org.ccnx.ccn.impl.repo.LogStructRepoStore, org.ccnx.ccn.impl.repo.MemoryRepoStore, and org.ccnx.ccn.test.BitBucketRepository.
void org.ccnx.ccn.impl.repo.RepositoryStoreBase.setPolicy | ( | Policy | policy | ) |
Set the policy with XML based policy.
policy |
Implements org.ccnx.ccn.impl.repo.RepositoryStore.
Reimplemented in org.ccnx.ccn.test.BitBucketRepository.
PolicyXML org.ccnx.ccn.impl.repo.RepositoryStoreBase.startInitPolicy | ( | File | policyFile, | |
String | nameSpace | |||
) | throws RepositoryException |
Initialize internal policy state, from file if policyFile != null This method is intended to be called at the beginning of a subclass initialize() method to handle the generic policy setup, after which the subclass initialize() should adjust policy (including calling readPolicy) as appropriate.
If both "policy file" and "initial namespace" are non-null the policy file takes precedence
policyFile | policy file | |
initial | namespace |
RepositoryException | ||
FileNotFoundException | ||
ContentDecodingException | ||
MalformedContentNameStringException |