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

High level implementation of repository protocol that can be used by any application to provide repository service. More...

List of all members.

Classes

class  InterestTimer

Public Types

enum  StatsEnum {
  HandleInterest = ("interests", "Number of calls to RepositoryInterestHandler.handleInterest()"), HandleInterestErrors = ("errors", "Errors in handleInterest()"), HandleInterestCommands = ("interests", "Number of command interests to handleInterest()"), HandleInterestStartWriteReceived = ("interests", "Number of start writes to handleInterest()"),
  HandleInterestStartWriteProcessed = ("interests", "Number of start writes processed by handleInterest()"), HandleInterestStartWriteIgnored = ("interests", "Number of start writes ignored in handleInterest()"), HandleInterestStartWriteErrors = ("errors", "Error count in startWrite()"), HandleInterestNameEnumReceived = ("interests", "Number of name enums to handleInterest()"),
  HandleInterestNameEnumProcessed = ("interests", "Number of name enums processed in handleInterest()"), HandleInterestNameEnumIgnored = ("interests", "Number of name enums ignored in handleInterest()"), HandleInterestCheckedWriteReceived = ("interests", "Number of checked write to handleInterest()"), HandleInterestCheckedWriteProcessed = ("interests", "Number of checked write processed in handleInterest()"),
  HandleInterestCheckedWriteIgnored = ("interests", "Number of checked write ignored in handleInterest()"), HandleInterestBulkImportReceived = ("interests", "Number of bulk imports to handleInterest()"), HandleInterestBulkImportProcessed = ("interests", "Number of bulk imports processed in handleInterest()"), HandleInterestBulkImportIgnored = ("interests", "Number of bulk imports ignored in handleInterest()"),
  HandleInterestUncategorized = ("interests", "Number of uncategorized interests to handleInterest()"), HandleInterestDuplicateRequests = ("interests", "Number of duplicate interests to handleInterest()"), HandleInterestWriteSuspended = ("interests", "Number of write suspended interests to handleInterest()"), HandleInterestStartWritePolicyHandlers = ("responses", "Number of RepositoryPolicyHandler created for StartWrite"),
  HandleInterestStartWriteExpressInterest = ("responses", "Number of expressInterests created for StartWrite"), HandleInterestNameEnumResponses = ("responses", "Number of responses sent for Name Enums"), HandleContent = ("objects", "Calls to ResponsitoryDataListener.handleContent()"), HandleContentHandleData = ("objects", "Calls to handleData in RepositoryDataListener"),
  HandleContentExpressInterest = ("interests", "Number of interests expressed in handleContent()"), HandleContentCancelInterest = ("interests", "Number of interests cancelled"), HandleContentExpressInterestErrors = ("errors", "Number of errors expressing interests in handleContent()")
}

Public Member Functions

 RepositoryServer (RepositoryStore repo) throws IOException
 Constructor.
void start ()
 Start serving requests from the network.
void shutDown ()
 Stop serving requests.
void resetNameSpaceFromHandler () throws IOException
 In general we need to wait until all sessions are complete before making a namespace change because it involves changing the filter which could cut off current sessions in process.
CCNHandle getHandle ()
RepositoryStore getRepository ()
Exclude getExcludes ()
CCNWriter getWriter ()
ArrayList< RepositoryDataListenergetDataListeners ()
ArrayList< ContentNamegetFilters ()
void addListener (RepositoryDataListener listener)
boolean getPendingNameSpaceState ()
RepositoryDataHandler getDataHandler ()
int getWindowSize ()
int getFreshness ()
ContentName getResponseName ()
void sendEnumerationResponse (NameEnumerationResponse ner)
 Method to write out name enumeration responses.
ContentName getKeyTarget (ContentName target)
 Look for unverified keys.
ContentName getKeyTargetFromObject (ContentObject content, ContentName target) throws RepositoryException
 Look for unverified keys based on content object.
ContentName getLinkedKeyTarget (ContentObject co) throws RepositoryException
 Check whether co is a link and if so find any unsynced link target which is chained to it.
void doSync (Interest interest, Interest readInterest) throws IOException
Object getStatus (String type)
CCNStats getStats ()

Static Public Attributes

static final int PERIOD = 2000
static final int THREAD_LIFE = 8
static final int FRESHNESS = 4

Protected Attributes

Timer _periodicTimer = null
RepositoryInterestHandler _iHandler = null
CCNEnumStats< StatsEnum > _stats = new CCNEnumStats<StatsEnum>(StatsEnum.HandleInterest)

Detailed Description

High level implementation of repository protocol that can be used by any application to provide repository service.

The application must supply a RepositoryStore instance to take care of actual storage and retrieval, which might use persistent storage or application data structures.

Some notes: We use a policy file to decide which namespaces to save. The policy file is currently parsed within the lower level.

We can't just express an interest in anything that's within the namespaces that we want to save within, because we will keep getting back the same content over and over again if we do that. Instead the clients trigger a write to the repository by expressing an interest in contentName + "write_marker" (CCNBase.REPO_START_WRITE). When we see this we write back some information then express an interest in the contentName without the "write_marker" to get the initial block, then express interest in blocks after the initial block for this particular write.


Constructor & Destructor Documentation

org.ccnx.ccn.impl.repo.RepositoryServer.RepositoryServer ( RepositoryStore  repo  )  throws IOException

Constructor.

Note that merely creating an instance does not begin service of requests from the network. For that you must call start().

Parameters:
repo the RepositoryStore instance to use for backing storage. The RepositoryServer uses repo.getHandle() to get the handle to use for communication, to make sure that it is sending messages under the identity of the repo.
Exceptions:
IOException 

Member Function Documentation

ContentName org.ccnx.ccn.impl.repo.RepositoryServer.getKeyTarget ( ContentName  target  ) 

Look for unverified keys.

Note that we must have already checked to see that the repo has the content for this target before calling this.

Parameters:
target 
Returns:
new target if we need to verify the target
ContentName org.ccnx.ccn.impl.repo.RepositoryServer.getKeyTargetFromObject ( ContentObject  content,
ContentName  target 
) throws RepositoryException

Look for unverified keys based on content object.

Parameters:
content 
target 
Returns:
Exceptions:
RepositoryException 
ContentName org.ccnx.ccn.impl.repo.RepositoryServer.getLinkedKeyTarget ( ContentObject  co  )  throws RepositoryException

Check whether co is a link and if so find any unsynced link target which is chained to it.

Parameters:
co the ContentObject to test
Returns:
null if no unresolved target, ContentName of unresolved target otherwise
Exceptions:
RepositoryException 
void org.ccnx.ccn.impl.repo.RepositoryServer.resetNameSpaceFromHandler (  )  throws IOException

In general we need to wait until all sessions are complete before making a namespace change because it involves changing the filter which could cut off current sessions in process.

Exceptions:
IOException 
void org.ccnx.ccn.impl.repo.RepositoryServer.sendEnumerationResponse ( NameEnumerationResponse  ner  ) 

Method to write out name enumeration responses.

This is called directly to respond to incoming name enumeration interests and can also be called when a content object is saved in the repo and the interest flag is set by a previous name enumeration interest where there was not new information available.

Parameters:
ner NameEnumerationResponse object to send out
Returns:
void

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