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 ...@@ -30,19 +30,13 @@ from neo.util import dump
from neo import decorators from neo import decorators
class BaseEventHandler(EventHandler): class AdminEventHandler(EventHandler):
""" Base handler for admin node """
pass
class AdminEventHandler(BaseEventHandler):
"""This class deals with events for administrating cluster.""" """This class deals with events for administrating cluster."""
def connectionAccepted(self, conn, s, addr): def connectionAccepted(self, conn, s, addr):
"""Called when a connection is accepted.""" """Called when a connection is accepted."""
# we only accept connection from command tool # 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): 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))) logging.info("ask partition list from %s to %s for %s" %(min_offset, max_offset, dump(uuid)))
...@@ -120,7 +114,8 @@ class AdminEventHandler(BaseEventHandler): ...@@ -120,7 +114,8 @@ class AdminEventHandler(BaseEventHandler):
return return
conn.answer(protocol.answerClusterState(self.app.cluster_state), packet) 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""" """ This class is just used to dispacth message to right handler"""
def dispatch(self, conn, packet): def dispatch(self, conn, packet):
...@@ -132,7 +127,7 @@ class MasterEventHandler(BaseEventHandler): ...@@ -132,7 +127,7 @@ class MasterEventHandler(BaseEventHandler):
self.app.monitoring_handler.dispatch(conn, packet) self.app.monitoring_handler.dispatch(conn, packet)
class MasterBaseEventHandler(BaseEventHandler): class MasterBaseEventHandler(EventHandler):
""" This is the base class for connection to primary master node""" """ This is the base class for connection to primary master node"""
def connectionAccepted(self, conn, s, addr): def connectionAccepted(self, conn, s, addr):
...@@ -165,7 +160,6 @@ class MasterBaseEventHandler(BaseEventHandler): ...@@ -165,7 +160,6 @@ class MasterBaseEventHandler(BaseEventHandler):
app.primary_master_node = None app.primary_master_node = None
app.trying_master_node = None app.trying_master_node = None
EventHandler.connectionFailed(self, conn) EventHandler.connectionFailed(self, conn)
def timeoutExpired(self, conn): def timeoutExpired(self, conn):
...@@ -179,7 +173,6 @@ class MasterBaseEventHandler(BaseEventHandler): ...@@ -179,7 +173,6 @@ class MasterBaseEventHandler(BaseEventHandler):
app.primary_master_node = None app.primary_master_node = None
app.trying_master_node = None app.trying_master_node = None
EventHandler.timeoutExpired(self, conn) EventHandler.timeoutExpired(self, conn)
def connectionClosed(self, conn): def connectionClosed(self, conn):
...@@ -193,7 +186,6 @@ class MasterBaseEventHandler(BaseEventHandler): ...@@ -193,7 +186,6 @@ class MasterBaseEventHandler(BaseEventHandler):
app.primary_master_node = None app.primary_master_node = None
app.trying_master_node = None app.trying_master_node = None
EventHandler.connectionClosed(self, conn) EventHandler.connectionClosed(self, conn)
def peerBroken(self, conn): def peerBroken(self, conn):
...@@ -208,7 +200,6 @@ class MasterBaseEventHandler(BaseEventHandler): ...@@ -208,7 +200,6 @@ class MasterBaseEventHandler(BaseEventHandler):
app.primary_master_node = None app.primary_master_node = None
app.trying_master_node = None app.trying_master_node = None
EventHandler.peerBroken(self, conn) EventHandler.peerBroken(self, conn)
@decorators.identification_required @decorators.identification_required
...@@ -314,6 +305,7 @@ class MasterRequestEventHandler(MasterBaseEventHandler): ...@@ -314,6 +305,7 @@ class MasterRequestEventHandler(MasterBaseEventHandler):
p = protocol.protocolError(msg) p = protocol.protocolError(msg)
client_conn.notify(p, kw['msg_id']) client_conn.notify(p, kw['msg_id'])
class MasterBootstrapEventHandler(MasterBaseEventHandler): class MasterBootstrapEventHandler(MasterBaseEventHandler):
"""This class manage the bootstrap part to the primary master node""" """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