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

Handle repo specialty start/end protocol. More...

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

org.ccnx.ccn.impl.CCNFlowControl org.ccnx.ccn.CCNContentHandler org.ccnx.ccn.CCNInterestHandler

List of all members.

Public Member Functions

Interest handleContent (ContentObject co, Interest interest)
 Handles packets received from the repository after the start write request.
 RepositoryFlowControl (CCNHandle handle) throws IOException
 RepositoryFlowControl (CCNHandle handle, boolean local) throws IOException
 constructor to allow the repo flow controller to set the scope for the start write interest
 RepositoryFlowControl (ContentName name, CCNHandle handle) throws IOException
 RepositoryFlowControl (ContentName name, CCNHandle handle, boolean local) throws IOException
 RepositoryFlowControl (ContentName name, CCNHandle handle, Shape shape) throws IOException
 RepositoryFlowControl (ContentName name, CCNHandle handle, Shape shape, boolean local) throws IOException
void startWrite (ContentName name, Shape shape) throws IOException
 Send out a start write request to any listening repositories and wait for a response.
void afterClose () throws IOException
 Called after close has completed a flush.
void cancelInterests ()
 Cancel any outstanding interests on close.
SaveType saveType ()
 Help users determine what type of flow controller this is.

Protected Attributes

HashSet< Interest_writeInterests = new HashSet<Interest>()
boolean localRepo = true
Queue< Client_clients = new ConcurrentLinkedQueue<Client>()

Classes

class  Client
 Preserves information about our clients. More...


Detailed Description

Handle repo specialty start/end protocol.

Needs to be able to handle multiple clients. Currently due to limitations in close, to do this requires that clients above close their streams in order when multiple streams are using the same FC.

See also:
CCNFlowControl

RepositoryInterestHandler


Constructor & Destructor Documentation

org.ccnx.ccn.impl.repo.RepositoryFlowControl.RepositoryFlowControl ( CCNHandle  handle  )  throws IOException

Parameters:
handle a CCNHandle - if null one is created
Exceptions:
IOException if library is null and a new CCNHandle can't be created

org.ccnx.ccn.impl.repo.RepositoryFlowControl.RepositoryFlowControl ( CCNHandle  handle,
boolean  local 
) throws IOException

constructor to allow the repo flow controller to set the scope for the start write interest

Parameters:
handle a CCNHandle - if null, one is created
local boolean to determine if a general start write, or one with the scope set to one. A scope set to one will limit the write to a repo on the local device
Exceptions:
IOException 

org.ccnx.ccn.impl.repo.RepositoryFlowControl.RepositoryFlowControl ( ContentName  name,
CCNHandle  handle 
) throws IOException

Parameters:
name an initial namespace for this stream
handle a CCNHandle - if null one is created
Exceptions:
IOException if handle is null and a new CCNHandle can't be created

org.ccnx.ccn.impl.repo.RepositoryFlowControl.RepositoryFlowControl ( ContentName  name,
CCNHandle  handle,
boolean  local 
) throws IOException

Parameters:
name an initial namespace for this stream
handle a CCNHandle - if null one is created
local boolean to determine if a general start write, or one with the scope set to one. A scope set to one will limit the write to a repo on the local device
Exceptions:
IOException if handle is null and a new CCNHandle can't be created

org.ccnx.ccn.impl.repo.RepositoryFlowControl.RepositoryFlowControl ( ContentName  name,
CCNHandle  handle,
Shape  shape 
) throws IOException

Parameters:
name an initial namespace for this stream
handle a CCNHandle - if null one is created
shape shapes are not currently implemented and may be deprecated. The only currently defined shape is "Shape.STREAM"
Exceptions:
IOException if handle is null and a new CCNHandle can't be created
See also:
CCNFlowControl

org.ccnx.ccn.impl.repo.RepositoryFlowControl.RepositoryFlowControl ( ContentName  name,
CCNHandle  handle,
Shape  shape,
boolean  local 
) throws IOException

Parameters:
name an initial namespace for this stream
handle a CCNHandle - if null one is created
shape shapes are not currently implemented and may be deprecated. The only currently defined shape is "Shape.STREAM"
local boolean to determine if a general start write, or one with the scope set to one. A scope set to one will limit the write to a repo on the local device
Exceptions:
IOException if handle is null and a new CCNHandle can't be created
See also:
CCNFlowControl


Member Function Documentation

Interest org.ccnx.ccn.impl.repo.RepositoryFlowControl.handleContent ( ContentObject  co,
Interest  interest 
)

Handles packets received from the repository after the start write request.

It's looking for a RepoInfo packet indicating a repository has responded.

Implements org.ccnx.ccn.CCNContentHandler.

void org.ccnx.ccn.impl.repo.RepositoryFlowControl.startWrite ( ContentName  name,
Shape  shape 
) throws IOException

Send out a start write request to any listening repositories and wait for a response.

Parameters:
name the basename of the stream to start
shape currently ignored - can only be Shape.STREAM
Exceptions:
IOException if there is no response from a repository

Reimplemented from org.ccnx.ccn.impl.CCNFlowControl.

void org.ccnx.ccn.impl.repo.RepositoryFlowControl.cancelInterests (  ) 

Cancel any outstanding interests on close.

TODO - since the flow controller may be used by multiple streams we probably want to use Clients to decide what interests to cancel.


The documentation for this class 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