summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/ImplRepo_Service/tao_ir_i.h
blob: ad424c2e31361178be4a76542e15825dc64aeb2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
/* -*- C++ -*- */
// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO/orbsvcs/ImplRepo_Service
//
// = FILENAME
//    tao_ir_i.h
//
// = DESCRIPTION
//    This class implements the Implementation Repository helper application.
//
// = AUTHOR
//    Darrell Brunsch <brunsch@cs.wustl.edu>
//
// ============================================================================

#if !defined (TAO_IR_I_H)
#define TAO_IR_I_H

#include "tao/corba.h"
#include "orbsvcs/ImplRepoC.h"

class TAO_IR_Op;
// Forward Declaration

class TAO_IR_i
{
  // = TITLE
  //     TAO's command line helper application
  //
  // = DESCRIPTION
  //     This class talks to the IR and registers/lists/etc.
public:
  // = Constructor and destructor.
  TAO_IR_i (void);
  ~TAO_IR_i (void);

  int run (void);
  // Execute client code.

  int init (int argc, char **argv);
  // Initialize the client communication endpoint with server.

private:
  void print_usage (void);
  // Print out information about all operations.

  int parse_args (void);
  // Parses the arguments passed on the command line.

  int argc_;
  // # of arguments on the command line.

  ASYS_TCHAR **argv_;
  // arguments from command line.

  CORBA::ORB_var orb_;
  // Remember our orb.

  ImplementationRepository::Administration_var implrepo_;
  // Reference to our implementation repository.

  TAO_IR_Op *op_;
  // What we need to do.
};

class TAO_IR_Op
{
public:
  static TAO_IR_Op *make_op (const ASYS_TCHAR *op_name, ImplementationRepository::Administration_ptr ir);
  // Factory.
  
  TAO_IR_Op (ImplementationRepository::Administration_ptr implrepo);
  // Constructor.
  
  virtual ~TAO_IR_Op (void);
  // Virtual Destructor.

  virtual int parse (int argc, ASYS_TCHAR **argv) = 0;
  // Parse arguments.

  virtual int run (void) = 0;
  // Do the work.

protected:
  ImplementationRepository::Administration_ptr implrepo_;
  // Reference to our implementation repository.

  // = Helper methods

  void display_server_information (const ImplementationRepository::ServerInformation &info);
  // Prints out the information contained in a ServerInformation structure.
};

class TAO_IR_Op_Activate : public TAO_IR_Op
{
public:
  TAO_IR_Op_Activate (ImplementationRepository::Administration_ptr implrepo);
  ~TAO_IR_Op_Activate (void);

  virtual int parse (int argc, ASYS_TCHAR **argv);
  virtual int run (void);

protected:
  void print_usage (void);
  // Prints a message about the usage

  ACE_TString server_name_;
  // POA server name.
};

class TAO_IR_Op_Add : public TAO_IR_Op
{
public:
  TAO_IR_Op_Add (ImplementationRepository::Administration_ptr implrepo);
  ~TAO_IR_Op_Add (void);

  virtual int parse (int argc, ASYS_TCHAR **argv);
  virtual int run (void);

protected:
  void print_usage (void);
  // Prints a message about the usage.

  ACE_TString server_name_;
  // POA server name.

  ACE_TString command_line_;
  // Command line.

  ACE_TString working_dir_;
  // Working directory.
};


// Used to list the entries in the IR

class TAO_IR_Op_List : public TAO_IR_Op
{
public:
  TAO_IR_Op_List (ImplementationRepository::Administration_ptr implrepo);
  ~TAO_IR_Op_List (void);

  virtual int parse (int argc, ASYS_TCHAR **argv);
  virtual int run (void);

protected:
  void print_usage (void);
  // Prints a message about the usage

  ACE_TString server_name_;
  // POA server name.

  int verbose_server_information_;
  // If true, more server information is displayed.

  void display_server_information (const ImplementationRepository::ServerInformation &info);
  // Prints out the information contained in a ServerInformation structure.
  // Specialized to only print server information
};

class TAO_IR_Op_Remove : public TAO_IR_Op
{
public:
  TAO_IR_Op_Remove (ImplementationRepository::Administration_ptr implrepo);
  ~TAO_IR_Op_Remove (void);

  virtual int parse (int argc, ASYS_TCHAR **argv);
  virtual int run (void);

protected:
  void print_usage (void);
  // Prints a message about the usage

  ACE_TString server_name_;
  // POA server name.
};

class TAO_IR_Op_Shutdown : public TAO_IR_Op
{
public:
  TAO_IR_Op_Shutdown (ImplementationRepository::Administration_ptr implrepo);
  ~TAO_IR_Op_Shutdown (void);

  virtual int parse (int argc, ASYS_TCHAR **argv);
  virtual int run (void);

protected:
  void print_usage (void);
  // Prints a message about the usage

  ACE_TString server_name_;
  // POA server name.
};

class TAO_IR_Op_Update : public TAO_IR_Op
{
public:
  TAO_IR_Op_Update (ImplementationRepository::Administration_ptr implrepo);
  ~TAO_IR_Op_Update (void);

  virtual int parse (int argc, ASYS_TCHAR **argv);
  virtual int run (void);

protected:
  void print_usage (void);
  // Prints a message about the usage.

  ACE_TString server_name_;
  // POA server name.

  int set_command_line_;
  // True if the command_line_ needs to be updated.
  
  ACE_TString command_line_;
  // Startup command.

  int set_working_dir_;
  // True if the working_dir_ needs to be updated.

  ACE_TString working_dir_;
  // Working directory.
};

#endif /* TAO_IR_I_H */