00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00026 #ifndef LIMAL_RUNLEVEL_SERVICE_HPP
00027 #define LIMAL_RUNLEVEL_SERVICE_HPP
00028
00029 #include <limal/runlevel/config.h>
00030 #include <blocxx/String.hpp>
00031 #include <blocxx/Array.hpp>
00032 #include <blocxx/Map.hpp>
00033
00034
00035
00036 namespace LIMAL_NAMESPACE
00037 {
00038 namespace RUNLEVEL_NAMESPACE
00039 {
00040
00041
00046 blocxx::String
00047 getServiceScriptDir();
00048
00049
00050
00055 blocxx::Array<blocxx::String>
00056 getInstalledServiceNames();
00057
00058
00059
00063 typedef blocxx::Array<blocxx::String> ServiceCmdArgs;
00064
00065
00069 typedef blocxx::Map<blocxx::String,blocxx::String> ServiceEnvVars;
00070
00071
00072
00078 class Service
00079 {
00080 public:
00087 Service(const blocxx::String &name);
00088
00092 ~Service();
00093
00097 blocxx::String
00098 getServiceName() const;
00099
00103 blocxx::String
00104 getScriptPath() const;
00105
00109 blocxx::String
00110 getScriptName() const;
00111
00112
00117 bool
00118 isServiceInstalled() const;
00119
00120
00163 int
00164 executeScript(const ServiceCmdArgs &cmdArgs,
00165 blocxx::String &stdOutput,
00166 blocxx::String &errOutput,
00167 const ServiceEnvVars &envVars,
00168 const blocxx::String &stdInput,
00169 int timeoutSecs,
00170 int outputLimit);
00171
00172
00187 int
00188 executeScript(const ServiceCmdArgs &cmdArgs);
00189
00190
00199 int
00200 executeScript(const ServiceCmdArgs &cmdArgs,
00201 blocxx::String &stdOutput,
00202 blocxx::String &errOutput,
00203 int &execStatus,
00204 const ServiceEnvVars &envVars,
00205 const blocxx::String &stdInput,
00206 int timeoutSecs,
00207 int outputLimit)
00208
00209 ;
00210
00211
00212 protected:
00219 void
00220 setScriptName(const blocxx::String &name);
00221
00222 private:
00223
00224 Service();
00225
00226 blocxx::String m_path;
00227 blocxx::String m_name;
00228 };
00229
00230
00231
00232 }
00233 }
00234
00235 #endif // LIMAL_RUNLEVEL_SERVICE_HPP