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

Provide the generic policy-handling features of a RepositoryStore to simplify implementation of subclasses for different storage systems. More...

List of all members.

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

Detailed Description

Provide the generic policy-handling features of a RepositoryStore to simplify implementation of subclasses for different storage systems.


Member Function Documentation

boolean org.ccnx.ccn.impl.repo.RepositoryStoreBase.diagnostic ( String  name  ) 

Handle diagnostic requests.

Returns:
true if request recognized and carried out

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.

Exceptions:
MalformedContentNameStringException 
abstract ContentObject org.ccnx.ccn.impl.repo.RepositoryStoreBase.getContent ( Interest  interest  )  throws RepositoryException [pure virtual]

Return the matching content if it exists.

Parameters:
interest Interest to match
Returns:

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 (  ) 
Returns:
returns null prior to calls to initialize()

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

Returns:
the 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.

Returns:
the namespace as an ArrayList of ContentNames containing prefixes of valid namespaces

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

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

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.

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

Returns:
the version as a String

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

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

Parameters:
content 
Returns:
NameEnumerationResponse

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.

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

Parameters:
policyFile policy file
initial namespace
Exceptions:
RepositoryException 
FileNotFoundException 
ContentDecodingException 
MalformedContentNameStringException 

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