| 1 |
|
| 2 |
#include "ace/Event_Handler.h" |
| 3 |
|
| 4 |
#if !defined (ACE_LACKS_PRAGMA_ONCE) |
| 5 |
# pragma once |
| 6 |
#endif |
| 7 |
|
| 8 |
#include "ace/Reactor.h" |
| 9 |
#include "ace/Naming_Context.h" |
| 10 |
|
| 11 |
class Dump_Restore : public ACE_Event_Handler |
| 12 |
{ |
| 13 |
public: |
| 14 |
enum Operation_Type |
| 15 |
{ |
| 16 |
BIND, |
| 17 |
UNBIND, |
| 18 |
REBIND |
| 19 |
}; |
| 20 |
Dump_Restore (int argc, ACE_TCHAR *argv[]); |
| 21 |
|
| 22 |
|
| 23 |
~Dump_Restore (); |
| 24 |
|
| 25 |
virtual int handle_input (ACE_HANDLE handle); |
| 26 |
|
| 27 |
|
| 28 |
void dump (); |
| 29 |
|
| 30 |
private: |
| 31 |
ACE_TCHAR hostname_[MAXHOSTNAMELEN + 1]; |
| 32 |
|
| 33 |
|
| 34 |
void display_menu (); |
| 35 |
|
| 36 |
|
| 37 |
int set_proc_local (); |
| 38 |
|
| 39 |
|
| 40 |
int set_node_local (); |
| 41 |
|
| 42 |
|
| 43 |
int set_host (const ACE_TCHAR *hostname, |
| 44 |
int port); |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
int quit (); |
| 49 |
|
| 50 |
|
| 51 |
int populate (Dump_Restore::Operation_Type op); |
| 52 |
|
| 53 |
int doit (Dump_Restore::Operation_Type op, |
| 54 |
const char *name, |
| 55 |
const char *value, |
| 56 |
const char *type = ""); |
| 57 |
int bind (const char *key, |
| 58 |
const char *value, |
| 59 |
const char *type = ""); |
| 60 |
int unbind (const char *key); |
| 61 |
int rebind (const char *key, |
| 62 |
const char *value, |
| 63 |
const char *type = ""); |
| 64 |
|
| 65 |
char filename_[MAXPATHLEN + 1]; |
| 66 |
char dump_filename_[MAXPATHLEN + 1]; |
| 67 |
|
| 68 |
u_short port_; |
| 69 |
|
| 70 |
|
| 71 |
ACE_Naming_Context *ns_context_; |
| 72 |
|
| 73 |
|
| 74 |
ACE_Naming_Context::Context_Scope_Type ns_scope_; |
| 75 |
|
| 76 |
|
| 77 |
FILE *infile_; |
| 78 |
|
| 79 |
|
| 80 |
ACE_Name_Options *name_options_; |
| 81 |
|
| 82 |
}; |