The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ResourceCmd class

Class implementing resource commands. More...

Collaboration diagram for ResourceCmd class:

Modules

 ResourceLSB class
 Class implementing resource commands.
 
 ResourceOCF class
 Class implementing resource commands.
 

Functions

FSTATIC void _resourcecmd_finalize (AssimObj *aself)
 Finalize function for ResourceCmd objects. More...
 
FSTATIC void _resourcecmd_execute (ResourceCmd *self)
 Moan and complain - abstract class. More...
 
ResourceCmdresourcecmd_new (ConfigContext *request, gpointer user_data, ResourceCmdCallback callback)
 Our ResourceCmd Factory object - constructs an object of the proper subclass for the given instantiation parameters. More...
 
ResourceCmdresourcecmd_constructor (guint structsize, ConfigContext *request, gpointer user_data, ResourceCmdCallback callback)
 Constructor (_new function) for ResourceCmd "abstract" class. More...
 
typedef void(* ResourceCmdCallback )(ConfigContext *request, gpointer user_data, enum HowDied reason, int rc, int signal, gboolean core_dumped, const char *stringresult)
 

Detailed Description

Class implementing resource commands.

Typedef Documentation

typedef void(* ResourceCmdCallback)(ConfigContext *request, gpointer user_data, enum HowDied reason, int rc, int signal, gboolean core_dumped, const char *stringresult)

It does not implement any queueing, repeating events or such things. It creates an object which will execute the resource action immediately when asked. If this class invoked without any sort of queueing mechanism, or other safeguards it can break the semantics of the underlying resources.

Resources are expected to assume that no more than one resource action can be active at a time for any given resource instance.

Definition at line 44 of file resourcecmd.h.

Function Documentation

FSTATIC void _resourcecmd_execute ( ResourceCmd self)

Moan and complain - abstract class.

Moan and complain - we're an abstract class.

Definition at line 158 of file resourcecmd.c.

References __FUNCTION__.

Referenced by resourcecmd_constructor().

Here is the caller graph for this function:

void _resourcecmd_finalize ( AssimObj aself)

Finalize function for ResourceCmd objects.

Definition at line 96 of file resourcecmd.c.

References _assimobj_finalize(), CASTTOCLASS, and UNREF.

Referenced by resourcecmd_constructor().

Here is the call graph for this function:

Here is the caller graph for this function:

ResourceCmd* resourcecmd_constructor ( guint  structsize,
ConfigContext request,
gpointer  user_data,
ResourceCmdCallback  callback 
)

Constructor (_new function) for ResourceCmd "abstract" class.

Parameters
structsizeStructure size (or zero)
requestRequest to instantiate
user_dataUser data for 'callback'
callbackCallback when complete

Definition at line 111 of file resourcecmd.c.

References __FUNCTION__, _AssimObj::_finalize, _resourcecmd_execute(), _resourcecmd_finalize(), assimobj_new(), _ConfigContext::baseclass, BINDDEBUG, _ConfigContext::getstring, NEWSUBCLASS, REF, REQOPERATIONNAMEFIELD, REQRSCNAMEFIELD, and _AssimObj::toString.

Referenced by resourcelsb_new(), and resourceocf_new().

Here is the call graph for this function:

Here is the caller graph for this function:

ResourceCmd* resourcecmd_new ( ConfigContext request,
gpointer  user_data,
ResourceCmdCallback  callback 
)

Our ResourceCmd Factory object - constructs an object of the proper subclass for the given instantiation parameters.

We only pay attention to the REQCLASSNAMEFIELD field at the top level of the request ConfigContext object.

Parameters
requestRequest to instantiate
user_dataUser data for 'callback'
callbackCallback when complete

Definition at line 63 of file resourcecmd.c.

References __FUNCTION__, _ConfigContext::baseclass, classname, DIMOF, _ConfigContext::getstring, REQCLASSNAMEFIELD, and _AssimObj::toString.

Referenced by _resource_queue_Qcmd(), test_invalid_resourcecmd(), and test_safe_ocfops().

Here is the caller graph for this function:

Variable Documentation

const { ... } classname

Definition at line 44 of file resourcecmd.c.

ResourceCmd*(* { ... } constructor)(guint structsize, ConfigContext *request, gpointer user_data, ResourceCmdCallback callback)

Definition at line 45 of file resourcecmd.c.