/*
 * Portions of this file Copyright 1999-2005 University of Chicago
 * Portions of this file Copyright 1999-2005 The University of Southern California.
 *
 * This file or a portion of this file is licensed under the
 * terms of the Globus Toolkit Public License, found at
 * http://www.globus.org/toolkit/download/license.html.
 * If you redistribute this file, with or without
 * modifications, you must include this notice in the file.
 */


/*
 * This file is automatically generated by the Globus WSDLtoC converter
 */

#ifndef _NOTIFICATIONCONSUMERSERVICE_CLIENT_H_
#define _NOTIFICATIONCONSUMERSERVICE_CLIENT_H_

#include "globus_common.h"

EXTERN_C_BEGIN

#include "NotificationConsumerService.h"
#include "wsa_EndpointReferenceType.h"
#include "globus_soap_message_attrs.h"

#define WSADDRESSING_NS "http://schemas.xmlsoap.org/ws/2004/03/addressing"

/**
 * @defgroup NotificationConsumerService_client NotificationConsumerService Client Bindings
 */

extern globus_module_descriptor_t NotificationConsumerService_i_module;
/**
 * Module descriptor for the client stubs bindings for the
 * NotificationConsumerService service.
 * @ingroup NotificationConsumerService_client
 * @hideinitializer
 *
 * This module must be activated before calling any functions in the NotificationConsumerService
 * client bindings API.
 */
#define NOTIFICATIONCONSUMERSERVICE_MODULE (&NotificationConsumerService_i_module)

/**
 * @defgroup NotificationConsumerService_client_handle Client Handle Functions and Types
 * @ingroup NotificationConsumerService_client
 */

/**
 * Handle for the NotificationConsumerService client.
 * @ingroup NotificationConsumerService_client_handle
 *
 * A handle must be created by the client application before calling any
 * SOAP operation. Only one operation may be in progress per handle at
 * any given time.
 *
 * @see NotificationConsumerService_client_init(), NotificationConsumerService_client_destroy()
 */
typedef struct NotificationConsumerService_client_handle_s * NotificationConsumerService_client_handle_t;



/* Type and function declarations for the Notify
 * operation
 */

/**
 * @defgroup Consumer_Notify_operation Notify Operation
 * @ingroup NotificationConsumerService_client
 *
 * The functions and types in this group are used by clients which will
 * be making Notify requests of the NotificationConsumerService service.
 *
 * The functions Consumer_Notify_register_request() and
 * Consumer_Notify_epr_register_request() are used to make this type of operation
 * request.
 */

/**
 * Request callback function
 * @ingroup Consumer_Notify_operation
 * Use a function of this type when calling one of the nonblocking request
 * functions for the <code>Notify</code> operation.
 *

 *
 * @param handle
 *     The @link #NotificationConsumerService_client_handle_t client handle @endlink used for
 *     the operation invocation.
 * @param user_args
 *     Application specific pointer, passed to the operation's register
 *     function.
 * @param result
 *     The result of operation request.
 */
typedef void (* Consumer_Notify_request_callback_func_t)(
    NotificationConsumerService_client_handle_t handle,
    void * user_args,
    globus_result_t result);
 
/**
 * Nonblocking operation request with EPR
 * @ingroup Consumer_Notify_operation
 * Begin sending a request for the <code>Notify</code> operation on a
 * resource handled by the service named by the @a epr. When the operation
 * request has been sent, the @a callback function will be invoked.
 *
 * @param handle
 *     The @link #NotificationConsumerService_client_handle_t client handle @endlink which
 *     contains the state related to processing this operation.
 * @param epr
 *     Endpoint Reference of the service and resource which will process
 *     the operation.
 * @param Notify
 *     Input parameter to the operation.
 * @param callback
 *     Callback function which will be called once the request has been
 *     sent
 * @param user_args
 *     Application-specific pointer which will be passed to the callback.
 */
globus_result_t
Consumer_Notify_epr_register_request(
    NotificationConsumerService_client_handle_t handle,
    const wsa_EndpointReferenceType * epr,
    const wsnt_NotifyType * Notify,
    Consumer_Notify_request_callback_func_t callback,
    void * user_args);

/**
 * Nonblocking operation request
 * @ingroup Consumer_Notify_operation
 * Begin sending a request for the <code>Notify</code> operation to
 * the service at @a endpoint. When the operation
 * request has been sent, the @a callback function will be invoked.
 * @param handle
 *     The @link #NotificationConsumerService_client_handle_t client handle @endlink which
 *     contains the state related to processing this operation.
 * @param endpoint
 *     URI of the service endpoint to send the request to.
 * @param Notify
 *     Input parameter to the operation.
 * @param callback
 *     Callback function which will be called once the request has been
 *     sent
 * @param user_args
 *     Application-specific pointer which will be passed to the callback.
 */
globus_result_t
Consumer_Notify_register_request(
    NotificationConsumerService_client_handle_t handle,
    const char * endpoint,
    const wsnt_NotifyType * Notify,
    Consumer_Notify_request_callback_func_t callback,
    void * user_args);


/**
 * Blocking operation invocation with EPR
 * @ingroup Consumer_Notify_operation
 *
 * Request that an the Notify operation be invoked by the service and
 * resource named by the @a epr parameter.

 *
 * @param handle
 *     The @link #NotificationConsumerService_client_handle_t client handle @endlink which
 *     contains the state related to processing this operation.
 * @param epr
 *     Endpoint Reference of the service and resource which will process
 *     the operation.
 * @param Notify
 *     Input parameter to the operation.

 */
globus_result_t
Consumer_Notify_epr(
    NotificationConsumerService_client_handle_t handle,
    const wsa_EndpointReferenceType * epr,
    const wsnt_NotifyType * Notify);

/**
 * Blocking operation invocation
 * @ingroup Consumer_Notify_operation
 *
 * Request that an the Notify operation be invoked by the service at
 * @a endpoint.

 *
 * @param handle
 *     The @link #NotificationConsumerService_client_handle_t client handle @endlink which
 *     contains the state related to processing this operation.
 * @param endpoint
 *     URI of the service endpoint to send the request to.
 * @param Notify
 *     Input parameter to the operation.

 */
globus_result_t
Consumer_Notify(
    NotificationConsumerService_client_handle_t handle,
    const char * endpoint,
    const wsnt_NotifyType * Notify);



/**
 * Initialize a client handle
 * @ingroup NotificationConsumerService_client_handle
 * Initialize new client handle state for use with operation-related functions.
 *
 * @param handle
 *     Pointer to the handle to initialize.
 * @param attrs
 *    Default attributes to use with this handle. This parameter may be NULL.
 *    Certain atttributes may cause different handlers to be pushed onto the
 *    default handler chain for this client.
 * @param handlers
 *    Handle chain to use with this handle. This parameter may be NULL.
 *    Typically the default handler chain used by this function is sufficient.
 */
globus_result_t
NotificationConsumerService_client_init(
    NotificationConsumerService_client_handle_t *  handle,
    globus_soap_message_attr_t attrs,
    globus_handler_chain_t handlers);

/**
 * Destroy a client handle
 * @ingroup NotificationConsumerService_client_handle
 *
 * Destroys the state associated with this client handle.
 *
 * @param handle
 *     Handle to destroy.
 */
void
NotificationConsumerService_client_destroy(
    NotificationConsumerService_client_handle_t handle);

/**
 * Cancel the current operation associated with this handle.
 * @ingroup NotificationConsumerService_client_handle
 * 
 * @param handle
 *     Handle which has the operation to cancel.
 */
globus_result_t
NotificationConsumerService_client_operation_cancel(
    NotificationConsumerService_client_handle_t handle);

/**
 * Get handle's type registry
 * @ingroup NotificationConsumerService_client_handle
 *
 * The type registry maps XML element names to type information structures.
 * Applications may wish to get the registry from a handle to set extra
 * type mappings (for example, to set a mapping for an element which is
 * to be received as part of an extensibility element).
 *
 * @param handle
 *     The handle to query.
 * @param registry
 *     A pointer to a registry handle which will be set to the handle's
 *     registry.
 */
globus_result_t
NotificationConsumerService_client_get_registry(
    NotificationConsumerService_client_handle_t handle,
    globus_xsd_type_registry_t * registry);

/**
 * Get handle's handler chain
 * @ingroup NotificationConsumerService_client_handle
 *
 * The handler chain contains information about which handlers (typically
 * SOAP header processors) will be invoked when a request is sent or a
 * response is received. Applications which want to add custom handlers at
 * run time may wish to push additional handlers onto this chain.
 *
 * @param handle
 *     The handle to query.
 * @param handlers
 *     A pointer to a handler chain which will be set to the handle's
 *     chain.
 */
globus_result_t
NotificationConsumerService_client_get_handler_chain(
    NotificationConsumerService_client_handle_t handle,
    globus_handler_chain_t * handlers);

/**
 * Set a SOAP attribute on a handle
 * @ingroup NotificationConsumerService_client_handle
 *
 * Set a SOAP attribute on a handle. This can be used to change how
 * the SOAP engine will process operations sent via this handle.
 *
 * @param handle
 *     The handle to modify.
 * @param prop_name
 *     The attribute name. This should be one of the
 *     <code>GLOBUS_SOAP_MESSAGE_*_KEY</code> values.
 * @param copy
 *     A function to copy the value. This is required if @a value will go
 *     out of scope.
 * @param destroy
 *     A function to destroy a copy of the value. Required if @a copy is set.
 * @param value
 *     The new value of the attribute.
 */
globus_result_t
NotificationConsumerService_client_attr_set(
    NotificationConsumerService_client_handle_t handle,
    const char * prop_name,
    globus_soap_message_attr_copy_func_t copy,
    globus_soap_message_attr_destroy_func_t destroy,
    void * value);

/**
 * Remove a SOAP attribute from a handle
 * @ingroup NotificationConsumerService_client_handle
 *
 * Remove a SOAP attribute on a handle. This can be used to change how
 * the SOAP engine will process operations sent via this handle.
 *
 * @param handle
 *     The handle to modify.
 * @param prop_name
 *     The attribute name. This should be one of the
 *     <code>GLOBUS_SOAP_MESSAGE_*_KEY</code> values.
 * 
 * @return
 *     This function returns the current value of the attribute.
 */
void *
NotificationConsumerService_client_attr_remove(
    NotificationConsumerService_client_handle_t handle,
    const char * prop_name);

/**
 * Get a SOAP attribute from a handle
 * @ingroup NotificationConsumerService_client_handle
 *
 * Get the current value of a SOAP attribute set on a handle. 
 *
 * @param handle
 *     The handle to query.
 * @param prop_name
 *     The attribute name. This should be one of the
 *     <code>GLOBUS_SOAP_MESSAGE_*_KEY</code> values.
 * 
 * @return
 *     This function returns the current value of the attribute.
 */
void *
NotificationConsumerService_client_attr_get(
    NotificationConsumerService_client_handle_t handle,
    const char * prop_name);

EXTERN_C_END

#endif
