The Sequence Toolkit
www.sequence-toolkit.com |
#include "stk_env.h"
#include "stk_service.h"
#include "stk_sequence.h"
#include "stk_data_flow.h"
#include "stk_common.h"
#include "stk_smartbeat.h"
Go to the source code of this file.
The Service API defines the mechanism by which services can comme in to existance and subsequently be destroyed.
stk_service_t* stk_create_service | ( | stk_env_t * | env, |
char * | name, | ||
stk_service_id | id, | ||
stk_service_type | type, | ||
stk_options_t * | options | ||
) |
Create a Sequence Service
stk_ret stk_destroy_service | ( | stk_service_t * | svc, |
stk_service_state * | last_state | ||
) |
Destroy a Sequence Service
svc | The service to be destroyed |
last_state | An optional pointer to the last state to be reported for this service. If NULL, STOPPED will be used as the last state |
stk_env_t* stk_env_from_service | ( | stk_service_t * | svc | ) |
Get the STK env from a service
stk_data_flow_t* stk_get_monitoring_df | ( | stk_service_t * | svc | ) |
Get the services monitoring df
stk_data_flow_t* stk_get_notification_df | ( | stk_service_t * | svc | ) |
Get the services notification df
stk_uint32 stk_get_service_activity_tmo | ( | stk_service_t * | svc | ) |
Get the activity timeout for this service
stk_service_id stk_get_service_id | ( | stk_service_t * | svc | ) |
Get the Service ID
char* stk_get_service_name | ( | stk_service_t * | svc | ) |
Get the name of a Service
stk_options_t* stk_get_service_options | ( | stk_service_t * | svc | ) |
Get the options for a service
void stk_get_service_smartbeat | ( | stk_service_t * | svc, |
stk_smartbeat_t * | smb | ||
) |
Get a copy of the service's current smartbeat
stk_service_state stk_get_service_state | ( | stk_service_t * | svc | ) |
Get the state of a Service
void stk_get_service_state_str | ( | stk_service_t * | svc, |
stk_service_state | state, | ||
char * | state_str, | ||
size_t | size | ||
) |
Get a copy of the string associated with a state for a service. Will return an int (decimal) in string form if there is no known name.
stk_service_type stk_get_service_type | ( | stk_service_t * | svc | ) |
Get the type of a Service
void stk_service_update_smartbeat | ( | stk_service_t * | svc, |
stk_smartbeat_t * | smartbeat | ||
) |
The stk_service_update_smartbeat() function updates the services smartbeat with the value passed in
void stk_service_update_smartbeat_checkpoint | ( | stk_service_t * | svc, |
stk_checkpoint_t | checkpoint | ||
) |
The stk_service_update_smartbeat_checkpoint() function updates the last checkpoint.
stk_ret stk_set_service_state | ( | stk_service_t * | svc, |
stk_service_state | state | ||
) |
Set the state of a Service
void stk_set_service_state_str | ( | stk_service_t * | svc, |
stk_service_state | state, | ||
char * | state_str, | ||
size_t | size | ||
) |
Add a state name to the state table for a service. This will replace any existing entry. It is the application responsibility to track any dynamic memory used to store names (and detect when they are replaced).
stk_data_flow_t** stk_svc_get_smartbeat_flows | ( | stk_service_t * | svc | ) |
Get array of flows that need to be sent to for heartbeats. Array ends with NULL Caller must free returned data with free()