Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rice.p2p.splitstream
Class SplitStreamImpl

    java.lang.Object
      rice.p2p.splitstream.SplitStreamImpl

All Implemented Interfaces:
  SplitStream

public class SplitStreamImpl
extends java.lang.Object
implements SplitStream

This is the implementing class of the ISplitStream interface. It provides the functionality of creating and attaching to channels. This class is responsible for handling all channels that a local node is part of. @(#) SplitStreamImpl.java

Version:
  $Id: SplitStreamImpl.java,v 1.10 2005/03/11 00:57:59 jeffh Exp $
Author:
  Ansley Post, Alan Mislove

Field Summary
`protected java.util.Hashtable` | `channels` Hashtable of all the channels currently created on this node implicitly or explicitly.
`protected Node` | `node` The node that this application is running on
`protected Scribe` | `scribe` The scribe instance for this SplitStream Object

Constructor Summary
`SplitStreamImpl(Node node, java.lang.String instance)` The constructor for building the splitStream object which internally creates it's own Scribe.

Method Summary
`Channel` | `attachChannel(ChannelId id)` This method is used by peers who wish to listen to content distributed by some other peer using SplitStream.
`Channel` | `createChannel(ChannelId id)` This method is used by a peer who wishes to distribute the content using SplitStream.
`Channel[]` | `getChannels()` Returns all of the channels on this local splitstream
`SplitStreamScribePolicy` | `getPolicy()` Returns the policy used to control Scribe

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### scribe

    protected Scribe scribe

  The scribe instance for this SplitStream Object

### node

    protected Node node

  The node that this application is running on

### channels

    protected java.util.Hashtable channels

  Hashtable of all the channels currently created on this node implicitly or explicitly.

Constructor Detail

### SplitStreamImpl

    public SplitStreamImpl(Node node,
                           java.lang.String instance)

  The constructor for building the splitStream object which internally creates it's own Scribe.

Parameters:
  `node` - the pastry node that we will use
  `instance` - The instance name for this splitstream

Method Detail

### getChannels

    public Channel[] getChannels()

  Returns all of the channels on this local splitstream

  Specified by:
    `getChannels` in interface `SplitStream`
  Returns:
    All of the channels currently being received by this splitstream

### getPolicy

    public SplitStreamScribePolicy getPolicy()

  Returns the policy used to control Scribe

  Returns:
    The Scribe policy

### createChannel

    public Channel createChannel(ChannelId id)

  This method is used by a peer who wishes to distribute the content using SplitStream. It creates a Channel Object consisting of numStripes number of Stripes, one for each stripe's content. A Channel object is responsible for implementing SplitStream functionality, like maintaining multiple multicast trees, bandwidth management and discovering parents having spare capacity. One Channel object should be created for each content distribution which wishes to use SplitStream.

  Specified by:
    `createChannel` in interface `SplitStream`
  Parameters:
    `id` - The id of the channel to create
  Returns:
    an instance of a Channel class.

### attachChannel

    public Channel attachChannel(ChannelId id)

  This method is used by peers who wish to listen to content distributed by some other peer using SplitStream. It attaches the local node to the Channel which is being used by the source peer to distribute the content. Essentially, this method finds out the different parameters of Channel object which is created by the source, (the peer distributing the content) , and then creates a local Channel object with these parameters and returns it. This is a non-blocking call so the returned Channel object may not be initialized with all the parameters, so applications should wait for channelIsReady() notification made by channels when they are ready.

  Specified by:
    `attachChannel` in interface `SplitStream`
  Parameters:
    `id` - The id of the channel to create
  Returns:
    An instance of Channel object.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2005 - Rice Pastry.