(file) Return to listener.h CVS log (file) (dir) Up to [OMI] / omi / indication / indimgr

File: [OMI] / omi / indication / indimgr / listener.h (download)
Revision: 1.1, Mon Apr 20 17:19:52 2015 UTC (9 years, 2 months ago) by krisbash
Branch: MAIN
CVS Tags: OMI_1_0_8_2, OMI_1_0_8_1, HEAD
OMI 1.0.8-1

/*
**==============================================================================
**
** Open Management Infrastructure (OMI)
**
** Copyright (c) Microsoft Corporation
** 
** Licensed under the Apache License, Version 2.0 (the "License"); you may not 
** use this file except in compliance with the License. You may obtain a copy 
** of the License at 
**
**     http://www.apache.org/licenses/LICENSE-2.0 
**
** THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
** KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 
** WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 
** MERCHANTABLITY OR NON-INFRINGEMENT. 
**
** See the Apache 2 License for the specific language governing permissions 
** and limitations under the License.
**
**==============================================================================
*/

#ifndef _indication_indimgr_listener_h
#define _indication_indimgr_listener_h

#include <common.h>
#include <base/Strand.h>
#include <base/messages.h>
#include "cimbase.h"

#define TEMP_LISTENER_ID_PREFIX MI_T("_templistener")

BEGIN_EXTERNC

/*
**==============================================================================
**
** Defines listener persistent types
**
**==============================================================================
*/
typedef enum _PersistenceType
{
    LISTENER_TEMP = 0,       /* Delivery result via incoming connection from */
                             /* subscription caller */
    LISTENER_OTHER,          /* Undefined */
    LISTENER_PERMANENT,      /* Listener is always expected to be available */
                             /* Inability to access this destination MUST be */
                             /* treated as an error condition. */
    LISTENER_TRANSIENT       /* Listener is short-lived, Inability to access */
                             /* the destination MAY be treated as a normal */
                             /* termination condition. */
}
PersistenceType;

/*
**==============================================================================
**
** Forward structure typedef declarations.
**
**==============================================================================
*/

typedef struct _Listener Listener;
typedef struct _ListenerFT ListenerFT;

/*
**==============================================================================
**
** Function that handling result indication instance from provider
**
**==============================================================================
*/
typedef void (MI_CALL* fnOnNewIndication)(
    _In_ Listener* listener,
    _In_ Interaction* interaction,
    _In_ PostInstanceMsg* instanceMsg);

/*
**==============================================================================
**
** Function that handling final result from indication manager
**
**==============================================================================
*/
typedef void (MI_CALL* fnOnFinalResult)(
    _In_ Listener* listener,
    _In_ Interaction* interaction,
    _In_ MI_Result result,
    _In_opt_ MI_Instance* errDetails);

/*
**==============================================================================
**
** Represents a CIM indication filter object
**
**==============================================================================
*/
struct _Listener
{
    CimBase base;

#if 0 /* To be enabled for indication profile */

    /* CIM_ManagedElement properties */
    MI_Char* InstanceID;
    MI_Char* Caption;
    MI_Char* Description;
    MI_Char* ElementName;

    /* CIM_ListenerDestination properties */
    MI_Char* SystemCreationClassName; /*key*/
    MI_Char* SystemName; /*key*/
    MI_Char* CreationClassName; /*key*/
    MI_Char* Name; /*key*/

    MI_Char* OtherPersistenceType;
    MI_Char* Destination;
    MI_Char* OtherProtocol;

    /*1: Other; 2:CIM-XML; 3:SM CLP; 4:WS-Management; 5:WSDM; ..:DMTF Reserved*/
    MI_Uint16 protocol; /* Default 2 */

#endif

    /*1: Other; 2:Permanent; 3:Transient*/
    MI_Uint16 PersistenceType;  /* Default 2 */
};

/* Creates a Listener object */
Listener* Listener_New(PersistenceType type);

/* Add a reference to a Listener object */
int Listener_AddRef(
    _Inout_ Listener* self);

/* Release a reference to a Listener object */
int Listener_Release(
    _Inout_ Listener* self);

/* Get reference count */
int Listener_GetRefcount(_In_ Listener *self);

END_EXTERNC

#endif /* _indication_indimgr_listener_h */

ViewCVS 0.9.2