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

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

List of all members.

Classes

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

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 ack (ContentName name)
 Handle acknowledgement packet from the repo.
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 = false
Queue< Client_clients = new ConcurrentLinkedQueue<Client>()

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.

Intended to handle the repo ack protocol. This is currently unused until we find a workable way to do it.

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

void org.ccnx.ccn.impl.repo.RepositoryFlowControl.ack ( ContentName  name  ) 

Handle acknowledgement packet from the repo.

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

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

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.


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