dc_WsMan.h File Reference

WS-Management dispatcher API. More...

#include "dc/dc_GenericInvocation.h"
#include "dc/dc_WsmanTypes.h"

Data Structures

struct  wsman_resource_handler
 A structure used to hold a set of handling functions for each of the four WS-Management operations, and the resource URI corresponding to the type of resource to be managed. More...

Defines

#define DPWS_ERR_XPATH_FRAGMENT_PARSING   -300
 The WS-Management XPath Fragment is not syntactically correct.
Resource related fault error codes
#define WSMAN_ERR_INVALID_RESOURCE   1
Selector related fault error codes
#define WSMAN_ERR_INSUFFICIENT_SELECTORS   2
#define WSMAN_ERR_SELECTOR_TYPE_MISMATCH   3
#define WSMAN_ERR_INVALID_SELECTOR_VALUE   4
#define WSMAN_ERR_UNEXPECTED_SELECTORS   5
#define WSMAN_ERR_DUPLICATE_SELECTORS   6
Other error codes
#define WSMAN_ERR_INTERNAL_ERROR   7
#define WSMAN_ERR_SCHEMA_VALIDATION_ERROR   8
#define WSMAN_ERR_CONCURRENCY   9
Create & put related fault error codes
#define WSMAN_ERR_INVALID_VALUES   10
#define WSMAN_ERR_MISSING_VALUES   11
#define WSMAN_ERR_INVALID_NAMESPACES   12
Create related fault error codes
#define WSMAN_ERR_ALREADY_EXISTS   13
Fragment-level related fault error codes
#define WSMAN_ERR_UNSUPPORTED_FRAGMENT_ACCESS   14
#define WSMAN_ERR_INVALID_FRAGMENT   15

Functions

Runtime API
DC_RT_FMAC1 int wsman_serve_request (struct dpws *dpws)
 WS-MAN dispatch function.
DC_RT_FMAC1 char * wsman_get_resource_uri (struct dpws *dpws)
 Retrieves the resource URI for the current request.
DC_RT_FMAC1 int wsman_get_selectors (struct dpws *dpws, struct wsman_selector **selectors, int *selectors_count)
 Retrieves the selectors for the current request.
DC_RT_FMAC1 int wsman_use_fragment_transfer (struct dpws *dpws)
 Returns true is a fragment transer header is used for the current request.
DC_RT_FMAC1 int wsman_get_xpath_level_1 (struct dpws *dpws, struct qname **xpath, int *segment_count)
 Retrieves the XPath fragment as an array of QNames for the current request.
DC_RT_FMAC1 void * wsman_get_configuration_data (struct dpws *dpws, char *resource_uri)
 Retrieves the configuration information associated with the current service and specified resource URI.
DC_RT_FMAC1 int wsman_set_fault (struct dpws *dpws, int err, int underlying)
 Sets the approapriate SOAP fault parameters in the dpws context.
DC_RT_FMAC1 int wsman_serialize_created_epr_callback (void *sctx, void *user_data)
 Callback function to be used when returning from a WS-Man creation handler to serialize the created endpoint reference.

Configuration API

typedef struct
wsman_resource_handler 
wsman_resource_handler_t
 A structure used to hold a set of handling functions for each of the four WS-Management operations, and the resource URI corresponding to the type of resource to be managed.
DC_RT_FMAC1 short wsman_create_management_class (struct wsman_resource_handler **handlers, int handlers_count, struct wsman_resource_handler *default_handler, char *class_id)
 Create a service class object used to handle WS-Management messages.
DC_RT_FMAC1 void wsman_set_resource_handlers (short href_class, struct wsman_resource_handler **handlers, int handlers_count, struct wsman_resource_handler *default_handler)
 Initialize a management service class with a set of handling functions structures, corresponding to the different types of resources to be managed.
DC_RT_FMAC1 short wsman_create_management_service (short href_device, short href_class, char *context_path)
 Create a service object for the associated device and management service class.
DC_RT_FMAC1 int wsman_configure_management_service (short href_service, char *resource_uri, void *configuration_data)
 Configure the management service for a given resource type.


Detailed Description

WS-Management dispatcher API.

This dispatcher is used by the dynamic deployment feature but allow it to coexist with other WS-Management implementations.


Define Documentation

#define DPWS_ERR_XPATH_FRAGMENT_PARSING   -300

The WS-Management XPath Fragment is not syntactically correct.


Typedef Documentation

A structure used to hold a set of handling functions for each of the four WS-Management operations, and the resource URI corresponding to the type of resource to be managed.


Function Documentation

DC_RT_FMAC1 short wsman_create_management_class ( struct wsman_resource_handler **  handlers,
int  handlers_count,
struct wsman_resource_handler default_handler,
char *  class_id 
)

Create a service class object used to handle WS-Management messages.

The service class is initialized with a set of handling functions structures, corresponding to the different types of resources to be managed.

Parameters:
handlers An array of pointers to the set of handling functions. The array will be copied, but not the structures pointed to (they must be long-lived).
handlers_count The number of handlers passed in the array.
default_handler the set of handling functions to be used when other handlers do not match. Can be NULL.
class_id the name of the newly created class. Can be NULL.
Returns:
a handle to the created service class, or -1 otherwise.

DC_RT_FMAC1 void wsman_set_resource_handlers ( short  href_class,
struct wsman_resource_handler **  handlers,
int  handlers_count,
struct wsman_resource_handler default_handler 
)

Initialize a management service class with a set of handling functions structures, corresponding to the different types of resources to be managed.

Parameters:
href_class A handle to the management service class to be initialized.
handlers An array of pointers to the set of handling functions. The array will be copied, but not the structures pointed to (they must be long-lived).
handlers_count The number of handlers passed in the array.
default_handler the set of handling functions to be used when other handlers do not match. Can be NULL.

DC_RT_FMAC1 short wsman_create_management_service ( short  href_device,
short  href_class,
char *  context_path 
)

Create a service object for the associated device and management service class.

Parameters:
href_device The device that hosts the service.
href_class The management class of the service.
context_path The context_path of the service URL.
Returns:
a handle to the created service, or -1 otherwise.

DC_RT_FMAC1 int wsman_configure_management_service ( short  href_service,
char *  resource_uri,
void *  configuration_data 
)

Configure the management service for a given resource type.

Neither the resource URI string nor the configuration data will be copied (they must be long-lived).

Parameters:
href_service The management service handle.
resource_uri The resource type to which the configuration data is attached.
configuration_data The data to be attached to the resource type.
Returns:
DPWS_OK if successful, an error value otherwise.

DC_RT_FMAC1 int wsman_serve_request ( struct dpws dpws  ) 

WS-MAN dispatch function.

Parameters:
dpws the DPWS runtime context.
Returns:
a gSOAP error code.

DC_RT_FMAC1 char* wsman_get_resource_uri ( struct dpws dpws  ) 

Retrieves the resource URI for the current request.

Parameters:
dpws the DPWS runtime context.
Returns:
a string containing the resource URI.

DC_RT_FMAC1 int wsman_get_selectors ( struct dpws dpws,
struct wsman_selector **  selectors,
int *  selectors_count 
)

Retrieves the selectors for the current request.

The returned values are only valid during the processing of the request.

Parameters:
dpws the DPWS runtime context.
selectors a pointer to the array of selectors, filled on output
selectors_count a pointer to an int containing the number of returned selectors, filled on output.
Returns:
DPWS_OK if successful, an error value otherwise.

DC_RT_FMAC1 int wsman_use_fragment_transfer ( struct dpws dpws  ) 

Returns true is a fragment transer header is used for the current request.

Parameters:
dpws the DPWS runtime context.
Returns:
0 or 1.

DC_RT_FMAC1 int wsman_get_xpath_level_1 ( struct dpws dpws,
struct qname **  xpath,
int *  segment_count 
)

Retrieves the XPath fragment as an array of QNames for the current request.

The returned values are only valid during the processing of the request.

Parameters:
dpws the DPWS runtime context.
xpath a pointer to the array of QNames, filled on output
segment_count a pointer to an int containing the size of the QName array, filled on output.
Returns:
DPWS_OK if successful, an error value otherwise.

DC_RT_FMAC1 void* wsman_get_configuration_data ( struct dpws dpws,
char *  resource_uri 
)

Retrieves the configuration information associated with the current service and specified resource URI.

Parameters:
dpws the DPWS runtime context.
resource_uri the resource URI used in the request
Returns:
the configuration data, or NULL if none is set.

DC_RT_FMAC1 int wsman_set_fault ( struct dpws dpws,
int  err,
int  underlying 
)

Sets the approapriate SOAP fault parameters in the dpws context.

Parameters:
dpws the DPWS runtime context.
err the WS-Man error code (see above)
underlying the internal error code (EPX, gSOAP, etc.)
Returns:
DPWS_OK, or an error code.

DC_RT_FMAC1 int wsman_serialize_created_epr_callback ( void *  sctx,
void *  user_data 
)

Callback function to be used when returning from a WS-Man creation handler to serialize the created endpoint reference.

Parameters:
sctx the serialization context of the response.
user_data the endpoint reference to be serialized
Returns:
DPWS_OK, or an error code.


Generated on Fri Apr 17 15:18:25 2009 for DPWSCore by  doxygen 1.5.8