2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file src/cyad/CommandsDispatcher.h
18 * @author Aleksander Zdyb <a.zdyb@samsung.com>
20 * @brief CommandsDispatcher class
23 #ifndef SRC_CYAD_COMMANDSDISPATCHER_H_
24 #define SRC_CYAD_COMMANDSDISPATCHER_H_
26 #include <cyad/BaseAdminApiWrapper.h>
27 #include <cyad/CommandlineParser/CyadCommand.h>
28 #include <cyad/DispatcherIO.h>
31 struct cynara_admin_policy;
35 class CommandsDispatcher {
37 CommandsDispatcher(BaseDispatcherIO &io, BaseAdminApiWrapper &adminApiWrapper);
38 virtual ~CommandsDispatcher();
40 virtual int execute(CyadCommand &);
41 virtual int execute(HelpCyadCommand &);
42 virtual int execute(ErrorCyadCommand &);
43 virtual int execute(DeleteBucketCyadCommand &);
44 virtual int execute(SetBucketCyadCommand &);
45 virtual int execute(SetPolicyCyadCommand &);
48 // TODO: Get argv[0] instead of hardcoded name
49 const std::string helpMessage = "Usage: cyad [OPTIONS]\n\n"
50 "Bucket set options (with -b or --set-bucket)\n"
51 " -b, --set-bucket=<name> name of bucket\n"
52 " -p, --policy=<policy> default policy\n"
53 " -m, --metadata=<metadata> metadata for default policy\n"
55 "Bucket delete options (with -d or --delete-bucket)\n"
56 " -d, --delete-bucket=<name> name of bucket to delete\n"
58 "Policy set options (with -s or --set-policy)\n"
59 " -l, --client=<client> client value\n"
60 " -u, --user=<user> user value\n"
61 " -r, --privilege=<privilege> privilege value\n"
62 " -p, --policy=<policy> policy\n"
63 " -m, --metadata=<metadata> metadata for policy\n"
66 " -h, --help print help message";
67 BaseDispatcherIO &m_io;
68 BaseAdminApiWrapper &m_adminApiWrapper;
69 struct cynara_admin *m_cynaraAdmin;
72 } /* namespace Cynara */
74 #endif /* SRC_CYAD_COMMANDSDISPATCHER_H_ */