Commit c6b0a934 authored by Grégory Wisniewski's avatar Grégory Wisniewski

BaseEventHandler is no more usefull since the app parameter is in the neo base

handler.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@828 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 1f94c313
......@@ -30,19 +30,13 @@ from neo.util import dump
from neo import decorators
class BaseEventHandler(EventHandler):
""" Base handler for admin node """
pass
class AdminEventHandler(BaseEventHandler):
class AdminEventHandler(EventHandler):
"""This class deals with events for administrating cluster."""
def connectionAccepted(self, conn, s, addr):
"""Called when a connection is accepted."""
# we only accept connection from command tool
BaseEventHandler.connectionAccepted(self, conn, s, addr)
EventHandler.connectionAccepted(self, conn, s, addr)
def handleAskPartitionList(self, conn, packet, min_offset, max_offset, uuid):
logging.info("ask partition list from %s to %s for %s" %(min_offset, max_offset, dump(uuid)))
......@@ -120,7 +114,8 @@ class AdminEventHandler(BaseEventHandler):
return
conn.answer(protocol.answerClusterState(self.app.cluster_state), packet)
class MasterEventHandler(BaseEventHandler):
class MasterEventHandler(EventHandler):
""" This class is just used to dispacth message to right handler"""
def dispatch(self, conn, packet):
......@@ -132,7 +127,7 @@ class MasterEventHandler(BaseEventHandler):
self.app.monitoring_handler.dispatch(conn, packet)
class MasterBaseEventHandler(BaseEventHandler):
class MasterBaseEventHandler(EventHandler):
""" This is the base class for connection to primary master node"""
def connectionAccepted(self, conn, s, addr):
......@@ -165,7 +160,6 @@ class MasterBaseEventHandler(BaseEventHandler):
app.primary_master_node = None
app.trying_master_node = None
EventHandler.connectionFailed(self, conn)
def timeoutExpired(self, conn):
......@@ -179,7 +173,6 @@ class MasterBaseEventHandler(BaseEventHandler):
app.primary_master_node = None
app.trying_master_node = None
EventHandler.timeoutExpired(self, conn)
def connectionClosed(self, conn):
......@@ -193,7 +186,6 @@ class MasterBaseEventHandler(BaseEventHandler):
app.primary_master_node = None
app.trying_master_node = None
EventHandler.connectionClosed(self, conn)
def peerBroken(self, conn):
......@@ -208,7 +200,6 @@ class MasterBaseEventHandler(BaseEventHandler):
app.primary_master_node = None
app.trying_master_node = None
EventHandler.peerBroken(self, conn)
@decorators.identification_required
......@@ -314,6 +305,7 @@ class MasterRequestEventHandler(MasterBaseEventHandler):
p = protocol.protocolError(msg)
client_conn.notify(p, kw['msg_id'])
class MasterBootstrapEventHandler(MasterBaseEventHandler):
"""This class manage the bootstrap part to the primary master node"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment