net.sf.neem
Class Protocol

java.lang.Object
  extended by net.sf.neem.Protocol
All Implemented Interfaces:
ProtocolMBean

public class Protocol
extends java.lang.Object
implements ProtocolMBean

Implementation of the NeEM management bean.


Method Summary
 void addPeer(java.lang.String addr, int port)
          Connect to a new peer.
 int getAcceptedSocks()
          Get number of socket connections accepted.
 int getBufferSize()
          Get the default size of socket buffers.
 int getBytesReceived()
          Get number of raw bytes received.
 int getBytesSent()
          Get number of raw bytes transmitted.
 int getConnectedSocks()
          Get number of successful sockets connected.
 int getDataReceived()
          Get number of data packets received.
 int getDataSent()
          Get number of data packets transmitted.
 int getDelivered()
          Get number of messages delivered to the application.
 int getGossipFanout()
          Get the number of gossip target for each round.
 int getHintsReceived()
          Get number of packet hints received.
 int getHintsSent()
          Get number of packet hints transmitted.
 int getJoinRequests()
          Get number of direct join requests received.
 java.net.InetSocketAddress getLocalAddress()
          Local listening socket.
 java.util.UUID getLocalId()
          Get globally unique local id.
 int getMaxIds()
          Get the maximum number of cached message ids.
 int getMinPullSize()
          Get the minimum size of messages that can be pulled.
 int getMulticast()
          Get number of messages multicast locally by the application.
 int getOverlayFanout()
          Get the number of neighbors.
 int getPacketsReceived()
          Get number of packets received.
 int getPacketsSent()
          Get number of packets transmited.
 java.net.InetSocketAddress[] getPeerAddresses()
          Get list of currently connected peers.
 java.util.UUID[] getPeerIds()
          Get list of currently connected peer ids.
 java.net.InetSocketAddress getPublicAddress()
          Get the address being advertised to peers.
 int getPullPeriod()
          Get period for retrying to pull known messages.
 int getPullReceived()
          Get number of pull request transmitted.
 int getPullSent()
          Get number of pull requests transmitted.
 int getPurgedConnections()
          Get number of connections purged after overflowing local neighborhood.
 int getPushTimeToLive()
          Get the maximum number of times that a message is pushed.
 int getQueueSize()
          Get the default size of buffer queues.
 int getShufflePeriod()
          Get the delay between periodic shuffle.
 int getShufflesReceived()
          Get number of shuffle requests received.
 int getShufflesSent()
          Get number of shuffle requests transmitted.
 int getTimeToLive()
          Get the maximum number of times that a message is relayed.
 void resetCounters()
          Resets all counters.
 void setBufferSize(int size)
          Set the default size of socket buffers.
 void setGossipFanout(int fanout)
          Set the number of gossip target for each round.
 void setMaxIds(int max)
          Set the maximum number of cached message ids.
 void setMinPullSize(int minPullSize)
          Set the minimum size of messages that can be pulled.
 void setOverlayFanout(int fanout)
          Set the number of neighbors.
 void setPullPeriod(int pullPeriod)
          Set period for retrying to pull known messages.
 void setPushTimeToLive(int pushttl)
          Set the maximum number of times that a message is pushed.
 void setQueueSize(int size)
          Set the default size of buffer queues.
 void setShufflePeriod(int period)
          Set the delay between periodic shuffle.
 void setTimeToLive(int ttl)
          Set the maximum number of times that a message is relayed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getGossipFanout

public int getGossipFanout()
Description copied from interface: ProtocolMBean
Get the number of gossip target for each round.

Specified by:
getGossipFanout in interface ProtocolMBean
Returns:
number of targets

setGossipFanout

public void setGossipFanout(int fanout)
Description copied from interface: ProtocolMBean
Set the number of gossip target for each round.

Specified by:
setGossipFanout in interface ProtocolMBean
Parameters:
fanout - number of targets

getMaxIds

public int getMaxIds()
Description copied from interface: ProtocolMBean
Get the maximum number of cached message ids.

Specified by:
getMaxIds in interface ProtocolMBean
Returns:
number of ids

setMaxIds

public void setMaxIds(int max)
Description copied from interface: ProtocolMBean
Set the maximum number of cached message ids. Setting this too low may result in duplicate message deliveries.

Specified by:
setMaxIds in interface ProtocolMBean
Parameters:
max - number of ids

getMinPullSize

public int getMinPullSize()
Description copied from interface: ProtocolMBean
Get the minimum size of messages that can be pulled.

Specified by:
getMinPullSize in interface ProtocolMBean
Returns:
size in bytes

setMinPullSize

public void setMinPullSize(int minPullSize)
Description copied from interface: ProtocolMBean
Set the minimum size of messages that can be pulled. Smaller messages are always pushed. Setting it to a large value disables pulling.

Specified by:
setMinPullSize in interface ProtocolMBean
Parameters:
minPullSize - size in bytes

getPullPeriod

public int getPullPeriod()
Description copied from interface: ProtocolMBean
Get period for retrying to pull known messages.

Specified by:
getPullPeriod in interface ProtocolMBean
Returns:
period in milliseconds

setPullPeriod

public void setPullPeriod(int pullPeriod)
Description copied from interface: ProtocolMBean
Set period for retrying to pull known messages.

Specified by:
setPullPeriod in interface ProtocolMBean
Parameters:
pullPeriod - period in milliseconds

getPushTimeToLive

public int getPushTimeToLive()
Description copied from interface: ProtocolMBean
Get the maximum number of times that a message is pushed.

Specified by:
getPushTimeToLive in interface ProtocolMBean
Returns:
number of hops

setPushTimeToLive

public void setPushTimeToLive(int pushttl)
Description copied from interface: ProtocolMBean
Set the maximum number of times that a message is pushed. 0 disables pushing. A large value (at least, larger than time-to-live) disables pulling.

Specified by:
setPushTimeToLive in interface ProtocolMBean
Parameters:
pushttl - number of hops

getTimeToLive

public int getTimeToLive()
Description copied from interface: ProtocolMBean
Get the maximum number of times that a message is relayed.

Specified by:
getTimeToLive in interface ProtocolMBean
Returns:
number of hops

setTimeToLive

public void setTimeToLive(int ttl)
Description copied from interface: ProtocolMBean
Set the maximum number of times that a message is relayed.

Specified by:
setTimeToLive in interface ProtocolMBean
Parameters:
ttl - number of hops

getDelivered

public int getDelivered()
Description copied from interface: ProtocolMBean
Get number of messages delivered to the application.

Specified by:
getDelivered in interface ProtocolMBean

getMulticast

public int getMulticast()
Description copied from interface: ProtocolMBean
Get number of messages multicast locally by the application.

Specified by:
getMulticast in interface ProtocolMBean

getDataReceived

public int getDataReceived()
Description copied from interface: ProtocolMBean
Get number of data packets received.

Specified by:
getDataReceived in interface ProtocolMBean

getDataSent

public int getDataSent()
Description copied from interface: ProtocolMBean
Get number of data packets transmitted.

Specified by:
getDataSent in interface ProtocolMBean

getHintsReceived

public int getHintsReceived()
Description copied from interface: ProtocolMBean
Get number of packet hints received.

Specified by:
getHintsReceived in interface ProtocolMBean

getHintsSent

public int getHintsSent()
Description copied from interface: ProtocolMBean
Get number of packet hints transmitted.

Specified by:
getHintsSent in interface ProtocolMBean

getPullReceived

public int getPullReceived()
Description copied from interface: ProtocolMBean
Get number of pull request transmitted.

Specified by:
getPullReceived in interface ProtocolMBean

getPullSent

public int getPullSent()
Description copied from interface: ProtocolMBean
Get number of pull requests transmitted.

Specified by:
getPullSent in interface ProtocolMBean

getLocalId

public java.util.UUID getLocalId()
Description copied from interface: ProtocolMBean
Get globally unique local id.

Specified by:
getLocalId in interface ProtocolMBean
Returns:
local id

getPeerIds

public java.util.UUID[] getPeerIds()
Description copied from interface: ProtocolMBean
Get list of currently connected peer ids.

Specified by:
getPeerIds in interface ProtocolMBean
Returns:
connected peer ids

getPublicAddress

public java.net.InetSocketAddress getPublicAddress()
Description copied from interface: ProtocolMBean
Get the address being advertised to peers.

Specified by:
getPublicAddress in interface ProtocolMBean
Returns:
the address

getOverlayFanout

public int getOverlayFanout()
Description copied from interface: ProtocolMBean
Get the number of neighbors.

Specified by:
getOverlayFanout in interface ProtocolMBean
Returns:
number of neighbors

setOverlayFanout

public void setOverlayFanout(int fanout)
Description copied from interface: ProtocolMBean
Set the number of neighbors.

Specified by:
setOverlayFanout in interface ProtocolMBean
Parameters:
fanout - number of neighbors

getShufflePeriod

public int getShufflePeriod()
Description copied from interface: ProtocolMBean
Get the delay between periodic shuffle.

Specified by:
getShufflePeriod in interface ProtocolMBean
Returns:
period in milliseconds

setShufflePeriod

public void setShufflePeriod(int period)
Description copied from interface: ProtocolMBean
Set the delay between periodic shuffle.

Specified by:
setShufflePeriod in interface ProtocolMBean
Parameters:
period - in milliseconds

getJoinRequests

public int getJoinRequests()
Description copied from interface: ProtocolMBean
Get number of direct join requests received.

Specified by:
getJoinRequests in interface ProtocolMBean

getPurgedConnections

public int getPurgedConnections()
Description copied from interface: ProtocolMBean
Get number of connections purged after overflowing local neighborhood.

Specified by:
getPurgedConnections in interface ProtocolMBean

getShufflesReceived

public int getShufflesReceived()
Description copied from interface: ProtocolMBean
Get number of shuffle requests received.

Specified by:
getShufflesReceived in interface ProtocolMBean

getShufflesSent

public int getShufflesSent()
Description copied from interface: ProtocolMBean
Get number of shuffle requests transmitted.

Specified by:
getShufflesSent in interface ProtocolMBean

getLocalAddress

public java.net.InetSocketAddress getLocalAddress()
Description copied from interface: ProtocolMBean
Local listening socket.

Specified by:
getLocalAddress in interface ProtocolMBean

getPeerAddresses

public java.net.InetSocketAddress[] getPeerAddresses()
Description copied from interface: ProtocolMBean
Get list of currently connected peers.

Specified by:
getPeerAddresses in interface ProtocolMBean
Returns:
connected peers

addPeer

public void addPeer(java.lang.String addr,
                    int port)
Description copied from interface: ProtocolMBean
Connect to a new peer.

Specified by:
addPeer in interface ProtocolMBean
Parameters:
addr - hostname or address of peer
port - listening port number

getQueueSize

public int getQueueSize()
Description copied from interface: ProtocolMBean
Get the default size of buffer queues.

Specified by:
getQueueSize in interface ProtocolMBean
Returns:
number of messages

setQueueSize

public void setQueueSize(int size)
Description copied from interface: ProtocolMBean
Set the default size of buffer queues. Currently, this does not modify existing queues, only those that are created thereafter.

Specified by:
setQueueSize in interface ProtocolMBean
Parameters:
size - number of messages

getBufferSize

public int getBufferSize()
Description copied from interface: ProtocolMBean
Get the default size of socket buffers.

Specified by:
getBufferSize in interface ProtocolMBean
Returns:
size in bytes

setBufferSize

public void setBufferSize(int size)
Description copied from interface: ProtocolMBean
Set the default size of socket buffers.

Specified by:
setBufferSize in interface ProtocolMBean
Parameters:
size - size in bytes

getAcceptedSocks

public int getAcceptedSocks()
Description copied from interface: ProtocolMBean
Get number of socket connections accepted.

Specified by:
getAcceptedSocks in interface ProtocolMBean

getConnectedSocks

public int getConnectedSocks()
Description copied from interface: ProtocolMBean
Get number of successful sockets connected.

Specified by:
getConnectedSocks in interface ProtocolMBean

getPacketsReceived

public int getPacketsReceived()
Description copied from interface: ProtocolMBean
Get number of packets received.

Specified by:
getPacketsReceived in interface ProtocolMBean

getPacketsSent

public int getPacketsSent()
Description copied from interface: ProtocolMBean
Get number of packets transmited.

Specified by:
getPacketsSent in interface ProtocolMBean

getBytesReceived

public int getBytesReceived()
Description copied from interface: ProtocolMBean
Get number of raw bytes received.

Specified by:
getBytesReceived in interface ProtocolMBean

getBytesSent

public int getBytesSent()
Description copied from interface: ProtocolMBean
Get number of raw bytes transmitted.

Specified by:
getBytesSent in interface ProtocolMBean

resetCounters

public void resetCounters()
Description copied from interface: ProtocolMBean
Resets all counters.

Specified by:
resetCounters in interface ProtocolMBean


Copyright © 2005 University of Minho, Portugal. All Rights Reserved.