Muster SDK  8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MNodeConfiguration.h
Go to the documentation of this file.
1 /*****************************************************************************
2  **
3  ** Header file for Muster API node configuration object
4  **
5  ** Name : MNodeConfiguration.h
6  ** Author : Leonardo Bernardini
7  ** Version : 1.0, Sat Mar 2nd 2013
8  **
9  ** Copyright 2000-2014, Virtual Vertex
10  ** All Rights Reserved.
11  **
12  ** This file contains UNPUBLISHED PROPRIETARY SOURCE CODE.
13  ** The contents of this file may not be disclosed to third parties, copied
14  ** or duplicated in any form, in whole or in part, without the prior written
15  ** permission of the author.
16  **
17  *****************************************************************************/
18 #ifndef MNODECONFIGURATION_H
19 #define MNODECONFIGURATION_H
20 
21 #ifdef WIN32
22 // Windows definitions
23 #ifdef MCLIENTLIB_EXPORTS
24 #define MCLIENTLIB_API __declspec(dllexport)
25 #else
26 #define MCLIENTLIB_API __declspec(dllimport)
27 #endif
28 #else
29 
30 #ifndef MCLIENTLIB_EXPORTS
31 #ifdef LINUX
32 #define MCLIENTLIB_API
33 #else
34 #define MCLIENTLIB_API
35 #endif
36 #else
37 #define MCLIENTLIB_API
38 #endif
39 #endif
40 
41 #if defined(_WIN32)
42 #pragma warning(disable: 4251)
43 #endif // _WIN32
44 
45 #include <MClientLib/MError.h>
46 #include <MClientLib/MDriveMap.h>
47 #include <MClientLib/MTimeRule.h>
50 #include <MClientLib/MRepository.h>
51 
52 namespace MClientLib {
53 
58  private:
59  int numberOfInstances;
60  int defaultNodePriority;
61  std::vector<MClientLib::MPriorityOverride> prioritiesOverrides;
62  bool startPaused;
63  int defaultProcessPriority;
64  int processesStartTimeout;
65  bool killActivityOnConnectionDrop;
66  bool changePriorityOnProcessTree;
67  bool terminateProcessesTrees;
68  bool suppressErrorChecking;
69  public:
70  int getNumberOfInstances();
71  int getDefaultNodePriority();
72  std::vector<MClientLib::MPriorityOverride> getPrioritiesOverrides();
73  bool getStartPaused();
74  int getDefaultProcessPriority();
75  int getProcessesStartTimeout();
76  bool getKillActivityOnConnectionDrop();
77  bool getChangePriorityOnProcessTree();
78  bool getTerminateProcessesTrees();
79  bool getSuppressErrorChecking();
80 
81  void setNumberOfInstances(int);
82  void setDefaultNodePriority(int);
83  void setPrioritiesOverrides(std::vector<MClientLib::MPriorityOverride>);
84  void setStartPaused(bool);
85  void setDefaultProcessPriority(int);
86  void setProcessesStartTimeout(int);
87  void setKillActivityOnConnectionDrop(bool);
88  void setChangePriorityOnProcessTree(bool);
89  void setTerminateProcessesTrees(bool);
90  void setSuppressErrorChecking(bool);
91 
92  };
93 
98  private:
99  std::string processesLogsFolder;
100  int activityLogsSeverity;
101  std::string activityLogsFolder;
102  bool clearActivityLogsOlderThan;
103  int clearActivityLogsOlderThanDays;
104  bool clearActivityLogsExceeds;
105  int clearActivityLogsExceedsMB;
106  bool clearProcessesLogsOlderThan;
107  int clearProcessesLogsOlderThanDays;
108  bool clearProcessesLogsExceeds;
109  int clearProcessesLogsExceedsMB;
110  bool rescanLogFileSystem;
111  int rescanLogFileSystemSeconds;
112  public:
113  std::string getProcessesLogsFolder();
114  int getActivityLogsSeverity();
115  std::string getActivityLogsFolder();
116  bool getClearActivityLogsOlderThan();
117  int getClearActivityLogsOlderThanDays();
118  bool getClearActivityLogsExceeds();
119  int getClearActivityLogsExceedsMB();
120  bool getClearProcessesLogsOlderThan();
121  int getClearProcessesLogsOlderThanDays();
122  bool getClearProcessesLogsExceeds();
123  int getClearProcessesLogsExceedsMB();
124  bool getRescanLogFileSystem();
125  int getRescanLogFileSystemSeconds();
126 
127  void setProcessesLogsFolder(const std::string&);
128  void setActivityLogsSeverity(int);
129  void setActivityLogsFolder(const std::string&);
130  void setClearActivityLogsOlderThan(bool);
131  void setClearActivityLogsOlderThanDays(int);
132  void setClearActivityLogsExceeds(bool);
133  void setClearActivityLogsExceedsMB(int);
134  void setClearProcessesLogsOlderThan(bool);
135  void setClearProcessesLogsOlderThanDays(int);
136  void setClearProcessesLogsExceeds(bool);
137  void setClearProcessesLogsExceedsMB(int);
138  void setRescanLogFileSystem(bool);
139  void setRescanLogFileSystemSeconds(int);
140  };
141 
146  private:
147  std::string dispatcherAddress;
148  int dispatcherPort;
149  int connectionResolution;
150  int managementPort;
151  bool enableHeartbeat;
152  int enableHeartbeatResolution;
153  bool broadcastPresence;
154  int broadcastResolution;
155  bool protectedManagement;
156  std::string managementPassword;
157  std::string impersonationUsername;
158  std::string impersonationPassword;
159 
160 
161  public:
162  std::string getDispatcherAddress();
163  int getDispatcherPort();
164  int getConnectionResolution();
165  int getManagementPort();
166  bool getEnableHeartbeat();
167  int getEnableHeartbeatResolution();
168  bool getBroadcastPresence();
169  int getBroadcastResolution();
170  bool getProtectedManagement();
171  std::string getManagementPassword();
172  std::string getImpersonationUsername();
173  std::string getImpersonationPassword();
174 
175  void setDispatcherAddress(const std::string&);
176  void setDispatcherPort(int);
177  void setConnectionResolution(int);
178  void setManagementPort(int);
179  void setEnableHeartbeat(bool);
180  void setEnableHeartbeatResolution(int);
181  void setBroadcastPresence(bool);
182  void setBroadcastResolution(int);
183  void setProtectedManagement(bool);
184  void setManagementPassword(const std::string&);
185  void setImpersonationUsername(const std::string&);
186  void setImpersonationPassword(const std::string&);
187  };
188 
193  private:
194  bool enableNTAutomapping;
195  int automappingDisconnectionPolicy;
196  std::vector<MClientLib::MDriveMap> driveMappings;
197  std::string localSubstitutions;
198  public:
199  bool getEnableNTAutomapping();
200  int getAutomappingDisconnectionPolicy();
201  std::vector<MClientLib::MDriveMap> getDriveMappings();
202  std::string getLocalSubstitutions();
203 
204  void setEnableNTAutomapping(bool);
205  void setAutomappingDisconnectionPolicy(int);
206  void setDriveMappings(std::vector<MClientLib::MDriveMap>);
207  void setLocalSubstitutions(const std::string&);
208  };
209 
214  private:
215  std::vector<MClientLib::MTimeRule> timeRules;
216  bool checkLogin;
217  bool checkLoginRemote;
218  bool checkLoginWaitProcessTermination;
219  bool enableScreensaverControl;
220  bool enableRunningProcessesCheck;
221  bool enableNotRunningProcessesCheck;
222  std::string runningProcessesCheck;
223  std::string notRunningProcessesCheck;
224  bool timeRuleAvailableByDefault;
225  bool onTimeRuleWaitProcessTermination;
226  public:
227  std::vector<MClientLib::MTimeRule> getTimeRules();
228  bool getCheckLogin();
229  bool getCheckLoginRemote();
230  bool getCheckLoginWaitProcessTermination();
231  bool getEnableScreensaverControl();
232  bool getEnableRunningProcessesCheck();
233  bool getEnableNotRunningProcessesCheck();
234  std::string getRunningProcessesCheck();
235  std::string getNotRunningProcessesCheck();
236  bool getTimeRuleAvailableByDefault();
237  bool getOnTimeRuleWaitProcessTermination();
238 
239  void setTimeRules(std::vector<MClientLib::MTimeRule>);
240  void setCheckLogin(bool);
241  void setCheckLoginRemote(bool);
242  void setCheckLoginWaitProcessTermination(bool);
243  void setEnableScreensaverControl(bool);
244  void setEnableRunningProcessesCheck(bool);
245  void setEnableNotRunningProcessesCheck(bool);
246  void setRunningProcessesCheck(const std::string&);
247  void setNotRunningProcessesCheck(const std::string&);
248  void setTimeRuleAvailableByDefault(bool);
249  void setOnTimeRuleWaitProcessTermination(bool);
250  };
251 
256  private:
257  std::vector<MClientLib::MTimeRule> shutdownRules;
258  bool shutdownWithNoUsers;
259  bool shutdownTrackRemoteLogs;
260  bool shutdownWhenIdle;
261  int shutdownWhenIdleMinutes;
262  bool shutdownWhenPaused;
263  int shutdownWhenPausedMinutes;
264  int shutdownAction;
265  bool shutdownRulesMatchAvailability;
266  public:
267  std::vector<MClientLib::MTimeRule> getShutdownRules();
268  bool getShutdownWithNoUsers();
269  bool getShutdownTrackRemoteLogs();
270  bool getShutdownWhenIdle();
271  int getShutdownWhenIdleMinutes();
272  bool getShutdownWhenPaused();
273  int getShutdownWhenPausedMinutes();
274  int getShutdownAction();
275  bool getShutdownRulesMatchAvailability();
276 
277  void setShutdownRules(std::vector<MClientLib::MTimeRule>);
278  void setShutdownWithNoUsers(bool);
279  void setShutdownTrackRemoteLogs(bool);
280  void setShutdownWhenIdle(bool);
281  void setShutdownWhenIdleMinutes(int);
282  void setShutdownWhenPaused(bool);
283  void setShutdownWhenPausedMinutes(int);
284  void setShutdownAction(int);
285  void setShutdownRulesMatchAvailability(bool);
286  };
287 
292  private:
293  std::vector<MClientLib::MTimeRule> wakeupRules;
294  bool wakeupRulesMatchAvailability;
295  bool wakeupAtFullLoad;
296  bool wakeupWhenRequiredByPool;
297  public:
298  std::vector<MClientLib::MTimeRule> getWakeupRules();
299  bool getWakeupRulesMatchAvailability();
300  bool getWakeupAtFullLoad();
301  bool getWakeupWhenRequiredByPool();
302 
303  void setWakeupRules(std::vector<MClientLib::MTimeRule>);
304  void setWakeupRulesMatchAvailability(bool);
305  void setWakeupAtFullLoad(bool);
306  void setWakeupWhenRequiredByPool(bool);
307  };
308 
313  private:
314  std::vector<MClientLib::MTemplateVariable> templatesVariables;
315  public:
324  std::vector<MClientLib::MTemplateVariable> getTemplatesVariables();
325  void setTemplatesVariables(std::vector<MClientLib::MTemplateVariable>);
326  void setTemplateVariable(MClientLib::MTemplateVariable);
327 
328  bool Unmarshall(std::vector<std::string>& items);
329  std::string Marshall();
330  };
331 
332 
333 }
334 
335 #endif