org.inria.myriads.snoozenode.groupmanager
Class GroupManagerBackend

java.lang.Object
  extended by org.inria.myriads.snoozenode.groupmanager.GroupManagerBackend
All Implemented Interfaces:
LeaderElectionListener, HeartbeatListener

public final class GroupManagerBackend
extends Object
implements LeaderElectionListener, HeartbeatListener

Group manager backend logic.

Author:
Eugen Feller

Constructor Summary
GroupManagerBackend(NodeConfiguration nodeConfiguration)
          Constructor.
 
Method Summary
 GroupLeaderInit getGroupLeaderInit()
          Returns the group leader initialization.
 org.inria.myriads.snoozecommon.communication.groupmanager.GroupManagerDescription getGroupManagerDescription()
          Returns the group manager description.
 GroupManagerInit getGroupManagerInit()
          Returns the group maanger initialization.
 NodeConfiguration getNodeConfiguration()
          Returns the node parameters.
 void onHeartbeatArrival(HeartbeatMessage heartbeat)
          Heartbeat event arrival event.
 void onHeartbeatFailure()
          Called when heartbeat message was not received for timeout.
 boolean onInitGroupLeader()
          Called by the leader election algorithm if current group manager becomes group leader.
 void onInitGroupManager()
          Starts the heartbeat multicast listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupManagerBackend

public GroupManagerBackend(NodeConfiguration nodeConfiguration)
                    throws Exception
Constructor.

Parameters:
nodeConfiguration - The node parameters
Throws:
Exception - The exception
Method Detail

onInitGroupManager

public void onInitGroupManager()
                        throws Exception
Starts the heartbeat multicast listener.

Specified by:
onInitGroupManager in interface LeaderElectionListener
Throws:
Exception

getGroupLeaderInit

public GroupLeaderInit getGroupLeaderInit()
Returns the group leader initialization.

Returns:
The group leader initialization

getGroupManagerInit

public GroupManagerInit getGroupManagerInit()
Returns the group maanger initialization.

Returns:
The group manager initialization

getNodeConfiguration

public NodeConfiguration getNodeConfiguration()
Returns the node parameters.

Returns:
The node parameters

getGroupManagerDescription

public org.inria.myriads.snoozecommon.communication.groupmanager.GroupManagerDescription getGroupManagerDescription()
Returns the group manager description.

Returns:
The group manager description

onInitGroupLeader

public boolean onInitGroupLeader()
Called by the leader election algorithm if current group manager becomes group leader.

Specified by:
onInitGroupLeader in interface LeaderElectionListener
Returns:
true if everything ok, false otherwise

onHeartbeatArrival

public void onHeartbeatArrival(HeartbeatMessage heartbeat)
Heartbeat event arrival event.

Specified by:
onHeartbeatArrival in interface HeartbeatListener
Parameters:
heartbeat - Heartbeat message

onHeartbeatFailure

public void onHeartbeatFailure()
Called when heartbeat message was not received for timeout.

Specified by:
onHeartbeatFailure in interface HeartbeatListener


Copyright © 2012. All Rights Reserved.