The Assimilation Project  based on Assimilation version
Go to the documentation of this file.
26 #ifndef _RESOURCECMD_H
27 #define _RESOURCECMD_H
28 #include <projectcommon.h>
29 #include <assimobj.h>
30 #include <configcontext.h>
31 #include <childprocess.h>
44 typedef void(*ResourceCmdCallback)(ConfigContext* request, gpointer user_data
45 , enum HowDied reason, int rc, int signal, gboolean core_dumped
46 , const char * stringresult);
48 typedef struct _ResourceCmd ResourceCmd;
50 struct _ResourceCmd{
52  gint64 starttime;
53  gint64 endtime;
56  gpointer user_data;
58  void (*execute)(ResourceCmd* self);
59  const char * resourcename;
60  const char * operation;
61  char* loggingname;
62  guint32 timeout_secs;
63  gboolean is_running;
64  gboolean last_success;
65 };
69 #define REQCLASSNAMEFIELD "class"
70 #define REQPROVIDERNAMEFIELD "provider"
71 #define REQOPERATIONNAMEFIELD "operation"
72 #define REQENVIRONNAMEFIELD "environ"
73 #define REQREPEATNAMEFIELD "repeat"
74 #define REQCANCELONFAILFIELD "cancel_on_fail"
76 #define REQREASONENUMNAMEFIELD "reason_enum"
77 #define REQRCNAMEFIELD "rc"
78 #define REQSIGNALNAMEFIELD "signal"
79 #define REQCOREDUMPNAMEFIELD "coredumped"
80 #define REQSTRINGRETNAMEFIELD "stringret"
81 #define REQARGVNAMEFIELD "argv"
83 #define MONITOROP "monitor"
84 #define METADATAOP "meta-data"
90 #endif
91 #endif/*_RESOURCECMD_H*/
void(* ResourceCmdCallback)(ConfigContext *request, gpointer user_data, enum HowDied reason, int rc, int signal, gboolean core_dumped, const char *stringresult)
Definition: resourcecmd.h:44
gboolean is_running
TRUE if this resource agent is running.
Definition: resourcecmd.h:63
void(* execute)(ResourceCmd *self)
Execute this resource command.
Definition: resourcecmd.h:58
Definition: projectcommon.h:45
int signal
Definition: childprocess.c:238
This file defines our base object class: AssimObj.
ResourceCmd * resourcecmd_constructor(guint structsize, ConfigContext *request, gpointer user_data, ResourceCmdCallback callback)
Constructor (_new function) for ResourceCmd "abstract" class.
Definition: resourcecmd.c:113
gint64 endtime
Time when it completed.
Definition: resourcecmd.h:54
ResourceCmdCallback callback
Callback to call when request is complete.
Definition: resourcecmd.h:57
gint64 starttime
Time to start it next (or when it started if it&#39;s now running)
Definition: resourcecmd.h:52
const char * operation
Operation being performed.
Definition: resourcecmd.h:60
Project common header file.
Implements Configuration Context class.
AssimObj baseclass
Base object: implements ref, unref, toString.
Definition: resourcecmd.h:51
const char * resourcename
Name of this resource.
Definition: resourcecmd.h:59
gboolean last_success
TRUE if previous operation was successful.
Definition: resourcecmd.h:64
Definition: childprocess.h:35
ResourceCmd * resourcecmd_new(ConfigContext *request, gpointer user_data, ResourceCmdCallback callback)
Our ResourceCmd Factory object - constructs an object of the proper subclass for the given instantiat...
Definition: resourcecmd.c:65
guint32 timeout_secs
Timeout for this operation (secs)
Definition: resourcecmd.h:62
gpointer user_data
User data for the request.
Definition: resourcecmd.h:56
Implements Child Process class.
FSTATIC void _resourcecmd_finalize(AssimObj *)
Finalize function for ResourceCmd objects.
Definition: resourcecmd.c:98
ConfigContext * request
The request.
Definition: resourcecmd.h:55
char * loggingname
Definition: resourcecmd.h:61