OSM_ACT_ORASQLQuery Class Reference

This action can execute a Query against an Oracle Database. More...

#include <osm_ag_oracle.h>

Inheritance diagram for OSM_ACT_ORASQLQuery:

Inheritance graph
[legend]
Collaboration diagram for OSM_ACT_ORASQLQuery:

Collaboration graph
[legend]
List of all members.

Public Types

enum  { MAXQUERYLEN = 1024 }
enum  tagTYPQUERY { NUM1_TEXT0 = 0, NUM1_TEXT1 = 1, NUM0_TEXT1 = 2 }
 Query return Types.
enum  { OSM_MAX_ACTION_NAME_LEN = 8 }

Public Member Functions

 OSM_ACT_ORASQLQuery ()
 Constructor.
virtual int execute (const ACE_TCHAR *cmd_line, const int cmd_len, const int timeout, ACE_TCHAR *val_text, int &val_len, int &value)
virtual int check_cmd_line (const ACE_TCHAR *cmd_line, const int cmd_len)
int is_name (const ACE_TCHAR *nm)
 Returns 1 if the name of the action is equal to the name in the parameter.
void set_name (const ACE_TCHAR *nm)
void instance (OSM_Instance_Base *ins)
const OSM_Instance_Baseinstance (void) const
void ev_parameters (const ACE_TCHAR *param)
const ACE_TCHAR * ev_parameters (void) const
const ACE_TCHAR * name (void) const

Public Attributes

enum OSM_ACT_ORASQLQuery::tagTYPQUERY TYPQUERY
 Query return Types.

Detailed Description

This action can execute a Query against an Oracle Database.

We derive this class from OSM_Action_Base so we can use it automatically within the Osmius monitoring or recollecting framework. We only have to implement the execute action using our base clase execute() method interface, and do the same with check_cmd_line() method.

Definition at line 75 of file osm_ag_oracle.h.


Member Function Documentation

int OSM_ACT_ORASQLQuery::execute ( const ACE_TCHAR *  cmd_line,
const int  cmd_len,
const int  timeout,
ACE_TCHAR *  val_text,
int &  val_len,
int &  value 
) [virtual]

Executes the action using the command line and returns the associated text and value.

Parameters:
cmd_line Input - Command line used to execute this action.
cmd_len Input - Command line length.
timeout Input - Wait timeout seconds before aborting execution.
val_text Output - Text of the resulting action.
val_len Output - Text length.
value Output - Final value of the action.
Return values:
-1 in case of error. 0 for success.

Implements OSM_Action_Base.

Definition at line 784 of file osm_ag_oracle.cpp.

References OSM_Instance_Oracle::con().

Here is the call graph for this function:

int OSM_ACT_ORASQLQuery::check_cmd_line ( const ACE_TCHAR *  cmd_line,
const int  cmd_len 
) [virtual]

Checks the command line. You should overwrite this method to handle issues like semantic and sintactic checking or security stuff. E.g. You could return error if your SQL string contains the words UPDATE, DELETE or INSERT.

Parameters:
cmd_line Input - Command line used to execute this action.
cmd_len Input - Command line length.
Return values:
-1 in case of error. 0 for success.

Reimplemented from OSM_Action_Base.

Definition at line 928 of file osm_ag_oracle.cpp.

void OSM_Action_Base::set_name ( const ACE_TCHAR *  nm  )  [inline, inherited]

Sets the name of the action.

Parameters:
nm Input - Name.

Definition at line 116 of file osm_ag_insmanager.h.

Referenced by OSM_Event::open().

void OSM_Action_Base::instance ( OSM_Instance_Base ins  )  [inline, inherited]

Sets the instance.

Parameters:
ins Input - Instance pointer.

Definition at line 126 of file osm_ag_insmanager.h.

const OSM_Instance_Base* OSM_Action_Base::instance ( void   )  const [inline, inherited]

Return a pointer to the instance.

Definition at line 134 of file osm_ag_insmanager.h.

void OSM_Action_Base::ev_parameters ( const ACE_TCHAR *  param  )  [inline, inherited]

Sets the parameters used in our Event config file.

Parameters:
param Input - Parameters (command line like).

Definition at line 143 of file osm_ag_insmanager.h.

Referenced by OSM_Event::open().

const ACE_TCHAR* OSM_Action_Base::ev_parameters ( void   )  const [inline, inherited]

Return pointer to parameters.

Definition at line 152 of file osm_ag_insmanager.h.

const ACE_TCHAR* OSM_Action_Base::name ( void   )  const [inline, inherited]

Return pointer to my name.

Definition at line 160 of file osm_ag_insmanager.h.


The documentation for this class was generated from the following files:
Generated on Thu Feb 21 18:39:34 2008 for Osmius by  doxygen 1.5.1