limal-runlevel
LSBService.hpp
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | |
3 | _ _ _ _ __ _ |
4 | | | | | | \_/ | / \ | | |
5 | | | | | | |_| | / /\ \ | | |
6 | | |__ | | | | | | / ____ \ | |__ |
7 | |____||_| |_| |_|/ / \ \|____| |
8 | |
9 | runlevel library |
10 | |
11 | (C) SUSE Linux Products GmbH |
12 \----------------------------------------------------------------------/
13 
14  File: LSBService.hpp
15 
16  Author: Marius Tomaschewski
17  Maintainer: Marius Tomaschewski
18 
19  Purpose:
20 
21 /-*/
33 #ifndef LIMAL_RUNLEVEL_LSB_SERVICE_HPP
34 #define LIMAL_RUNLEVEL_LSB_SERVICE_HPP
35 
36 #include <limal/runlevel/config.h>
39 #include <blocxx/String.hpp>
40 #include <blocxx/Array.hpp>
41 #include <blocxx/Map.hpp>
42 
43 
44 // -------------------------------------------------------------------
45 namespace LIMAL_NAMESPACE
46 {
47 namespace RUNLEVEL_NAMESPACE
48 {
49 
50 // -------------------------------------------------------------------
84 typedef blocxx::Int32 LSBExitCode;
85 
88 
97 
98 
101 
107 
108 
109 
110 typedef blocxx::Map<blocxx::String, blocxx::String> LSBInitInfo;
111 
112 
113 // -------------------------------------------------------------------
119 class LSBService: public Service
120 {
121 public:
128  LSBService(const blocxx::String &name);
129 
130 
134  ~LSBService();
135 
136 
140  bool
141  isServiceEnabled() const;
142 
143 
149  bool
150  isServiceEnabledInRunlevel(Runlevel runlevel) const;
151 
152 
158  bool enableService() const;
159 
160 
165  bool disableService() const;
166 
167 
177  getServiceInitInfo() const;
178 
179 
188  blocxx::Array<blocxx::String>
189  getServiceActions() const;
190 
191 
203  blocxx::Array<blocxx::String>
204  getDefaultActions() const;
205 
206 
252  executeAction(const blocxx::String &action,
253  const ServiceCmdArgs &cmdArgs,
254  blocxx::String &stdOutput,
255  blocxx::String &errOutput,
256  const ServiceEnvVars &envVars,
257  const blocxx::String &stdInput,
258  int timeoutSecs,
259  int outputLimit);
260 
261 
279  executeAction(const blocxx::String &action,
280  const ServiceCmdArgs &cmdArgs);
281 
282 
298  executeAction(const blocxx::String &action);
299 
300 
310  executeAction(const blocxx::String &action,
311  const ServiceCmdArgs &cmdArgs,
312  blocxx::String &stdOutput,
313  blocxx::String &errOutput,
314  int &execStatus,
315  const ServiceEnvVars &envVars,
316  const blocxx::String &stdInput,
317  int timeoutSecs,
318  int outputLimit)
319  // BLOCXX_DEPRECATED
320  ;
321 
322 
323 protected:
324  void
325  addServiceAction(const blocxx::String &action);
326 
327 private:
328  blocxx::Array<blocxx::String> m_actions;
329 };
330 
331 
332 // -------------------------------------------------------------------
333 } // End of RUNLEVEL_NAMESPACE
334 } // End of LIMAL_NAMESPACE
335 
336 #endif // LIMAL_RUNLEVEL_LSB_SERVICE_HPP
337 /* vim: set ts=8 sts=8 sw=8 ai noet: */