Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

rmClient.h File Reference

#include <ResourceMonitor/ResourceMonitorTypes.h>
#include "rmClientTypes.h"

Go to the source code of this file.

Functions

int initRMClient ()
 initializes all the system information from ResourceMonitor Daemon. More...

void shutdownRMClient ()
int getRMVersion ()
 returns the version number of the ResourceMonitor Daemon. More...

int getInteger32 (RMEntity aEntity, RMAttribute aName, unsigned long aID, long *aValue)
 returns the integer value of a particular name in a particular entity. More...

int setInteger32 (RMEntity aEntity, RMAttribute aName, unsigned long aID, long aValue)
 sets the integer value of a particular name in a particular entity. More...

int getUnsigned (RMEntity aEntity, RMAttribute aName, unsigned long aID, unsigned long *aValue)
 returns the integer value of a particular name in a particular entity. More...

int setUnsigned (RMEntity aEntity, RMAttribute aName, unsigned long aID, unsigned long aValue)
 sets the integer value of a particular name in a particular entity. More...

int getUnsigned64 (RMEntity aEntity, RMAttribute aName, unsigned long aID, u_int64_t *aValue)
 returns the unsigned integer value of a particular name in a particular entity. More...

int setUnsigned64 (RMEntity aEntity, RMAttribute aName, unsigned long aID, u_int64_t aValue)
 sets the unsigned integer value of a particular name in a particular entity. More...

int getUUIDString (RMEntity aEntity, RMAttribute aName, unsigned long aID, char *aBuf)
 returns the UUID (in string format) of a particular name in an entity. More...

int getUUID (RMEntity aEntity, RMAttribute aName, unsigned long aID, uuid_t aUUID)
 returns the UUID of a particular name in an entity. More...

int setUUIDString (RMEntity aEntity, RMAttribute aName, unsigned long aID, char *aUUID)
 sets the UUID of a particular name in an entity. More...

int getString (RMEntity aEntity, RMAttribute aName, unsigned long aID, char **aBuf)
 gets the string of a particular named attribute in an entity. More...

int setString (RMEntity aEntity, RMAttribute aName, unsigned long aID, char *aBuf)
 gets the string of a particular named attribute in an entity. More...

int newEntry (RMEntity aEntity, unsigned long aID)
 create a new entry in an entity. More...

int deleteEntry (RMEntity aEntity, unsigned long aID)
 remove an entry in an entity. More...

unsigned long getNewId (RMEntity aEntity)
 get a valid ID for creating a new entry in an entity. More...

unsigned long getMaxId (RMEntity aEntity)
int findId (RMEntity aEntity, unsigned long aID)
 test if the ID represents a valid entry in an entity. More...

int getNextId (RMEntity aEntity, unsigned long aID, unsigned long *aNextID)
 find the next valid ID in an entity based on the ID supplied. More...

size_t getCount (RMEntity aEntity)
 returns the number of entries for an entity. More...

int getBinary (RMEntity aEntity, RMAttribute aName, unsigned long aID, char **aBuf, unsigned long *aLength)
 get binary data from Event Log. More...

void addEvent (posix_log_recid_t aRecid, unsigned long aId)
 add a ResourceMonitor event to the event queue. More...

void processEvents ()
 process all the ResourceMonitor events in the queue. More...


Function Documentation

void addEvent posix_log_recid_t    aRecid,
unsigned long    aId
 

add a ResourceMonitor event to the event queue.

Add a ResourceMonitor event into the event queue. ResourceMonitor events including: threshold monitor notifications, thresholdCancel monitor notifications, leakyBucket monitor notifications, Subsystem changes, Resource changes

Parameters:
aRecid  The recid (in the system EventLog) of this event.
aMonid  The monitor ID of this notification. Could be 0 if it is not a monitor event.
Returns:
no return.

Definition at line 1358 of file rmClient.cpp.

Referenced by catchNotificationEvent.

int deleteEntry RMEntity    aEntity,
unsigned long    aID
 

remove an entry in an entity.

Remove a new entry in the specified entity table using the id value.

Parameters:
aEntity  One of the entities listed in RMEntity.
aID  The ID value of the entry to be removed.
Returns:
RMCLIENT_SUCCESS if successful. RMCLIENT_ERROR_NOSUCHENTITY for invalid aEntity. specific error codes for other failure.

Definition at line 1239 of file rmClient.cpp.

Referenced by write_genericConfigStatus, write_genericControlStatus, write_leakyBucketConfigStatus, write_leakyBucketControlStatus, write_monitorCommand, write_thresholdConfigStatus, write_thresholdControlStatus, and write_watermarkConfigStatus.

int findId RMEntity    aEntity,
unsigned long    aID
 

test if the ID represents a valid entry in an entity.

Test if a particular id, aID, represents a valid entry in the entity table.

Parameters:
aEntity  One of the entities listed in RMEntity.
aID  The ID value of the entry.
Returns:
RMCLIENT_SUCCESS if successful. RMCLIENT_ERROR_NOSUCHENTITY for invalid aEntity. specific error codes for other failure.

Definition at line 1273 of file rmClient.cpp.

Referenced by header_MyGeneric, and header_writeGeneric.

int getBinary RMEntity    aEntity,
RMAttribute    aName,
unsigned long    aID,
char **    aBuf,
unsigned long *    aLength
 

get binary data from Event Log.

Get the binary string of a particular named attribute of an entity.

Parameters:
aEntity  One of the entities listed in RMEntity.
aID  The ID value of the entry.
aBuf  Pointer to the binary string buffer.
aLength  length of the binary string buffer.
Returns:
RMCLIENT_SUCCESS if successful. RMCLIENT_ERROR_NOSUCHENTITY for invalid aEntity. specific error codes for other failure.
Remarks:
only EVENTLOG table implemented this function. Like getString(), memory is allocated on the heap as well. So caller has to free() afterwards.
See also:
getString().

Definition at line 1334 of file rmClient.cpp.

size_t getCount RMEntity    aEntity
 

returns the number of entries for an entity.

Get the number of entries in entity table.

Parameters:
aEntity  One of the entities listed in RMEntity.
Returns:
the entity table size.

Definition at line 1309 of file rmClient.cpp.

Referenced by var_RMDataCapturePluginInfoTable, and var_RMSystemInfo.

int getInteger32 RMEntity    aEntity,
RMAttribute    aName,
unsigned long    aID,
long *    aValue
 

returns the integer value of a particular name in a particular entity.

Get the value of a particular named attribute in a particular entity. The data type must be 'long', or a 32 bit integer in this case.

Parameters:
aEntity  One of the entities listed in RMEntity.
aName  One of the names listed in RMAttribute.
aID  One of the entries in the table for aEntity.
aValue  Pointer to the integer value.
Returns:
RMCLIENT_SUCCESS if successful. RMCLIENT_ERROR_NOSUCHENTITY for invalid aEntity. RMCLIENT_ERROR_NOSUCHNAME for invalid aName. specific entity error code for other failure.
Remarks:
Entities have attributes associated with them. Every attribute has its own data type. They are documented in rmClientTypes.h file. Instead of creating a function for every operation on every attributes, this function can be applied to all the attributes with the same data type.

Definition at line 888 of file rmClient.cpp.

Referenced by rmEvent::getEventType, var_GenericConfigTable, var_GenericControlTable, var_LeakyBucketConfigTable, var_LeakyBucketControlTable, var_MonitorTable, var_RMStatisticInfoTable, var_ThresholdConfigTable, var_ThresholdControlTable, var_WatermarkConfigTable, write_genericConfigMonitorType, write_genericConfigStatus, write_genericControlMonitorType, write_genericControlStatus, write_genericMonitorLocation, write_genericStatisticTransform, write_leakyBucketConfigStatus, write_leakyBucketControlStatus, write_leakyBucketEventSeverity, write_monitorSNMPTrap, write_thresholdCancelEventSeverity, write_thresholdConfigStatus, write_thresholdControlStatus, write_thresholdEventSeverity, write_thresholdPreCondition, write_thresholdTestCondition, write_thresholdType, write_watermarkConfigStatus, and write_watermarkType.

unsigned long getMaxId RMEntity    aEntity
 

unsigned long getNewId RMEntity    aEntity
 

get a valid ID for creating a new entry in an entity.

Get the id value of the next new entry in the entity table.

Parameters:
aEntity  One of the entities listed in RMEntity.
Returns:
positive id value.

Definition at line 1254 of file rmClient.cpp.

Referenced by header_writeGeneric, var_RMGenericConfig, var_RMGenericControl, var_RMLeakyBucketConfig, var_RMLeakyBucketControl, var_RMMonitors, var_RMThresholdConfig, var_RMThresholdControl, and var_RMWatermarkConfig.

int getNextId RMEntity    aEntity,
unsigned long    aID,
unsigned long *    aNextID
 

find the next valid ID in an entity based on the ID supplied.

Find the next valid ID in the entity table, which means the first entry in the table whose id value is greater than the aID.

Parameters:
aEntity  One of the entities listed in RMEntity.
aID  The ID value of the entry.
aNextID  Pointer to the next valid id in the table.
Returns:
RMCLIENT_SUCCESS if successful. RMCLIENT_ERROR_NOSUCHENTITY for invalid aEntity. specific error codes for other failure.

Definition at line 1293 of file rmClient.cpp.

Referenced by findStatisticID, header_MyGeneric, header_resourceInfo, and header_statisticInfo.

int getRMVersion  
 

returns the version number of the ResourceMonitor Daemon.

Returns the ResourceMonitor version number.

Definition at line 853 of file rmClient.cpp.

int getString RMEntity    aEntity,
RMAttribute    aName,
unsigned long    aID,
char **    aBuf
 

gets the string of a particular named attribute in an entity.

Get the string value of a particular named attribute in a particular entity. The data type must be 'char *'.

Parameters:
aEntity  One of the entities listed in RMEntity.
aName  One of the names listed in RMAttribute.
aID  One of the entries in the table for aEntity.
aBuf  Pointer to the char buffer that holds the string.
Returns:
RMCLIENT_SUCCESS if successful. RMCLIENT_ERROR_NOSUCHENTITY for invalid aEntity. RMCLIENT_ERROR_NOSUCHNAME for invalid aName. specific entity error code for other failure.
Remarks:
Memory is allocated on the heap. So caller has to call free() afterwards.
See also:
setString().

Definition at line 1172 of file rmClient.cpp.

Referenced by rmEvent::getEventText, rmEvent::sendResourceEvent, rmEvent::sendSubSystemEvent, var_RMDataCapturePluginInfoTable, var_RMResourceInfoTable, var_RMStatisticInfoTable, and var_RMSubsystemInfoTable.

int getUnsigned RMEntity    aEntity,
RMAttribute    aName,
unsigned long    aID,
unsigned long *    aValue
 

returns the integer value of a particular name in a particular entity.

Get the value of a particular named attribute in a particular entity. The data type must be 'unsigned long', or a 32 bit unsigned integer in this case.

Parameters:
aEntity  One of the entities listed in RMEntity.
aName  One of the names listed in RMAttribute.
aID  One of the entries in the table for aEntity.
aValue  Pointer to the unsigned integer value.
Returns:
RMCLIENT_SUCCESS if successful. RMCLIENT_ERROR_NOSUCHENTITY for invalid aEntity. RMCLIENT_ERROR_NOSUCHNAME for invalid aName. specific entity error code for other failure.
Remarks:
Entities have attributes associated with them. Every attribute has its own data type. They are documented in rmClientTypes.h file. Instead of creating a function for every operation on every attributes, this function can be applied to all the attributes with the same data type.

Definition at line 945 of file rmClient.cpp.

Referenced by findStatisticID, header_resourceInfo, header_statisticInfo, rmEvent::sendMonitorEvent, var_GenericConfigTable, var_GenericControlTable, var_LeakyBucketConfigTable, var_MonitorTable, var_RMStatisticInfoTable, var_RMSubsystemInfoTable, var_ThresholdConfigTable, var_ThresholdControlTable, write_genericLeakyBucketConfigIndex, write_genericLeakyBucketControlIndex, write_genericMonitorLifeTime, write_genericMonitorMicroRate, write_genericMonitorRate, write_genericResourceID, write_genericStatisticID, write_genericSubsystemID, write_genericThresholdConfigIndex, write_genericThresholdControlIndex, write_genericWatermarkConfigIndex, write_leakyBucketFillValueLow, write_leakyBucketLoggingRate, write_leakyBucketSizeValueLow, write_monitorConfigIndex, write_monitorControlIndex, write_statisticCounterResetValueLow, write_thresholdLogRate, write_thresholdSampleTimes, write_thresholdToleranceValueLow, and write_thresholdValueLow.

int getUnsigned64 RMEntity    aEntity,
RMAttribute    aName,
unsigned long    aID,
u_int64_t *    aValue
 

returns the unsigned integer value of a particular name in a particular entity.

Get the value of a particular named attribute in a particular entity. The data type must be 'unsigned long long', or a 64 bit unsigned integer in this case.

Parameters:
aEntity  One of the entities listed in RMEntity.
aName  One of the names listed in RMAttribute.
aID  One of the entries in the table for aEntity.
aValue  Pointer to the unsigned integer value.
Returns:
RMCLIENT_SUCCESS if successful. RMCLIENT_ERROR_NOSUCHENTITY for invalid aEntity. RMCLIENT_ERROR_NOSUCHNAME for invalid aName. specific entity error code for other failure.
Remarks:
Entities have attributes associated with them. Every attribute has its own data type. They are documented in rmClientTypes.h file. Instead of creating a function for every operation on every attributes, this function can be applied to all the attributes with the same data type.

Definition at line 1003 of file rmClient.cpp.

Referenced by var_LeakyBucketConfigTable, var_MonitorTable, var_RMStatisticInfoTable, var_ThresholdConfigTable, var_ThresholdControlTable, write_leakyBucketFillValueHigh, write_leakyBucketSizeValueHigh, write_statisticCounterResetValueHigh, write_thresholdToleranceValueHigh, and write_thresholdValueHigh.

int getUUID RMEntity    aEntity,
RMAttribute    aName,
unsigned long    aID,
uuid_t    aUUID
 

returns the UUID of a particular name in an entity.

Get the value of a particular named attribute in a particular entity. The data type must be 'uuid_t'.

rmClient library provides two ways of retreving a uuid.

  • via the native uuid data format uuid_t
  • via the string format
If the uuid_t format is desired, caller provide a pointer which point to an uuid_t variable. The value of the named attribute will then be stored in aUUID.
Parameters:
aEntity  One of the entities listed in RMEntity.
aName  One of the names listed in RMAttribute.
aID  One of the entries in the table for aEntity.
aUUID  Pointer to the uuid_t variable supplied by caller.
Returns:
RMCLIENT_SUCCESS if successful. RMCLIENT_ERROR_NOSUCHENTITY for invalid aEntity. RMCLIENT_ERROR_NOSUCHNAME for invalid aName. specific entity error code for other failure.
Remarks:
Entities have attributes associated with them. Every attribute has its own data type. They are documented in rmClientTypes.h file. Instead of creating a function for every operation on every attributes, this function can be applied to all the attributes with the same data type.
See also:
getUUIDString().

Definition at line 1114 of file rmClient.cpp.

int getUUIDString RMEntity    aEntity,
RMAttribute    aName,
unsigned long    aID,
char *    aBuf
 

returns the UUID (in string format) of a particular name in an entity.

Get the value of a particular named attribute in a particular entity. The data type must be 'uuid_t'.

rmClient library provides two ways of retreving a uuid.

  • via the native uuid data format uuid_t
  • via the string format
If the string format is desired, caller provide a buffer which is long enough to hold UUID_STRING_LENGTH. This function will convert the named attribute from uuid_t into a c string, which will be stored in aBuf.
Parameters:
aEntity  One of the entities listed in RMEntity.
aName  One of the names listed in RMAttribute.
aID  One of the entries in the table for aEntity.
aBuf  Pointer to the char buffer that is long enough for UUID_STRING_LENGTH.
Returns:
RMCLIENT_SUCCESS if successful. RMCLIENT_ERROR_NOSUCHENTITY for invalid aEntity. RMCLIENT_ERROR_NOSUCHNAME for invalid aName. specific entity error code for other failure.
Remarks:
Entities have attributes associated with them. Every attribute has its own data type. They are documented in rmClientTypes.h file. Instead of creating a function for every operation on every attributes, this function can be applied to all the attributes with the same data type.
See also:
getUUID().

Definition at line 1074 of file rmClient.cpp.

Referenced by var_GenericControlTable, var_MonitorTable, var_RMDataCapturePluginInfoTable, var_RMSubsystemInfoTable, write_genericDataCaptureUUID, and write_genericMonitorUUID.

int initRMClient  
 

initializes all the system information from ResourceMonitor Daemon.

Definition at line 826 of file rmClient.cpp.

int newEntry RMEntity    aEntity,
unsigned long    aID
 

create a new entry in an entity.

Create a new entry in the specified entity table using the id value.

Precondition:
To create a new entry, caller must first call getNewId() to get the id value of the next entry.
Parameters:
aEntity  One of the entities listed in RMEntity.
aID  The ID value of the new entry.
Returns:
RMCLIENT_SUCCESS if successful. RMCLIENT_ERROR_NOSUCHENTITY for invalid aEntity. specific error codes for other failure.
See also:
getNewId().

Definition at line 1221 of file rmClient.cpp.

Referenced by write_genericConfigStatus, write_genericControlStatus, write_leakyBucketConfigStatus, write_leakyBucketControlStatus, write_monitorCommand, write_thresholdConfigStatus, write_thresholdControlStatus, and write_watermarkConfigStatus.

void processEvents  
 

process all the ResourceMonitor events in the queue.

Process all the events in the ResourceMonitor event queue.

Returns:
no return.

Definition at line 1372 of file rmClient.cpp.

int setInteger32 RMEntity    aEntity,
RMAttribute    aName,
unsigned long    aID,
long    aValue
 

sets the integer value of a particular name in a particular entity.

Set the value of a particular named attribute in a particular entity. The data type must be 'long', or a 32 bit integer in this case.

Parameters:
aEntity  One of the entities listed in RMEntity.
aName  One of the names listed in RMAttribute.
aID  One of the entries in the table for aEntity.
aValue  Integer value to be set.
Returns:
RMCLIENT_SUCCESS if successful. RMCLIENT_ERROR_NOSUCHENTITY for invalid aEntity. RMCLIENT_ERROR_NOSUCHNAME for invalid aName. specific entity error code for other failure.
Remarks:
Entities have attributes associated with them. Every attribute has its own data type. They are documented in rmClientTypes.h file. Instead of creating a function for every operation on every attributes, this function can be applied to all the attributes with the same data type.

Definition at line 916 of file rmClient.cpp.

Referenced by write_genericConfigMonitorType, write_genericConfigStatus, write_genericControlMonitorType, write_genericControlStatus, write_genericMonitorLocation, write_genericStatisticTransform, write_leakyBucketConfigStatus, write_leakyBucketControlStatus, write_leakyBucketEventSeverity, write_monitorCommand, write_monitorSNMPTrap, write_statisticCounterReset, write_thresholdCancelEventSeverity, write_thresholdConfigStatus, write_thresholdControlStatus, write_thresholdEventSeverity, write_thresholdPreCondition, write_thresholdTestCondition, write_thresholdType, write_watermarkConfigStatus, and write_watermarkType.

int setString RMEntity    aEntity,
RMAttribute    aName,
unsigned long    aID,
char *    aBuf
 

gets the string of a particular named attribute in an entity.

Set the string value of a particular named attribute in a particular entity. The data type must be 'char *'.

Parameters:
aEntity  One of the entities listed in RMEntity.
aName  One of the names listed in RMAttribute.
aID  One of the entries in the table for aEntity.
aBuf  Pointer to the char buffer that holds the string.
Returns:
RMCLIENT_SUCCESS if successful. RMCLIENT_ERROR_NOSUCHENTITY for invalid aEntity. RMCLIENT_ERROR_NOSUCHNAME for invalid aName. specific entity error code for other failure.
See also:
setString().

Definition at line 1197 of file rmClient.cpp.

int setUnsigned RMEntity    aEntity,
RMAttribute    aName,
unsigned long    aID,
unsigned long    aValue
 

sets the integer value of a particular name in a particular entity.

Set the value of a particular named attribute in a particular entity. The data type must be 'unsigned long', or a 32 bit unsigned integer in this case.

Parameters:
aEntity  One of the entities listed in RMEntity.
aName  One of the names listed in RMAttribute.
aID  One of the entries in the table for aEntity.
aValue  Intended unsigned integer value.
Returns:
RMCLIENT_SUCCESS if successful. RMCLIENT_ERROR_NOSUCHENTITY for invalid aEntity. RMCLIENT_ERROR_NOSUCHNAME for invalid aName. specific entity error code for other failure.
Remarks:
Entities have attributes associated with them. Every attribute has its own data type. They are documented in rmClientTypes.h file. Instead of creating a function for every operation on every attributes, this function can be applied to all the attributes with the same data type.

Definition at line 974 of file rmClient.cpp.

Referenced by write_genericLeakyBucketConfigIndex, write_genericLeakyBucketControlIndex, write_genericMonitorLifeTime, write_genericMonitorMicroRate, write_genericMonitorRate, write_genericResourceID, write_genericStatisticID, write_genericSubsystemID, write_genericThresholdConfigIndex, write_genericThresholdControlIndex, write_genericWatermarkConfigIndex, write_leakyBucketFillValueLow, write_leakyBucketLoggingRate, write_leakyBucketSizeValueLow, write_monitorConfigIndex, write_monitorControlIndex, write_statisticCounterResetValueLow, write_thresholdLogRate, write_thresholdSampleTimes, write_thresholdToleranceValueLow, and write_thresholdValueLow.

int setUnsigned64 RMEntity    aEntity,
RMAttribute    aName,
unsigned long    aID,
u_int64_t    aValue
 

sets the unsigned integer value of a particular name in a particular entity.

Set the value of a particular named attribute in a particular entity. The data type must be 'unsigned long long', or a 64 bit unsigned integer in this case.

Parameters:
aEntity  One of the entities listed in RMEntity.
aName  One of the names listed in RMAttribute.
aID  One of the entries in the table for aEntity.
aValue  Pointer to the unsigned integer value.
Returns:
RMCLIENT_SUCCESS if successful. RMCLIENT_ERROR_NOSUCHENTITY for invalid aEntity. RMCLIENT_ERROR_NOSUCHNAME for invalid aName. specific entity error code for other failure.
Remarks:
Entities have attributes associated with them. Every attribute has its own data type. They are documented in rmClientTypes.h file. Instead of creating a function for every operation on every attributes, this function can be applied to all the attributes with the same data type.

Definition at line 1032 of file rmClient.cpp.

Referenced by write_leakyBucketFillValueHigh, write_leakyBucketSizeValueHigh, write_statisticCounterResetValueHigh, write_thresholdToleranceValueHigh, and write_thresholdValueHigh.

int setUUIDString RMEntity    aEntity,
RMAttribute    aName,
unsigned long    aID,
char *    aUUID
 

sets the UUID of a particular name in an entity.

Set the value of a particular named attribute in a particular entity. The data type must be 'uuid_t'.

Parameters:
aEntity  One of the entities listed in RMEntity.
aName  One of the names listed in RMAttribute.
aID  One of the entries in the table for aEntity.
aUUID  Pointer to the char buffer that holds the string representation of the uuid.
Returns:
RMCLIENT_SUCCESS if successful. RMCLIENT_ERROR_NOSUCHENTITY for invalid aEntity. RMCLIENT_ERROR_NOSUCHNAME for invalid aName. specific entity error code for other failure.
Remarks:
Entities have attributes associated with them. Every attribute has its own data type. They are documented in rmClientTypes.h file. Instead of creating a function for every operation on every attributes, this function can be applied to all the attributes with the same data type.
See also:
getUUIDString().

Definition at line 1145 of file rmClient.cpp.

Referenced by write_genericDataCaptureUUID, and write_genericMonitorUUID.

void shutdownRMClient  
 

Shutdown the ResourceMonitor Client by destructing all the tables and the event queue that the client used.

Returns:
no return.

Definition at line 842 of file rmClient.cpp.


Generated on Tue Sep 10 16:46:33 2002 for ResourceMonitorSNMPSubagent by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002