org.ccnx.ccn.impl.repo.RepositoryStore Interface Reference

A RepositoryStore stores ContentObjects for later retrieval by Interest and supports enumeration of names. More...

Inheritance diagram for org.ccnx.ccn.impl.repo.RepositoryStore:

org.ccnx.ccn.impl.repo.LogStructRepoStore org.ccnx.ccn.impl.repo.MemoryRepoStore org.ccnx.ccn.impl.repo.RepositoryStoreBase org.ccnx.ccn.impl.repo.LogStructRepoStore org.ccnx.ccn.impl.repo.MemoryRepoStore org.ccnx.ccn.test.BitBucketRepository

List of all members.

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< ContentNamegetNamespace ()
 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"


Detailed Description

A RepositoryStore stores ContentObjects for later retrieval by Interest and supports enumeration of names.

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.


Member Function Documentation

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.

Parameters:
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.
Exceptions:
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.

Returns:
may return null if initialize() has not yet been called.

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.

Parameters:
content 
Returns:
NameEnumerationResponse

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.

Parameters:
interest Interest to match
Returns:

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.

Parameters:
name ContentName to match exactly, including digest as final explicit component
Returns:
true if there is a ContentObject with exactly the given name, false otherwise

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

Parameters:
fileName the name of the file to import data from.
Returns:
false if reexpression for import in progress
Exceptions:
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.

Returns:

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.

Parameters:
policy 

Implemented in org.ccnx.ccn.impl.repo.RepositoryStoreBase, and org.ccnx.ccn.test.BitBucketRepository.

Policy org.ccnx.ccn.impl.repo.RepositoryStore.getPolicy (  ) 

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.

Parameters:
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)
Returns:

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

Parameters:
i NameEnumeration Interest defining which names to get
responseName 
Returns:
NameEnumerationResponse

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.

Parameters:
name the name of the implementation-specific diagnostic operation to perform
Returns:
true if diagnostic operation is supported and was performed, false otherwise

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

Returns:
the KeyManager

Implemented in org.ccnx.ccn.impl.repo.RepositoryStoreBase.


The documentation for this interface was generated from the following file:

Generated on Thu Feb 16 00:44:54 2012 for Content-Centric Networking in Java by  doxygen 1.5.6