Diffusion C API  6.1.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
svc-update.h File Reference

Functions for registering an update source and providing updates to topics. More...

Data Structures

struct  svc_update_registration_request_s
 Structure describing a request to register a topic update source. More...
 
struct  svc_update_registration_response_s
 Structure describing the response to a topic update registration request. More...
 
struct  svc_update_deregistration_request_s
 Structure describing a request to deregister a topic update source. More...
 
struct  svc_update_deregistration_response_s
 Structure describing the response to a topic update deregistration request. More...
 
struct  svc_update_request_s
 Structure describing a request to update a topic. More...
 
struct  svc_update_response_s
 Structure describing the response to a topic update request. More...
 
struct  svc_update_source_state_request_s
 Structure describing a request to change an updater's state. More...
 
struct  svc_update_source_state_response_s
 Structure for responding to a request to change and updater's state. More...
 
struct  update_source_registration_handlers_s
 
struct  update_source_registration_params_s
 Structure passed when registering an update source. More...
 
struct  update_source_deregistration_handlers_s
 
struct  update_source_deregistration_params_s
 Structure passed when deregistering an update source. More...
 
struct  update_source_handlers_s
 
struct  update_source_params_s
 Structure passed when updating a topic. More...
 
struct  update_source_state_handlers_s
 
struct  update_source_state_params_s
 

Macros

#define UPDATE_SOURCE_REGISTRATION_HANDLERS
 User-supplied handlers that may be invoked in response to a request to register a topic source.
 
#define UPDATE_SOURCE_HANDLERS
 User-supplied handlers that are invoked in response to sending an update request to a Diffusion topic.
 

Typedefs

typedef struct
svc_update_registration_request_s 
SVC_UPDATE_REGISTRATION_REQUEST_T
 Structure describing a request to register a topic update source.
 
typedef struct
svc_update_registration_response_s 
SVC_UPDATE_REGISTRATION_RESPONSE_T
 Structure describing the response to a topic update registration request.
 
typedef struct
svc_update_deregistration_request_s 
SVC_UPDATE_DEREGISTRATION_REQUEST_T
 Structure describing a request to deregister a topic update source.
 
typedef struct
svc_update_deregistration_response_s 
SVC_UPDATE_DEREGISTRATION_RESPONSE_T
 Structure describing the response to a topic update deregistration request.
 
typedef struct svc_update_request_s SVC_UPDATE_REQUEST_T
 Structure describing a request to update a topic.
 
typedef struct
svc_update_response_s 
SVC_UPDATE_RESPONSE_T
 Structure describing the response to a topic update request.
 
typedef struct
svc_update_source_state_request_s 
SVC_UPDATE_SOURCE_STATE_REQUEST_T
 Structure describing a request to change an updater's state.
 
typedef struct
svc_update_source_state_response_s 
SVC_UPDATE_SOURCE_STATE_RESPONSE_T
 Structure for responding to a request to change and updater's state.
 
typedef int(* on_update_source_registration_cb )(SESSION_T *session, const CONVERSATION_ID_T *updater_id, const SVC_UPDATE_REGISTRATION_RESPONSE_T *response, void *context)
 Callback for register_update_source(). More...
 
typedef struct
update_source_registration_params_s 
UPDATE_SOURCE_REGISTRATION_PARAMS_T
 Structure passed when registering an update source.
 
typedef int(* on_update_source_deregistration_cb )(SESSION_T *session, const CONVERSATION_ID_T *updater_id, void *context)
 Callback for deregiser_update_source(). More...
 
typedef struct
update_source_deregistration_params_s 
UPDATE_SOURCE_DEREGISTRATION_PARAMS_T
 Structure passed when deregistering an update source.
 
typedef struct
update_source_params_s 
UPDATE_SOURCE_PARAMS_T
 Structure passed when updating a topic.
 

Enumerations

enum  UPDATE_SOURCE_STATE_T { UPDATE_SOURCE_STATE_INIT, UPDATE_SOURCE_STATE_ACTIVE, UPDATE_SOURCE_STATE_CLOSED, UPDATE_SOURCE_STATE_STANDBY }
 Service states that an update source may be in. More...
 
enum  UPDATE_RESPONSE_STATUS_T {
  UPDATE_RESPONSE_OK, UPDATE_RESPONSE_INCOMPATIBLE_UPDATE, UPDATE_RESPONSE_UPDATE_FAILED, UPDATE_RESPONSE_INVALID_UPDATER,
  UPDATE_RESPONSE_MISSING_TOPIC, UPDATE_RESPONSE_EXCLUSIVE_UPDATER_CONFLICT, UPDATE_RESPONSE_DELTA_WITHOUT_VALUE, UPDATE_RESPONSE_CLUSTER_REPARTITION,
  UPDATE_RESPONSE_INCOMPATIBLE_STATE
}
 Values indicating the result of an update request. More...
 

Functions

CONVERSATION_ID_Tregister_update_source (SESSION_T *session, const UPDATE_SOURCE_REGISTRATION_PARAMS_T params)
 Register a topic update source. More...
 
void deregister_update_source (SESSION_T *session, const UPDATE_SOURCE_DEREGISTRATION_PARAMS_T params)
 Deregister a topic update source. More...
 
void update (SESSION_T *session, const UPDATE_SOURCE_PARAMS_T params)
 Update topic content. More...
 

Detailed Description

Functions for registering an update source and providing updates to topics.

Typedef Documentation

typedef int(* on_update_source_deregistration_cb)(SESSION_T *session, const CONVERSATION_ID_T *updater_id, void *context)

Callback for deregiser_update_source().

Parameters
sessionThe current active session.
responseThe deregistration response message from Diffusion.
contextUser-supplied context from the deregistration call.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.
typedef int(* on_update_source_registration_cb)(SESSION_T *session, const CONVERSATION_ID_T *updater_id, const SVC_UPDATE_REGISTRATION_RESPONSE_T *response, void *context)

Callback for register_update_source().

Parameters
sessionThe current active session.
updater_idThe updater_id identifying this updater.
responseThe registration response message from Diffusion.
contextUser-supplied context from the initial registration call.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.

Enumeration Type Documentation

Values indicating the result of an update request.

Enumerator
UPDATE_RESPONSE_OK 

The update request has been processed successfully.

UPDATE_RESPONSE_INCOMPATIBLE_UPDATE 

The update was of a type that is not compatible with the topic type or the topic does not support updating.

UPDATE_RESPONSE_UPDATE_FAILED 

The update failed, probably because the content sent with the update was invalid/incompatible with the topic type/data format.

UPDATE_RESPONSE_INVALID_UPDATER 

The updater is not active.

UPDATE_RESPONSE_MISSING_TOPIC 

The topic being updated does not exist.

UPDATE_RESPONSE_EXCLUSIVE_UPDATER_CONFLICT 

Attempt to perform a non exclusive update on a topic branch that already has an update source.

UPDATE_RESPONSE_DELTA_WITHOUT_VALUE 

An update has been attempted on a topic that has no value.

UPDATE_RESPONSE_CLUSTER_REPARTITION 

An update could not be applied because the cluster was repartitioning.

UPDATE_RESPONSE_INCOMPATIBLE_STATE 

An update could not be performed because the topic is managed by a component (e.g fan-out) that prohibits updates from the caller.

Service states that an update source may be in.

Remarks
Updates should only be performed when the registered source is an ACTIVE state.
Enumerator
UPDATE_SOURCE_STATE_INIT 

Initial source state, before state is received from the server.

UPDATE_SOURCE_STATE_ACTIVE 

Active state - the topic may be updated by this source.

UPDATE_SOURCE_STATE_CLOSED 

Terminal state; no further state changes may take place.

UPDATE_SOURCE_STATE_STANDBY 

Inactive state that permits being set to Active or Closed.