0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ConnectionHandler.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3 of the
9  * License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
28 #ifndef Hypertable_Master_ConnectionHandler_h
29 #define Hypertable_Master_ConnectionHandler_h
30 
31 #include "Operation.h"
32 #include "Context.h"
33 
35 
36 namespace Hypertable {
37 
66  public:
72  ConnectionHandler(ContextPtr &context) : m_context(context) {}
73 
74  void start_timer();
75 
79  virtual void handle(EventPtr &event);
80 
81  private:
82 
87  int32_t send_id_response(EventPtr &event, OperationPtr &operation);
88 
98  int32_t send_error_response(EventPtr &event, int32_t error, const String &msg);
99 
106  int32_t send_ok_response(EventPtr &event, bool silent=false);
107 
116 
119 
120  };
121 
123 }
124 
125 #endif // Hypertable_Master_ConnectionHandler_h
126 
std::string String
A String is simply a typedef to std::string.
Definition: String.h:44
Abstract base class for application dispatch handlers registered with AsyncComm.
int32_t send_error_response(EventPtr &event, int32_t error, const String &msg)
Sends error response message back to client.
Declarations for Operation.
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
Definition: Event.h:228
std::shared_ptr< Context > ContextPtr
Smart pointer to Context.
Definition: Context.h:265
Declarations for DispatchHandler.
Hypertable definitions
ConnectionHandler(ContextPtr &context)
Constructor.
Handles incoming Master requests.
ContextPtr m_context
Pointer to Master context.
virtual void handle(EventPtr &event)
Responds to Master request events.
int32_t send_id_response(EventPtr &event, OperationPtr &operation)
Sends operation ID back to client.
int32_t send_ok_response(EventPtr &event, bool silent=false)
Sends OK response message back to client.
std::shared_ptr< Operation > OperationPtr
Smart pointer to Operation.
Definition: Operation.h:609
void maybe_dump_op_statistics()
Maybe dumps OperationProcessor statistics.
Declarations for Context.