org.ccnx.ccn.impl.repo.MemoryRepoStore Class Reference

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...

List of all members.

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

Detailed Description

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. *


Member Function Documentation

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

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

Parameters:
interest Interest to match
Returns:

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

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

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.

Returns:
the version as a String

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.

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

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.

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 

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.

Parameters:
content 
Returns:
NameEnumerationResponse

Implements org.ccnx.ccn.impl.repo.RepositoryStore.


The documentation for this class was generated from the following file:
Generated on Fri May 13 16:27:40 2011 for Content-Centric Networking in Java by  doxygen 1.6.3