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

Implements a log-structured RepositoryStore on a filesystem using sequential data files with an index for queries. More...

List of all members.

Classes

class  FileRef
class  LogStructRepoStoreProfile
class  RepoFile

Public Member Functions

ContentObject getContent (Interest interest) throws RepositoryException
 Gets content matching the given interest.
boolean hasContent (ContentName name) throws RepositoryException
 Check for content matching the given name, without retrieving the content itself.
NameEnumerationResponse getNamesWithPrefix (Interest i, ContentName responseName)
 Gets all names matching the given NameEnumeration interest.
Policy getPolicy ()
 Gets the current policy for this repository.
String getVersion ()
 Gets the current version of this RepositoryStore.
void initialize (String repositoryRoot, File policyFile, String localName, String globalPrefix, String namespace, CCNHandle handle) throws RepositoryException
 Initialize the repository.
NameEnumerationResponse saveContent (ContentObject content) throws RepositoryException
 Save the given content in the repository store.
ContentObject get (ContentRef ref)
 Get content for the given reference from the storage files.
boolean diagnostic (String name)
 Dump all names of data stored in the repository into a special file within the repository on diagnostic request from higher level code.
void shutDown ()
 Cleanup on shutdown.
Object getStatus (String type)
 Get implementation defined status.
synchronized boolean bulkImport (String name) throws RepositoryException
 Bulk import of data from a file.

Static Public Attributes

static final String CURRENT_VERSION = "1.4"

Protected Member Functions

Integer createIndex ()
 Read the current repository file(s) for this repository and create an index for them.
void dumpNames (int nodelen)

Protected Attributes

String _repositoryRoot = null
String _repositoryMeta = null
File _repositoryFile
HashMap< String, String > _bulkImportInProgress = new HashMap<String, String>()

Package Attributes

Map< Integer, RepoFile_files
RepoFile _activeWriteFile = null
Integer _currentFileIndex = 0
ContentTree _index

Detailed Description

Implements a log-structured RepositoryStore on a filesystem using sequential data files with an index for queries.


Member Function Documentation

synchronized boolean org.ccnx.ccn.impl.repo.LogStructRepoStore.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.

Integer org.ccnx.ccn.impl.repo.LogStructRepoStore.createIndex (  )  [protected]

Read the current repository file(s) for this repository and create an index for them.

WARNING: multiple files are not well tested

Returns:
the number of files making up the repository
boolean org.ccnx.ccn.impl.repo.LogStructRepoStore.diagnostic ( String  name  ) 

Dump all names of data stored in the repository into a special file within the repository on diagnostic request from higher level code.

Parameters:
name "nametree" or "nametreewide" to decide whether to limit the printout length of components

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

ContentObject org.ccnx.ccn.impl.repo.LogStructRepoStore.get ( ContentRef  ref  ) 

Get content for the given reference from the storage files.

Used to retrieve content for comparison operations.

Parameters:
ref the reference
Returns:
ContentObject at the referenced slot in the storage files

Implements org.ccnx.ccn.impl.repo.ContentTree.ContentGetter.

ContentObject org.ccnx.ccn.impl.repo.LogStructRepoStore.getContent ( Interest  interest  )  throws RepositoryException

Gets content matching the given interest.

Parameters:
interest the given interest
Returns:
the closest matching ContentObject or null if no match

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

NameEnumerationResponse org.ccnx.ccn.impl.repo.LogStructRepoStore.getNamesWithPrefix ( Interest  i,
ContentName  responseName 
)

Gets all names matching the given NameEnumeration interest.

Parameters:
i the interest
Returns:
the data as a NameEnumerationResponse

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

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

Gets the current policy for this repository.

Returns:
the policy

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

String org.ccnx.ccn.impl.repo.LogStructRepoStore.getVersion (  )  [virtual]

Gets the current version of this RepositoryStore.

Returns:
the version as a String

Implements org.ccnx.ccn.impl.repo.RepositoryStoreBase.

boolean org.ccnx.ccn.impl.repo.LogStructRepoStore.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.LogStructRepoStore.initialize ( String  repositoryRoot,
File  policyFile,
String  localName,
String  globalPrefix,
String  namespace,
CCNHandle  handle 
) throws RepositoryException

Initialize the repository.

Parameters:
repositoryRoot the directory containing the files to store a repository. A new directory is created if this doesn't yet exist
policyFile a file containing policy data to define the initial repository policy (see BasicPolicy)
localName the local name for this repository as a slash separated String (defaults if null)
globalPrefix the global prefix for this repository as a slash separated String (defaults if null)
An initial namespace (defaults to namespace stored in repository, or / if none)
Exceptions:
RepositoryException if the policyFile, localName, or globalName are improperly formatted
Parameters:
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.

Try to read policy from storage if we don't have full policy source yet

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

NameEnumerationResponse org.ccnx.ccn.impl.repo.LogStructRepoStore.saveContent ( ContentObject  content  )  throws RepositoryException

Save the given content in the repository store.

Parameters:
content the content to save
Exceptions:
RepositoryException it the content can not be written or encoded
Returns:
NameEnumerationResponse if this satisfies an outstanding NameEnumeration request

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