Main Page | Modules | Data Structures | File List | Data Fields | Globals

Notifications handling

Notifications handling. More...

Defines

#define EDG_WLL_NOTIF_TIMEOUT_DEFAULT   120
#define EDG_WLL_NOTIF_TIMEOUT_MAX   1800

Typedefs

typedef enum _edg_wll_NotifChangeOp edg_wll_NotifChangeOp

Enumerations

enum  _edg_wll_NotifChangeOp { EDG_WLL_NOTIF_NOOP = 0, EDG_WLL_NOTIF_REPLACE, EDG_WLL_NOTIF_ADD, EDG_WLL_NOTIF_REMOVE }

Functions

int edg_wll_NotifNew (edg_wll_Context context, edg_wll_QueryRec const *const *conditions, int fd, const char *address_override, edg_wll_NotifId *id_out, time_t *valid)
int edg_wll_NotifBind (edg_wll_Context context, const edg_wll_NotifId id, int fd, const char *address_override, time_t *valid)
int edg_wll_NotifChange (edg_wll_Context context, const edg_wll_NotifId id, edg_wll_QueryRec const *const *conditions, edg_wll_NotifChangeOp op)
int edg_wll_NotifRefresh (edg_wll_Context context, const edg_wll_NotifId id, time_t *valid)
int edg_wll_NotifDrop (edg_wll_Context context, edg_wll_NotifId *id)
int edg_wll_NotifReceive (edg_wll_Context context, int fd, const struct timeval *timeout, edg_wll_JobStat *state_out, edg_wll_NotifId *id_out)
int edg_wll_NotifGetFd (edg_wll_Context context)
int edg_wll_NotifCloseFd (edg_wll_Context context)

Detailed Description

Notifications handling.


Define Documentation

#define EDG_WLL_NOTIF_TIMEOUT_DEFAULT   120
 

default and maximal notif timeout (in seconds)

#define EDG_WLL_NOTIF_TIMEOUT_MAX   1800
 


Typedef Documentation

typedef enum _edg_wll_NotifChangeOp edg_wll_NotifChangeOp
 


Enumeration Type Documentation

enum _edg_wll_NotifChangeOp
 

Enumeration values:
EDG_WLL_NOTIF_NOOP  No operation, equal to not defined
EDG_WLL_NOTIF_REPLACE  Replace notification registration with new one
EDG_WLL_NOTIF_ADD  Add new condition when to be notifed
EDG_WLL_NOTIF_REMOVE  Remove condition on notification


Function Documentation

int edg_wll_NotifBind edg_wll_Context  context,
const edg_wll_NotifId  id,
int  fd,
const char *  address_override,
time_t *  valid
 

Change the receiving local address. Report the new address to the server.

Parameters:
[in,out] context context to work with
[in] id notification ID you are binding to
[in] fd same as for edg_wll_NotifNew
[in] address_override same as for edg_wll_NotifNew
[in] valid same as for edg_wll_NotifNew

int edg_wll_NotifChange edg_wll_Context  context,
const edg_wll_NotifId  id,
edg_wll_QueryRec const *const *  conditions,
edg_wll_NotifChangeOp  op
 

Modify the query conditions for this notification.

If op is either EDG_WLL_NOTIF_ADD or EDG_WLL_NOTIF_REMOVE, for the sake of uniqueness the original conditions must have contained only a single OR-ed row of conditions on the attributes infolved in the change.

Parameters:
[in,out] context context to work with
[in] id notification ID you are working with
[in] conditions same as for edg_wll_NotifNew
[in] op action to be taken on existing conditions, edg_wll_NotifChangeOp

int edg_wll_NotifCloseFd edg_wll_Context  context  ) 
 

Close the default local listening socket. Useful to force following edg_wll_NotifBind to open a new one.

Parameters:
[in,out] context context to work with

int edg_wll_NotifDrop edg_wll_Context  context,
edg_wll_NotifId id
 

Drop the registration. Server is instructed not to send notifications anymore, pending ones are discarded, listening socket is closed, and allocated memory freed.

Parameters:
[in,out] context context to work with
[in] id notification ID you are working with

int edg_wll_NotifGetFd edg_wll_Context  context  ) 
 

Default socket descriptor where to select(2) for notifications. Even if nothing is available for reading from the socket, there may be some data cached so calling edg_wll_NotifReceive may return notifications immediately.

Parameters:
[in,out] context context to work with
Return values:
>=0 socket descriptor
-1 error, details set in context

int edg_wll_NotifNew edg_wll_Context  context,
edg_wll_QueryRec const *const *  conditions,
int  fd,
const char *  address_override,
edg_wll_NotifId id_out,
time_t *  valid
 

Register for receiving notifications. Connects to the server specified by EDG_WLL_NOTIF_SERVER context parameter (temporary workaround, should be resolved by registry in future).

Parameters:
[in,out] context context to work with
[in] conditions the same conditions as for edg_wll_QueryJobsExt. currently one or more JOBID's are required. Only a single occurence of a specific attribute is allowed among ANDed conditions (due to the ability to modify them further).
[in] fd = -1 create or reuse the default listening socket (one per context) >= 0 non-default listening socket
[in] address_override if not NULL, use this address instead of extracting it from the connection (useful when multiple interfaces are present, circumventing NAT problems etc.)
[in] valid until when the registration is valid (NULL means no interest in
[out] id_out returened NotifId the value
Return values:
0 OK
EINVAL restrictions on conditions are not met

int edg_wll_NotifReceive edg_wll_Context  context,
int  fd,
const struct timeval *  timeout,
edg_wll_JobStat state_out,
edg_wll_NotifId id_out
 

Receive notification. The first incoming notification is returned.

Parameters:
[in,out] context context to work with
[in] fd receive on this socket (-1 means the default for the context)
[in] timeout wait atmost this time long. (0,0) means polling, NULL waiting indefinitely
[out] state_out returned JobStatus
[out] id_out returned NotifId
Return values:
0 notification received, state_out contains the current job state
EAGAIN no notification available, timeout occured

int edg_wll_NotifRefresh edg_wll_Context  context,
const edg_wll_NotifId  id,
time_t *  valid
 

Refresh the registration, i.e. extend its validity period.

Parameters:
[in,out] context context to work with
[in] id notification ID you are working with
[in] valid until when the registration is valid (NULL means no interest in the value


Generated on Tue May 8 00:32:30 2007 for Glite LB Client: C - Interface by  doxygen 1.3.9.1