~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to server-tools/instance-manager/user_management_commands.h

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_USER_MANAGEMENT_CMD_H
 
2
#define INCLUDES_MYSQL_INSTANCE_MANAGER_USER_MANAGEMENT_CMD_H
 
3
 
 
4
/*
 
5
   Copyright (C) 2006 MySQL AB
 
6
 
 
7
   This program is free software; you can redistribute it and/or modify
 
8
   it under the terms of the GNU General Public License as published by
 
9
   the Free Software Foundation; version 2 of the License.
 
10
 
 
11
   This program 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
19
*/
 
20
 
 
21
/*
 
22
  This header contains declarations of classes inteded to support
 
23
  user-management commands (such as add user, get list of users, etc).
 
24
 
 
25
  The general idea is to have one interface (pure abstract class) for such a
 
26
  command. Each concrete user-management command is implemented in concrete
 
27
  class, derived from the common interface.
 
28
*/
 
29
 
 
30
#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
 
31
#pragma interface
 
32
#endif
 
33
 
 
34
/*************************************************************************
 
35
  User_management_cmd -- base class for User-management commands.
 
36
*************************************************************************/
 
37
 
 
38
class User_management_cmd
 
39
{
 
40
public:
 
41
  User_management_cmd()
 
42
  { }
 
43
 
 
44
  virtual ~User_management_cmd()
 
45
  { }
 
46
 
 
47
public:
 
48
  /*
 
49
    Executes user-management command.
 
50
 
 
51
    SYNOPSIS
 
52
      execute()
 
53
 
 
54
    RETURN
 
55
      See exit_codes.h for possible values.
 
56
  */
 
57
 
 
58
  virtual int execute() = 0;
 
59
};
 
60
 
 
61
 
 
62
/*************************************************************************
 
63
  Print_password_line_cmd: support for --print-password-line command-line
 
64
  option.
 
65
*************************************************************************/
 
66
 
 
67
class Print_password_line_cmd: public User_management_cmd
 
68
{
 
69
public:
 
70
  Print_password_line_cmd()
 
71
  { }
 
72
 
 
73
public:
 
74
  virtual int execute();
 
75
};
 
76
 
 
77
 
 
78
/*************************************************************************
 
79
  Add_user_cmd: support for --add-user command-line option.
 
80
*************************************************************************/
 
81
 
 
82
class Add_user_cmd: public User_management_cmd
 
83
{
 
84
public:
 
85
  Add_user_cmd()
 
86
  { }
 
87
 
 
88
public:
 
89
  virtual int execute();
 
90
};
 
91
 
 
92
 
 
93
/*************************************************************************
 
94
  Drop_user_cmd: support for --drop-user command-line option.
 
95
*************************************************************************/
 
96
 
 
97
class Drop_user_cmd: public User_management_cmd
 
98
{
 
99
public:
 
100
  Drop_user_cmd()
 
101
  { }
 
102
 
 
103
public:
 
104
  virtual int execute();
 
105
};
 
106
 
 
107
 
 
108
/*************************************************************************
 
109
  Edit_user_cmd: support for --edit-user command-line option.
 
110
*************************************************************************/
 
111
 
 
112
class Edit_user_cmd: public User_management_cmd
 
113
{
 
114
public:
 
115
  Edit_user_cmd()
 
116
  { }
 
117
 
 
118
public:
 
119
  virtual int execute();
 
120
};
 
121
 
 
122
 
 
123
/*************************************************************************
 
124
  Clean_db_cmd: support for --clean-db command-line option.
 
125
*************************************************************************/
 
126
 
 
127
class Clean_db_cmd: public User_management_cmd
 
128
{
 
129
public:
 
130
  Clean_db_cmd()
 
131
  { }
 
132
 
 
133
public:
 
134
  virtual int execute();
 
135
};
 
136
 
 
137
 
 
138
/*************************************************************************
 
139
  Check_db_cmd: support for --check-db command-line option.
 
140
*************************************************************************/
 
141
 
 
142
class Check_db_cmd: public User_management_cmd
 
143
{
 
144
public:
 
145
  Check_db_cmd()
 
146
  { }
 
147
 
 
148
public:
 
149
  virtual int execute();
 
150
};
 
151
 
 
152
 
 
153
/*************************************************************************
 
154
  List_users_cmd: support for --list-users command-line option.
 
155
*************************************************************************/
 
156
 
 
157
class List_users_cmd: public User_management_cmd
 
158
{
 
159
public:
 
160
  List_users_cmd()
 
161
  { }
 
162
 
 
163
public:
 
164
  virtual int execute();
 
165
};
 
166
 
 
167
#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_USER_MANAGEMENT_CMD_H