BUG#: 7635
authorvenkat.puvvada <venkat.puvvada>
Fri, 16 May 2008 06:26:44 +0000 (06:26 +0000)
committervenkat.puvvada <venkat.puvvada>
Fri, 16 May 2008 06:26:44 +0000 (06:26 +0000)
TITLE: PEP#323 DMTF Indications Profile (DSP1054) Implementation, stage 1.
DESCRIPTION: PEP 323 implementation.

28 files changed:
Schemas/CIM217/CIM_EventExperimental.mof [new file with mode: 0644]
Schemas/CIM217/DMTF/EventExperimental/CIM_IndicationService.mof [new file with mode: 0644]
Schemas/CIM217/DMTF/EventExperimental/CIM_IndicationServiceCapabilities.mof [new file with mode: 0644]
Schemas/Pegasus/InterOp/Makefile
Schemas/Pegasus/InterOp/VER20/PG_ServerProfile20.mof
mak/config.mak
src/Pegasus/Common/Constants.cpp
src/Pegasus/Common/Constants.h
src/Pegasus/ControlProviders/InteropProvider/InteropConstants.h
src/Pegasus/ControlProviders/InteropProvider/InteropProvider.cpp
src/Pegasus/ControlProviders/InteropProvider/InteropProvider.h
src/Pegasus/ControlProviders/InteropProvider/InteropProviderUtils.cpp
src/Pegasus/ControlProviders/InteropProvider/InteropProviderUtils.h
src/Pegasus/ControlProviders/InteropProvider/RegisteredProfile.cpp
src/Pegasus/ControlProviders/InteropProvider/Server.cpp
src/Pegasus/ControlProviders/InteropProvider/ServerProfileTests/ServerProfile.cpp
src/Pegasus/ControlProviders/InteropProvider/Software.cpp
src/Pegasus/IndicationService/IndicationConstants.cpp
src/Pegasus/IndicationService/IndicationConstants.h
src/Pegasus/IndicationService/IndicationService.cpp
src/Pegasus/IndicationService/IndicationService.h
src/Pegasus/IndicationService/IndicationServiceConfiguration.cpp [new file with mode: 0644]
src/Pegasus/IndicationService/IndicationServiceConfiguration.h [new file with mode: 0644]
src/Pegasus/IndicationService/Makefile
src/Pegasus/IndicationService/tests/Configuration/Configuration.cpp [new file with mode: 0644]
src/Pegasus/IndicationService/tests/Configuration/Makefile [new file with mode: 0644]
src/Pegasus/IndicationService/tests/Makefile
src/Pegasus/Server/CIMOperationRequestDispatcher.cpp

diff --git a/Schemas/CIM217/CIM_EventExperimental.mof b/Schemas/CIM217/CIM_EventExperimental.mof
new file mode 100644 (file)
index 0000000..a715fbd
--- /dev/null
@@ -0,0 +1,44 @@
+//%2006////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
+// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
+// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation, The Open Group.
+// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; Symantec Corporation; The Open Group.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+// 
+// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
+// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
+// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//==============================================================================
+// ====================================================
+// Title      : CIM_Event Experimental MOF
+// Filename   : CIM_EventExperimental.mof
+// Version    :
+// Date       : 05/05/2008
+// Description: This file was created to support DMTF Indications Profile 
+//              (DSP1054) and compatible with OpenPegasus  build enviroment.
+//              DMTF Indications Profile classes which are included below are
+//              still experimental. These classes were taken from CIM217
+//              Experimental schema.
+//=====================================================
+#pragma include ("DMTF/EventExperimental/CIM_IndicationService.mof")
+#pragma include ("DMTF/EventExperimental/CIM_IndicationServiceCapabilities.mof") 
diff --git a/Schemas/CIM217/DMTF/EventExperimental/CIM_IndicationService.mof b/Schemas/CIM217/DMTF/EventExperimental/CIM_IndicationService.mof
new file mode 100644 (file)
index 0000000..e8602a7
--- /dev/null
@@ -0,0 +1,77 @@
+// Copyright (c) 2007 DMTF.  All rights reserved.
+//<change cr="WIPCR00354.005" type="change">Update IndicationService
+// to align with SettingData and add Capabilities</change>
+//<change cr="WIPCR00320.003" type="change">Add CIM_IndicationService
+//</change>
+// ==================================================================
+//  CIM_IndicationService 
+// ==================================================================
+   [Experimental, Version ( "2.14.0" ), 
+    UMLPackagePath ( "CIM::Event" ), 
+    Description ( 
+       "An IndicationService is a Service of the CIM Object Manager "
+       "that is responsible for delivering indications to Indication "
+       "Handlers." )]
+class CIM_IndicationService : CIM_Service {
+
+      [Description ( 
+          "The FilterCreationEnabled property controls whether or "
+          "not clients can create indication filters. If this value "
+          "is set to false, only the indication filters that exist "
+          "can be subscribed to. If this value is true clients may "
+          "attempt to create filters. Note that implementations may "
+          "preset this setting and not allow this value to be "
+          "modified." )]
+   boolean FilterCreationEnabled = false;
+
+      [Description ( 
+          "Defines the number of retries that the indication "
+          "service will try to deliver an indication to a "
+          "particular listener destination. This does not effect "
+          "the original delivery attempt, thus if set to 0, it will "
+          "only try to deliver the indication once. Note that "
+          "implementations may preset this setting and not allow "
+          "this value to be modified." ), 
+       MinValue ( 0 )]
+   uint16 DeliveryRetryAttempts = 3;
+
+      [Description ( 
+          "Defines the minimal time interval in seconds for the "
+          "indication service to use before delivering an "
+          "indication to a particular listener destination that "
+          "previously failed. The implementation may take longer "
+          "due to QoS or other processing. Note that "
+          "implementations may preset this setting and not allow "
+          "this value to be modified." ), 
+       PUnit ( "Seconds" )]
+   uint64 DeliveryRetryInterval = 30;
+
+      [Description ( 
+          "Defines the removal action for subscriptions that have "
+          "two failed indication deliveries without any successful "
+          "indication deliveries in between and the time between "
+          "the failed deliveries exceeded the timeout defined in "
+          "the SubscriptionRemovalTimeInterval property. \"Remove\" "
+          "defines the subscription is to be removed.\n"
+          "\"Disable\" indicates that subscription removal process "
+          "isnot being enforced. \n"
+          "\"Ignore\" indicates that the removal action is "
+          "temporarily not enforced. implementations may preset "
+          "this setting and not allow this value to be modified." ), 
+       ValueMap { "2", "3", "4", ".." }, 
+       Values { "Remove", "Disable", "Ignore", "DMTF Reserved" }, 
+       ModelCorrespondence { 
+          "CIM_IndicationService.SubscriptionRemovalTimeInterval" }]
+   uint16 SubscriptionRemovalAction;
+
+      [Description ( 
+          "Minimum time between two failed indication deliveries "
+          "without any successful indication deliveries in between "
+          "before the SubscriptionRemovalPolicy goes into effect." ), 
+       ModelCorrespondence { 
+          "CIM_IndicationService.SubscriptionRemovalAction" }, 
+       PUnit ( "Seconds" )]
+   uint64 SubscriptionRemovalTimeInterval;
+
+
+};
diff --git a/Schemas/CIM217/DMTF/EventExperimental/CIM_IndicationServiceCapabilities.mof b/Schemas/CIM217/DMTF/EventExperimental/CIM_IndicationServiceCapabilities.mof
new file mode 100644 (file)
index 0000000..618b734
--- /dev/null
@@ -0,0 +1,82 @@
+// Copyright (c) 2007 DMTF.  All rights reserved.
+//<change cr="WIPCR00391.004" type="change">
+//Add CIM_IndicationServiceCapabilities.MaxListenerDestinations</change>
+//<change cr="WIPCR00396.002" type="change">Additional Advertisement 
+// of Indication Subscription capabilities</change>
+// ==================================================================
+//  CIM_IndicationServiceCapabilities
+// ==================================================================
+   [Experimental, Version ( "2.16.0" ), 
+    UMLPackagePath ( "CIM::Core::Capabilities" ), 
+    Description ( 
+       "IndicationServiceCapabilities describes whether properties on "
+       "the Indication Service can be modified by a client." )]
+class CIM_IndicationServiceCapabilities : CIM_Capabilities {
+
+      [Description ( 
+          "Boolean indicating whether the FilterCreationEnabled "
+          "property can be set by a client application." ), 
+       ModelCorrespondence { 
+          "CIM_IndicationService.FilterCreationEnabled" }]
+   boolean FilterCreationEnabledIsSettable;
+
+      [Description ( 
+          "Boolean indicating whether the DeliveryRetryAttempts "
+          "property can be set by a client application." ), 
+       ModelCorrespondence { 
+          "CIM_IndicationService.DeliveryRetryAttempts" }]
+   boolean DeliveryRetryAttemptsIsSettable;
+
+      [Description ( 
+          "Boolean indicating whether the DeliveryRetryInterval "
+          "property can be set by a client application." ), 
+       ModelCorrespondence { 
+          "CIM_IndicationService.DeliveryRetryInterval" }]
+   boolean DeliveryRetryIntervalIsSettable;
+
+      [Description ( 
+          "Boolean indicating whether the SubscriptionRemovalAction "
+          "property can be set by a client application." ), 
+       ModelCorrespondence { 
+          "CIM_IndicationService.SubscriptionRemovalAction" }]
+   boolean SubscriptionRemovalActionIsSettable;
+
+      [Description ( 
+          "Boolean indicating whether the "
+          "SubscriptionRemovalTimeInterval property can be set by a "
+          "client application." ), 
+       ModelCorrespondence { 
+          "CIM_IndicationService.SubscriptionRemovalTimeInterval" }]
+   boolean SubscriptionRemovalTimeIntervalIsSettable;
+
+      [Description ( 
+          "MaxListenerDestinations specifies the maximum number of "
+          "instances of CIM_ListenerDestination allowed by the "
+          "associated CIM_IndicationService." ), 
+       MinValue ( 1 )]
+   uint32 MaxListenerDestinations = 1;
+
+      [Description ( 
+          "MaxActiveSubscriptions specifies the maximum total "
+          "number of instances of CIM_IndicationSubcription and "
+          "CIM_FilterCollectionSubscription instances supported by "
+          "the CIM_IndicationService." ), 
+       MinValue ( 1 )]
+   uint32 MaxActiveSubscriptions = 1;
+
+      [Description ( 
+          "SubscriptionsPersisted indicates whether or not the "
+          "IndicationService persists indication subscriptions "
+          "across restarts of the service. If "
+          "SubscriptionsPersisted has a value of true, the "
+          "indication service shall persist indication "
+          "subscriptions across restarts of service. If "
+          "SubscriptionsPersisted has a value of false, the "
+          "indication service shall not persist indication "
+          "subscriptions across restarts of the service. A value of "
+          "NULL indicates support for subscription persistence is "
+          "unknown." )]
+   boolean SubscriptionsPersisted = false;
+
+
+};
index 532c845095bd8ee49c2f0140464e3a6b9192f5ea..67caf12075e5d1ea31a65f83288bf9f77bc1c880 100644 (file)
@@ -78,6 +78,16 @@ ifdef PEGASUS_ENABLE_INTEROP_PROVIDER
 
 endif
 
+#
+# PEP 323
+#
+ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+ ifeq ($(PEGASUS_CIM_SCHEMA), CIM217)
+       @$(ECHO) +++++ Loading CIM_EventExperimental into $(INTEROPNS) namespace ...
+       @$(CIMMOFCLI) "-R$(REPOSITORY_DIR)" "-N$(REPOSITORY_NAME)" "-M$(REPOSITORY_MODE)" "-I$(CIM_SCHEMA_DIR)" "-n$(INTEROPNS)" "-aE" "$(CIM_SCHEMA_DIR)/CIM_EventExperimental.mof"
+ endif
+endif
+
 repositoryServer:
        @$(ECHO) +++++ Loading CIM_Core$(CIM_SCHEMA_VER) into $(INTEROPNS) namespace ...
        @cimmof "-I$(CIM_SCHEMA_DIR)" "-n$(INTEROPNS)" $(ALLOW_EXPERIMENTAL) "$(CIM_SCHEMA_DIR)/CIM_Core$(CIM_SCHEMA_VER).mof"
@@ -106,6 +116,17 @@ ifdef PEGASUS_ENABLE_INTEROP_PROVIDER
        @cimmof "-I$(PG_INTEROP_MOF_PATH)" "-n$(INTEROPNS)" $(ALLOW_EXPERIMENTAL) "$(PG_INTEROP_MOF_PATH)/PG_ServerProfile$(PG_INTEROP_SCHEMA_VER).mof"
 endif
 
+#
+# PEP 323
+#
+ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+ ifeq ($(PEGASUS_CIM_SCHEMA), CIM217)
+       @$(ECHO) +++++ Loading CIM_EventExperimental into $(INTEROPNS) namespace ...
+       @cimmof "-I$(CIM_SCHEMA_DIR)" "-n$(INTEROPNS)" "-aE" "$(CIM_SCHEMA_DIR)/CIM_EventExperimental.mof"
+ endif
+endif
+
+
 clean:
        @$(ECHO) +++++ Removing existing CIM Repository named $(INTEROPNS)
        @$(RMREPOSITORY) "$(INTEROPNSDIRECTORY)"
index 907911c0051bd4cac0c5cc69e5beed71c84cc27a..7d926338554c8fde3cf56fbccddf8a8809999279 100644 (file)
@@ -704,4 +704,26 @@ class PG_HostedObjectManager : CIM_HostedService {
 class PG_HostedAccessPoint : CIM_HostedAccessPoint {
 };
 
+// ==================================================================
+// PG_HostedIndicationService
+// ==================================================================
+[Association, Version ("2.8.0"), Description(
+    "Subclass supported by the Pegasus Server Profile Implementation.")]
+class PG_HostedIndicationService : CIM_HostedService {
+};
 
+// ==================================================================
+// PG_ElementCapabilities
+// ==================================================================
+[Association, Version ("2.8.0"), Description(
+    "Subclass supported by the Pegasus Server Profile Implementation.")]
+class PG_ElementCapabilities : CIM_ElementCapabilities {
+};
+
+// ==================================================================
+// PG_ServiceAffectsElement
+// ==================================================================
+[Association, Version ("2.8.0"), Description(
+    "Subclass supported by the Pegasus Server Profile Implementation.")]
+class PG_ServiceAffectsElement : CIM_ServiceAffectsElement {
+};
index 8251546dc50e17dda2f2dec969ab81936f6d4745..6629bfc6189b90f487dd4903be80d8379aef70eb 100644 (file)
@@ -900,6 +900,25 @@ ifdef PEGASUS_ENABLE_INTEROP_PROVIDER
     endif
 endif
 
+#
+## PEP 323, DMTF Indications Profile support, stage 1
+#
+ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+    ifeq ($(PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT), true)
+        ifndef PEGASUS_ENABLE_INTEROP_PROVIDER
+            PEGASUS_ENABLE_INTEROP_PROVIDER = true
+        else
+            ifeq ($(PEGASUS_ENABLE_INTEROP_PROVIDER),false)
+                $(error PEGASUS_ENABLE_INTEROP_PROVIDER ($(PEGASUS_ENABLE_INTEROP_PROVIDER)) invalid, must be true if DMTF Indications profile support is enabled)
+            endif
+        endif
+        DEFINES += -DPEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+    else
+        ifneq ($(PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT),false)
+            $(error PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT ($(PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT)) invalid, must be true or false)
+        endif
+    endif
+endif
 
 ############################################################################
 # set PEGASUS_DEBUG into the DEFINES if it exists.
index bb884b7ae4016cdfe18838c74e30f8acd463f6d6..b3323f7d36ffec9bd4f2c40e47513561b9887d08 100644 (file)
@@ -126,6 +126,24 @@ const CIMName PEGASUS_CLASSNAME_WBEMSLPTEMPLATE =
 
 #endif
 
+// DMTF Indications profile classes
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+const CIMName PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE =
+    CIMName("CIM_IndicationService");
+
+const CIMName PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES =
+    CIMName("CIM_IndicationServiceCapabilities");
+
+const CIMName PEGASUS_CLASSNAME_PG_ELEMENTCAPABILITIES =
+    CIMName("PG_ElementCapabilities");
+
+const CIMName PEGASUS_CLASSNAME_PG_HOSTEDINDICATIONSERVICE =
+    CIMName("PG_HostedIndicationService");
+
+const CIMName PEGASUS_CLASSNAME_PG_SERVICEAFFECTSELEMENT = 
+    CIMName("PG_ServiceAffectsElement");
+#endif
+
 //
 // Property Names
 //
index b22100e8c53da7d3a19761546568084ef1035c42..a3d6b390190ea88df65a204d6efb487a4cefc691 100644 (file)
@@ -582,6 +582,20 @@ PEGASUS_COMMON_LINKAGE
 PEGASUS_COMMON_LINKAGE extern const CIMName PEGASUS_CLASSNAME_WBEMSLPTEMPLATE;
 #endif
 
+// DMTF Indications profile classes
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+PEGASUS_COMMON_LINKAGE
+    extern const CIMName PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE;
+PEGASUS_COMMON_LINKAGE
+    extern const CIMName PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES;
+PEGASUS_COMMON_LINKAGE
+    extern const CIMName PEGASUS_CLASSNAME_PG_ELEMENTCAPABILITIES;
+PEGASUS_COMMON_LINKAGE
+    extern const CIMName PEGASUS_CLASSNAME_PG_HOSTEDINDICATIONSERVICE;
+PEGASUS_COMMON_LINKAGE
+    extern const CIMName PEGASUS_CLASSNAME_PG_SERVICEAFFECTSELEMENT;
+#endif
+
 //
 // Property Names Indication Subscriptions
 //
index fd87541032a343819189b7fd0ab692e20a13577e..f62e56f960fc380e8a5a15aaaf729375dfa64435 100644 (file)
@@ -53,6 +53,13 @@ const CIMName COMMON_PROPERTY_INSTANCEID("InstanceId");
 const CIMName PROPERTY_ANTECEDENT("Antecedent");
 const CIMName PROPERTY_DEPENDENT("Dependent");
 
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+const CIMName PROPERTY_AFFECTEDELEMENT = CIMName("AffectedElement");
+const CIMName PROPERTY_AFFECTINGELEMENT = CIMName("AffectingElement");
+const CIMName PROPERTY_CAPABILITIES = CIMName("Capabilities");
+const CIMName PROPERTY_MANAGEDELEMENT = CIMName("ManagedElement");
+#endif
+
 // Property names for ProviderProfileCapabilities
 const CIMName PROFILECAPABILITIES_PROPERTY_REGISTEREDPROFILE(
         "RegisteredProfile");
@@ -136,10 +143,13 @@ const Uint16 DMTF_NUM = 2;
 const String DMTF_VER_100("1.0.0");
 
 const String INTEROP_PROVIDER_NAME("Interoperability Provider");
+const String INDICATION_SERVICE_NAME("Indication Service");
 const String PEGASUS_MODULE_NAME = String(PEGASUS_CIMOM_GENERIC_NAME) +
     String(" ") + String(PEGASUS_PRODUCT_NAME);
 const String PEGASUS_INTERNAL_PROVIDER_TYPE(
     "Internal Control Provider");
+const String PEGASUS_INTERNAL_SERVICE_TYPE(
+    "Internal Service");
 const String PEGASUS_DYNAMIC("__DYNAMIC_");
 const Uint32 PEGASUS_DYNAMIC_LEN(PEGASUS_DYNAMIC.size());
 const CIMNamespaceName PEGASUS_NAMESPACENAME_ROOT("root");
index fd484c4962ddd446bb2d8f5b139ed4d6dd1b9c13..4a3c2262a407d974a096070c6da8e12ea403c7f4 100644 (file)
@@ -123,7 +123,12 @@ CIMInstance InteropProvider::localGetInstance(
     CIMNamespaceName opNamespace = instanceName.getNameSpace();
     CIMName opClass = instanceName.getClassName();
     if(opNamespace != PEGASUS_NAMESPACENAME_INTEROP &&
-        opClass != PEGASUS_CLASSNAME_PG_ELEMENTCONFORMSTOPROFILE)
+        opClass != PEGASUS_CLASSNAME_PG_ELEMENTCONFORMSTOPROFILE
+        // Get CIM_IndicationService instance from IndicationService.
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+        || opClass == PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE
+#endif
+        )
     {
         AutoMutex mut(interopMut);
         CIMInstance gotInstance = cimomHandle.getInstance(
@@ -306,6 +311,24 @@ Array<CIMInstance> InteropProvider::localEnumerateInstances(
             instances = enumProviderProfileCapabilityInstances(false, false);
             break;
         }
+
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+        case PG_ELEMENTCAPABILITIES:
+        {
+            instances = enumElementCapabilityInstances(context);
+            break;
+        }
+        case PG_HOSTEDINDICATIONSERVICE:
+        {
+            instances = enumHostedIndicationServiceInstances(context);
+            break;
+        }
+        case PG_SERVICEAFFECTSELEMENT:
+        {
+            instances = enumServiceAffectsElementInstances(context);
+            break;
+        }
+#endif
         default:
             PEG_METHOD_EXIT();
             throw CIMNotSupportedException(className.getString() +
@@ -602,6 +625,15 @@ bool InteropProvider::validAssocClassForObject(
               expectedOriginRole = PROPERTY_DEPENDENT;
           }
           break;
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+      case PG_HOSTEDINDICATIONSERVICE:
+          if(originClassEnum == PG_COMPUTERSYSTEM)
+          {
+              expectedTargetRole = PROPERTY_DEPENDENT;
+              expectedOriginRole = PROPERTY_ANTECEDENT;
+          }
+          break;
+#endif
       default:
           break;
     }
index 2afef1c23ce01b8fba88da810e14aa1ea693c358..0820f7105a4cdfb9cf0875c9fd66d36eecc6ee12 100644 (file)
@@ -288,6 +288,20 @@ private:
         Boolean includeClassOrigin = false,
         const CIMPropertyList &propertyList = CIMPropertyList());
 
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+    Array<CIMInstance> enumElementCapabilityInstances(
+        const OperationContext & opContext);
+    Array<CIMInstance> enumHostedIndicationServiceInstances(
+        const OperationContext & opContext);
+    Array<CIMInstance> enumServiceAffectsElementInstances(
+        const OperationContext & opContext);
+    CIMInstance buildAssociationInstance(
+        const CIMName &className,
+        const CIMName &propName1,
+        const CIMObjectPath &objPath1,
+        const CIMName &propName2,
+        const CIMObjectPath &objPath2);
+#endif
 
     CIMInstance buildRegisteredProfile(
         const String & instanceId,
index 3db9e65575cbe077c0270d977bbfc0875b532514..9087aee94b237dbb3426c14f02edbb5ac835b070 100644 (file)
@@ -481,6 +481,17 @@ TARGET_CLASS translateClassInput(const CIMName& className)
     else if(className.equal(PEGASUS_CLASSNAME_PG_PROVIDERREFERENCEDPROFILES))
         return PG_PROVIDERREFERENCEDPROFILES;
 
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+    else if(className.equal(PEGASUS_CLASSNAME_PG_ELEMENTCAPABILITIES))
+        return PG_ELEMENTCAPABILITIES;
+
+    else if(className.equal(PEGASUS_CLASSNAME_PG_HOSTEDINDICATIONSERVICE))
+        return PG_HOSTEDINDICATIONSERVICE;
+
+    else if(className.equal(PEGASUS_CLASSNAME_PG_SERVICEAFFECTSELEMENT))
+        return PG_SERVICEAFFECTSELEMENT;
+#endif
+
     // Last entry, reverse test and throw exception if not PG_Namespace
     // Note: Changed to PG_Namespace for CIM 2.4
     else if(!className.equal(PEGASUS_CLASSNAME_PGNAMESPACE))
index 6aea28ef1def38e14931258be0746246a475b42a..3980913f8fdf71153ed8925adfc4a1c2b0e41611 100644 (file)
@@ -62,7 +62,12 @@ enum TARGET_CLASS {
         PG_ELEMENTCONFORMSTOPROFILE_RP_RP,
         CIM_NAMESPACE,
         PG_PROVIDERPROFILECAPABILITIES,
-        PG_PROVIDERREFERENCEDPROFILES
+        PG_PROVIDERREFERENCEDPROFILES,
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+        PG_ELEMENTCAPABILITIES,
+        PG_HOSTEDINDICATIONSERVICE,
+        PG_SERVICEAFFECTSELEMENT
+#endif
 };
 
 /***************************************************************
index 7721254d884bc58f67c9008c210701ccdd8b7e58..20047b32d45cd85af5d56f181e64b06837d3b509 100644 (file)
@@ -559,7 +559,46 @@ Array<CIMInstance> InteropProvider::getDMTFProfileInstances(
             DMTF_VER_100, DMTF_NUM,
             String::EMPTY,
             registeredProfileClass));
+
+        // Build  DMTF Indications Profile instance.
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+        String indProfileId = buildProfileInstanceId(
+            DMTF_NAME,
+            "Indication",
+            DMTF_VER_100);
+        instances.append(
+            buildRegisteredProfile(
+            indProfileId,
+            "Indication",
+            DMTF_VER_100,
+            DMTF_NUM,
+            String::EMPTY,
+            registeredProfileClass));
+#endif
     }
+    // Build Refernced profile association between DMTF Profile Registration
+    // and DMTF Indications Profile.
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+    else
+    {
+        String profileRegId = buildProfileInstanceId(
+            DMTF_NAME,
+            "Profile Registration",
+            DMTF_VER_100);
+
+        String indProfileId = buildProfileInstanceId(
+            DMTF_NAME,
+            "Indication",
+            DMTF_VER_100);
+
+        buildDependencyInstance(
+            profileRegId,
+            PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE,
+            indProfileId,
+            PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE,
+            referencedProfileClass);
+    }
+#endif
 
     return instances; 
 }
index cf1cab7d130ff478afc7f99ac0fc9fff86dae1f5..f58cf6e2052dbe497c5a62ec9e6f66411257d3f6 100644 (file)
@@ -744,6 +744,227 @@ Array<CIMInstance> InteropProvider::enumCommMechanismForManagerInstances()
     return assocInstances;
 }
 
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+
+CIMInstance InteropProvider::buildAssociationInstance(
+    const CIMName &className,
+    const CIMName &propName1,
+    const CIMObjectPath &objPath1,
+    const CIMName &propName2,
+    const CIMObjectPath &objPath2)
+{
+    CIMClass cimClass = repository->getClass(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        className,
+        false,
+        true,
+        true);
+
+    CIMInstance instance = cimClass.buildInstance(
+        true,
+        true,
+        CIMPropertyList());
+
+    instance.getProperty(instance.findProperty(propName1)).setValue(objPath1);
+    instance.getProperty(instance.findProperty(propName2)).setValue(objPath2);
+    instance.setPath(instance.buildPath(cimClass));
+
+    return instance;
+}
+
+Array<CIMInstance> InteropProvider::enumElementCapabilityInstances(
+    const OperationContext &opContext)
+{
+    // Get CIM_IndicationServiceCapabilities instance
+    Array<CIMObjectPath> capPaths = cimomHandle.enumerateInstanceNames(
+        opContext,
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES);
+    PEGASUS_ASSERT(capPaths.size() == 1);
+
+    // Get CIM_IndicationService instance
+    Array<CIMObjectPath> servicePaths = cimomHandle.enumerateInstanceNames(
+        opContext,
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE);
+    PEGASUS_ASSERT(servicePaths.size() == 1);
+
+    Array<CIMInstance> instances;
+
+    instances.append(
+        buildAssociationInstance(
+            PEGASUS_CLASSNAME_PG_ELEMENTCAPABILITIES,
+            PROPERTY_CAPABILITIES,
+            capPaths[0],
+            PROPERTY_MANAGEDELEMENT,
+            servicePaths[0]));
+
+    return instances;
+}
+
+Array<CIMInstance> InteropProvider::enumHostedIndicationServiceInstances(
+    const OperationContext &opContext)
+{
+    Array<CIMInstance> instances;
+    CIMInstance cInst = getComputerSystemInstance();
+
+    // Get CIM_IndicationService instance
+    Array<CIMObjectPath> servicePaths = cimomHandle.enumerateInstanceNames(
+        opContext,
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE);
+
+    PEGASUS_ASSERT(servicePaths.size() == 1);
+
+    instances.append(
+        buildAssociationInstance(
+            PEGASUS_CLASSNAME_PG_HOSTEDINDICATIONSERVICE,
+            PROPERTY_ANTECEDENT,
+            cInst.getPath(),
+            PROPERTY_DEPENDENT,
+            servicePaths[0]));
+
+    return instances;
+}
+
+Array<CIMInstance> InteropProvider::enumServiceAffectsElementInstances(
+    const OperationContext &opContext)
+{
+    Array<CIMInstance> instances;
+
+    // Get CIM_IndicationService instance
+    Array<CIMObjectPath> servicePaths = cimomHandle.enumerateInstanceNames(
+        opContext,
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE);
+    PEGASUS_ASSERT(servicePaths.size() == 1);
+
+    Array<CIMNamespaceName> namespaceNames = repository->enumerateNameSpaces();
+    // Get CIM_IndicationFilter and CIM_ListenerDestination instances in all
+    // namespaces and associate them with CIM_IndicationService instance using
+    // PG_ServiceAffectsElement instance.
+    for (Uint32 i = 0, n = namespaceNames.size() ; i < n ; ++i)
+    { 
+        Array<CIMObjectPath> filterPaths;
+        try
+        { 
+            // Get CIM_IndicationFilter instance names
+            filterPaths = cimomHandle.enumerateInstanceNames(
+                opContext,
+                namespaceNames[i],
+                PEGASUS_CLASSNAME_INDFILTER);
+        }
+        catch(CIMException &e)
+        {
+            // Ignore exception with CIM_ERR_INVALID_CLASS code. This will
+            // happen when the class CIM_IndicationFilter can not be found
+            // in this namespace.
+            if (e.getCode() != CIM_ERR_INVALID_CLASS)
+            {
+                PEG_TRACE((
+                    TRC_CONTROLPROVIDER,
+                    Tracer::LEVEL1,
+                    "CIMException while enumerating the "
+                        "CIM_IndicationFilter instances"
+                            " in the namespace %s: %s.",
+                     (const char*)namespaceNames[i].getString().getCString(),
+                     (const char*)e.getMessage().getCString()));
+            }
+        }
+        catch(Exception &e)
+        {
+            PEG_TRACE((
+                TRC_CONTROLPROVIDER,
+                Tracer::LEVEL1,
+                "Exception while enumerating the "
+                    "CIM_IndicationFilter instances"
+                        " in the namespace %s: %s.",
+                (const char*)namespaceNames[i].getString().getCString(),
+                (const char*)e.getMessage().getCString()));
+        }
+        catch(...)
+        {
+            PEG_TRACE((
+                TRC_CONTROLPROVIDER,
+                Tracer::LEVEL3,
+                "Unknown error occurred while enumerating the "
+                    "CIM_IndicationFilter instances in the namespace %s.",
+                (const char*)namespaceNames[i].getString().getCString()));
+        }
+        for (Uint32 f = 0, fn = filterPaths.size(); f < fn ; ++f)
+        {
+            filterPaths[f].setNameSpace(namespaceNames[i]);
+            instances.append(
+                buildAssociationInstance(
+                    PEGASUS_CLASSNAME_PG_SERVICEAFFECTSELEMENT,
+                    PROPERTY_AFFECTEDELEMENT,
+                    filterPaths[f],
+                    PROPERTY_AFFECTINGELEMENT,
+                    servicePaths[0]));
+        }
+
+        Array<CIMObjectPath> handlerPaths;
+        try
+        {
+            // Get CIM_ListenerDestination instance names
+            handlerPaths = cimomHandle.enumerateInstanceNames(
+                opContext,
+                namespaceNames[i],
+                PEGASUS_CLASSNAME_LSTNRDST);
+        }
+        catch(CIMException &e)
+        {
+            // Ignore exception with CIM_ERR_INVALID_CLASS code. This will
+            // happen when the class CIM_ListenerDestination can not be found
+            // in this namespace.
+            if (e.getCode() != CIM_ERR_INVALID_CLASS)
+            {
+                PEG_TRACE((
+                    TRC_CONTROLPROVIDER,
+                    Tracer::LEVEL1,
+                    "CIMException while enumerating the "
+                        "CIM_ListenerDestination instances"
+                            " in the namespace %s: %s.",
+                     (const char*)namespaceNames[i].getString().getCString(),
+                     (const char*)e.getMessage().getCString()));
+            }
+        }
+        catch(Exception &e)
+        {
+            PEG_TRACE((
+                TRC_CONTROLPROVIDER,
+                Tracer::LEVEL1,
+                "Exception while enumerating the "
+                    "CIM_ListenerDestination instances"
+                        " in the namespace %s: %s.",
+                (const char*)namespaceNames[i].getString().getCString(),
+                (const char*)e.getMessage().getCString()));
+        }
+        catch(...)
+        {
+            PEG_TRACE((
+                TRC_CONTROLPROVIDER,
+                Tracer::LEVEL3,
+                "Unknown error occurred while enumerating the "
+                    "CIM_ListenerDestination instances in the namespace %s.",
+                (const char*)namespaceNames[i].getString().getCString()));
+        }
+        for (Uint32 h = 0, hn = handlerPaths.size(); h < hn ; ++h)
+        {
+            handlerPaths[h].setNameSpace(namespaceNames[i]);
+            instances.append(
+                buildAssociationInstance(
+                    PEGASUS_CLASSNAME_PG_SERVICEAFFECTSELEMENT,
+                    PROPERTY_AFFECTEDELEMENT,
+                    handlerPaths[h],
+                    PROPERTY_AFFECTINGELEMENT,
+                    servicePaths[0]));
+        }
+    }
+    return instances;
+}
+#endif
+
 PEGASUS_NAMESPACE_END
 
 // END OF FILE
index b793d7b20b11c42faa1404dd8857f5ae7a1c09fa..b04188b7ac665d0c63772d98e4f60a4abfdaae1e 100644 (file)
@@ -34,6 +34,8 @@
 #include <Pegasus/Common/CIMObjectPath.h>
 #include <Pegasus/Common/CIMInstance.h>
 #include <Pegasus/Common/String.h>
+#include <Pegasus/Common/Constants.h>
+#include <Pegasus/Common/PegasusAssert.h>
 
 #include <Pegasus/Client/CIMClient.h>
 
@@ -467,6 +469,151 @@ void testDMTFProfileInstances(CIMClient &client)
     cout << "Test Complete" << endl;
 }
 
+//
+// ATTN: The following indications profile tests will be removed once the
+// association opertaions are implemented for these classes. At present these
+// tests are pegasus specific.
+//
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+void _testHostedIndicationServiceInstance(CIMClient &client)
+{
+    cout << "Testing Association Class "
+        << (const char *)PEGASUS_CLASSNAME_PG_HOSTEDINDICATIONSERVICE.
+             getString().getCString()
+        << "...";
+    // Get PG_HostedIndicationService Instances
+    Array<CIMInstance> hostedInstances = client.enumerateInstances(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_PG_HOSTEDINDICATIONSERVICE);
+    PEGASUS_TEST_ASSERT(hostedInstances.size() == 1);
+
+    // Get PG_HostedIndicationService Instance names
+    Array<CIMObjectPath> hostedPaths = client.enumerateInstanceNames(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_PG_HOSTEDINDICATIONSERVICE);
+    PEGASUS_TEST_ASSERT(hostedPaths.size() == 1);
+
+    // Get CIM_IndicationService instance names
+    Array<CIMObjectPath> servicePaths = client.enumerateInstanceNames(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE);
+    PEGASUS_TEST_ASSERT(servicePaths.size() == 1);
+
+    // Test the CIM_IndicationService value.
+    CIMValue capValue = hostedInstances[0].getProperty(
+        hostedInstances[0].findProperty("Dependent")).getValue();
+    CIMObjectPath testPath;
+    capValue.get(testPath);
+    testPath.setNameSpace(CIMNamespaceName());
+    PEGASUS_TEST_ASSERT(testPath.identical(servicePaths[0]));
+
+    cout << "Test Complete" << endl;
+}
+
+void _testElementCapabilityInstance(CIMClient &client)
+{
+    cout << "Testing Association Class "
+        << (const char *)PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES.
+             getString().getCString()
+        << "...";
+
+    // Get CIM_IndicationServiceCapabilities instance names
+    Array<CIMObjectPath> capPaths = client.enumerateInstanceNames(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES);
+    PEGASUS_TEST_ASSERT(capPaths.size() == 1);
+
+    // Get CIM_IndicationService instance names
+    Array<CIMObjectPath> servicePaths = client.enumerateInstanceNames(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE);
+    PEGASUS_TEST_ASSERT(servicePaths.size() == 1);
+
+
+    // Get PG_ElementCapabilities instances
+    Array<CIMInstance> eleInstances = client.enumerateInstances(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_PG_ELEMENTCAPABILITIES);
+    PEGASUS_TEST_ASSERT(eleInstances.size() == 1);
+
+    // Test PG_ElementCapabilities instance.
+    CIMValue capValue = eleInstances[0].getProperty(
+        eleInstances[0].findProperty("Capabilities")).getValue();
+
+    CIMValue meValue = eleInstances[0].getProperty(
+        eleInstances[0].findProperty("ManagedElement")).getValue();
+
+    // Now test the instance names of CIM_IndicationService instance and
+    // CIM_IndicationServiceCapabilities instance.
+    CIMObjectPath testPath;
+    capValue.get(testPath);
+    testPath.setNameSpace(CIMNamespaceName());
+    PEGASUS_TEST_ASSERT(testPath.identical(capPaths[0]));
+
+    meValue.get(testPath);
+    testPath.setNameSpace(CIMNamespaceName());
+    PEGASUS_TEST_ASSERT(testPath.identical(servicePaths[0]));
+
+    cout << "Test Complete" << endl;
+}
+
+void _testServiceAffectsElementInstances(CIMClient &client)
+{
+    cout << "Testing Association Class "
+        << (const char *)PEGASUS_CLASSNAME_PG_SERVICEAFFECTSELEMENT.
+             getString().getCString()
+        << "...";
+
+    // Get PG_ServiceAffectsElement instances.
+    Array<CIMInstance> sfInstances = client.enumerateInstances(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_PG_SERVICEAFFECTSELEMENT);
+
+    // Get PG_ServiceAffectsElement instance names
+    Array<CIMObjectPath> sfPaths = client.enumerateInstanceNames(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_PG_SERVICEAFFECTSELEMENT);
+
+    PEGASUS_TEST_ASSERT(sfInstances.size() == sfPaths.size());
+
+    // Get CIM_IndicationFilter instance names
+    Array<CIMObjectPath> filterPaths = client.enumerateInstanceNames(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_INDFILTER);
+
+    // Get CIM_ListenerDestination instance names
+    Array<CIMObjectPath> handlerPaths = client.enumerateInstanceNames(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_LSTNRDST);
+
+    // Count only handlers and filters from interop namespace
+    Uint32 elements = 0;
+    for (Uint32 i = 0; i < sfInstances.size() ; ++i)
+    {
+        CIMValue value = sfInstances[i].getProperty(
+            sfInstances[i].findProperty("AffectedElement")).getValue();
+        CIMObjectPath path;
+        value.get(path);
+        PEGASUS_TEST_ASSERT(path.getNameSpace() != CIMNamespaceName());
+        if (path.getNameSpace() == PEGASUS_NAMESPACENAME_INTEROP)
+        {
+             elements++;
+        }
+    }
+    PEGASUS_TEST_ASSERT(
+        elements == (filterPaths.size() + handlerPaths.size()));
+
+    cout << "Test Complete" << endl;
+}
+
+void testIndicationProfileInstances(CIMClient &client)
+{
+    _testHostedIndicationServiceInstance(client);
+    _testElementCapabilityInstance(client);
+    _testServiceAffectsElementInstances(client);
+}
+#endif
+
 ///////////////////////////////////////////////////////////////
 //    MAIN
 ///////////////////////////////////////////////////////////////
@@ -530,6 +677,9 @@ int main(int argc, char** argv)
     }
 
     testDMTFProfileInstances(client);
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+    testIndicationProfileInstances(client);
+#endif
     //testAssociationTraversal(client);
 
     cout << endl << "Server Profile Tests complete" << endl;
index 64965ea30dd4958bd155e232ead6795f804aceaf..634cfa78e3d41d8f47b120ebc542b352a458521a 100644 (file)
@@ -339,6 +339,27 @@ Array<CIMInstance> InteropProvider::enumSoftwareIdentityInstances()
         PEGASUS_PRODUCT_VERSION,
         0, 0, 0, 0, false, // no extended revision info
         PEGASUS_INTERNAL_PROVIDER_TYPE, String::EMPTY, String::EMPTY));
+
+    // Pegasus Indication Service acts as Provider for CIM Event classes.
+    // If DMTF Indications Profile support is enabled create SoftwareIdentity
+    // instance with Pegasus Indication Service.
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+    instances.append(
+        buildSoftwareIdentity(
+            PEGASUS_MODULE_NAME,
+            INDICATION_SERVICE_NAME,
+            PEGASUS_CIMOM_GENERIC_NAME,
+            PEGASUS_PRODUCT_VERSION,
+            0,
+            0,
+            0,
+            0,
+            false, // no extended revision info
+            PEGASUS_INTERNAL_SERVICE_TYPE,
+            String::EMPTY,
+            String::EMPTY));
+#endif
+
     return instances;
 }
 
@@ -531,6 +552,25 @@ Array<CIMInstance> InteropProvider::enumElementSoftwareIdentityInstances()
         PEGASUS_CLASSNAME_PG_REGISTEREDSUBPROFILE,
         elementSoftwareIdentityClass));
 
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+    String indProfileId = buildProfileInstanceId(
+        DMTF_NAME,
+        "Indication",
+        DMTF_VER_100);
+
+    String indicationServiceSoftwareIdentity(PEGASUS_MODULE_NAME);
+    indicationServiceSoftwareIdentity.append("+");
+    indicationServiceSoftwareIdentity.append(INDICATION_SERVICE_NAME);
+
+    instances.append(
+        buildDependencyInstance(
+            indicationServiceSoftwareIdentity,
+            PEGASUS_CLASSNAME_PG_SOFTWAREIDENTITY,
+            indProfileId,
+            PEGASUS_CLASSNAME_PG_REGISTEREDPROFILE,
+            elementSoftwareIdentityClass));
+#endif
+
     return instances;
 }
 
index 28291f027c2541f58284753d1579b606922efbac..af975da300b638b57a54d35e283557888412eb21 100644 (file)
@@ -263,6 +263,120 @@ const CIMName _PROPERTY_PERCEIVEDSEVERITY =
  */
 const CIMName _PROPERTY_PROBABLECAUSE = CIMName("ProbableCause");
 
+/**
+    The name of the CreationClassName property of CIM_Service class.
+*/
+const CIMName _PROPERTY_CREATIONCLASSNAME =
+    CIMName("CreationClassName");
+
+/**
+    The name of the Name property of CIM_Service class.
+*/
+const CIMName _PROPERTY_NAME = CIMName("Name");
+
+/**
+    The name of the Started property of CIM_Service class.
+*/
+const CIMName _PROPERTY_STARTED = CIMName("Started");
+
+/**
+    The name of the  InstanceID property of CIM_Capabilities
+    class.
+*/
+const CIMName _PROPERTY_INSTANCEID = CIMName("InstanceID");
+
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+/**
+    The name of the FilterCreationEnabled property of IndicationService class.
+*/
+const CIMName _PROPERTY_FILTERCREATIONENABLED =
+    CIMName("FilterCreationEnabled");
+
+/**
+    The name of the SubscriptionRemovalAction property of IndicationService
+    class.
+*/
+const CIMName _PROPERTY_SUBSCRIPTIONREMOVALACTION =
+    CIMName("SubscriptionRemovalAction");
+
+/**
+    The name of the SubscriptionRemovalTimeInterval property of
+    IndicationService class.
+*/
+const CIMName _PROPERTY_SUBSCRIPTIONREMOVALTIMEINTERVAL =
+    CIMName("SubscriptionRemovalTimeInterval");
+
+/**
+    The name of the DeliveryRetryAttempts property of
+    IndicationService class.
+*/
+const CIMName _PROPERTY_DELIVERYRETRYATTEMPTS =
+    CIMName("DeliveryRetryAttempts");
+
+/**
+    The name of the DeliveryRetryInterval property of
+    IndicationService class.
+*/
+const CIMName _PROPERTY_DELIVERYRETRYINTERVAL =
+    CIMName("DeliveryRetryInterval");
+/**
+    The name of the FilterCreationEnabledIsSettable property of
+    IndicationServiceCapabilities class.
+*/
+const CIMName _PROPERTY_FILTERCREATIONENABLEDISSETTABLE =
+    CIMName("FilterCreationEnabledIsSettable");
+
+/**
+    The name of the DeliveryRetryAttemptsIsSettable property of
+    IndicationServiceCapabilities class.
+*/
+const CIMName _PROPERTY_DELIVERYRETRYATTEMPTSISSETTABLE =
+    CIMName("DeliveryRetryAttemptsIsSettable");
+
+/**
+    The name of the DeliveryRetryIntervalIsSettable property of
+    IndicationServiceCapabilities class.
+*/
+const CIMName _PROPERTY_DELIVERYRETRYINTERVALISSETTABLE =
+    CIMName("DeliveryRetryIntervalIsSettable");
+
+/**
+    The name of the SubscriptionRemovalActionIsSettable property of
+    IndicationServiceCapabilities class.
+*/
+const CIMName _PROPERTY_SUBSCRIPTIONREMOVALACTIONISSETTABLE =
+    CIMName("SubscriptionRemovalActionIsSettable");
+
+/**
+    The name of the SubscriptionRemovalTimeIntervalIsSettable property of
+    IndicationServiceCapabilities class.
+*/
+const CIMName _PROPERTY_SUBSCRIPTIONREMOVALTIMEINTERVALISSETTABLE =
+    CIMName("SubscriptionRemovalTimeIntervalIsSettable");
+
+/**
+    The name of the MaxListenerDestinations property of
+    IndicationServiceCapabilities class.
+*/
+const CIMName _PROPERTY_MAXLISTENERDESTINATIONS =
+    CIMName("MaxListenerDestinations");
+
+/**
+    The name of the MaxActiveSubscriptions property of
+    IndicationServiceCapabilities class.
+*/
+const CIMName _PROPERTY_MAXACTIVESUBSCRIPTIONS =
+    CIMName("MaxActiveSubscriptions");
+
+/**
+    The name of the SubscriptionsPersisted property of
+    IndicationServiceCapabilities class.
+*/
+const CIMName _PROPERTY_SUBSCRIPTIONSPERSISTED =
+    CIMName("SubscriptionsPersisted");
+
+#endif
+
 //
 //  Qualifier names
 //
index 99f8ff5342e0f182dd882c70f1124c6c83a29418..8f69e1bfa605787e0cf5d6897216a00540f05913 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <Pegasus/Common/Config.h>
 #include <Pegasus/Common/CIMName.h>
+#include <Pegasus/Server/Linkage.h>
 
 PEGASUS_NAMESPACE_BEGIN
 
@@ -286,6 +287,129 @@ extern const CIMName _PROPERTY_PERCEIVEDSEVERITY;
  */
 extern const CIMName _PROPERTY_PROBABLECAUSE;
 
+/**
+    The name of the CreationClassName property of CIM_Service class.
+*/
+extern const CIMName _PROPERTY_CREATIONCLASSNAME;
+
+/**
+    The name of the Name property of CIM_Service class.
+*/
+extern const CIMName _PROPERTY_NAME;
+
+/**
+    The name of the ElementName property of CIM_MangedElement class.
+*/
+extern const CIMName _PROPERTY_ELEMENTNAME;
+
+/**
+    The name of the Started property of CIM_Service class.
+*/
+extern const CIMName _PROPERTY_STARTED;
+
+/**
+    The name of the InstanceID property of CIM_Capabilities
+    class.
+*/
+extern const CIMName _PROPERTY_INSTANCEID;
+
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+/**
+    The name of the FilterCreationEnabled property of IndicationService class.
+*/
+PEGASUS_SERVER_LINKAGE extern const CIMName _PROPERTY_FILTERCREATIONENABLED;
+
+/**
+    The name of the SubscriptionRemovalAction property of IndicationService
+    class.
+*/
+PEGASUS_SERVER_LINKAGE extern const CIMName _PROPERTY_SUBSCRIPTIONREMOVALACTION;
+
+/**
+    The name of the SubscriptionRemovalTimeInterval property of
+    IndicationService class.
+*/
+PEGASUS_SERVER_LINKAGE extern const 
+    CIMName _PROPERTY_SUBSCRIPTIONREMOVALTIMEINTERVAL;
+
+/**
+    The name of the DeliveryRetryAttempts property of
+    IndicationService class.
+*/
+PEGASUS_SERVER_LINKAGE extern const CIMName _PROPERTY_DELIVERYRETRYATTEMPTS;
+
+/**
+    The name of the DeliveryRetryInterval property of
+    IndicationService class.
+*/
+PEGASUS_SERVER_LINKAGE extern const CIMName _PROPERTY_DELIVERYRETRYINTERVAL;
+
+/**
+    The name of the FilterCreationEnabledIsSettable property of
+    IndicationServiceCapabilities class.
+*/
+PEGASUS_SERVER_LINKAGE extern const CIMName 
+    _PROPERTY_FILTERCREATIONENABLEDISSETTABLE;
+
+/**
+    The name of the DeliveryRetryAttemptsIsSettable property of
+    IndicationServiceCapabilities class.
+*/
+PEGASUS_SERVER_LINKAGE extern const CIMName 
+    _PROPERTY_DELIVERYRETRYATTEMPTSISSETTABLE;
+
+/**
+    The name of the DeliveryRetryIntervalIsSettable property of
+    IndicationServiceCapabilities class.
+*/
+PEGASUS_SERVER_LINKAGE extern const CIMName 
+    _PROPERTY_DELIVERYRETRYINTERVALISSETTABLE;
+
+/**
+    The name of the SubscriptionRemovalActionIsSettable property of
+    IndicationServiceCapabilities class.
+*/
+PEGASUS_SERVER_LINKAGE extern const CIMName 
+    _PROPERTY_SUBSCRIPTIONREMOVALACTIONISSETTABLE;
+
+/**
+    The name of the SubscriptionRemovalTimeIntervalIsSettable property of
+    IndicationServiceCapabilities class.
+*/
+PEGASUS_SERVER_LINKAGE extern const CIMName 
+    _PROPERTY_SUBSCRIPTIONREMOVALTIMEINTERVALISSETTABLE;
+
+/**
+    The name of the MaxListenerDestinations property of
+    IndicationServiceCapabilities class.
+*/
+PEGASUS_SERVER_LINKAGE extern const CIMName 
+    _PROPERTY_MAXLISTENERDESTINATIONS;
+
+/**
+    The name of the MaxActiveSubscriptions property of
+    IndicationServiceCapabilities class.
+*/
+PEGASUS_SERVER_LINKAGE extern const CIMName _PROPERTY_MAXACTIVESUBSCRIPTIONS;
+
+/**
+    The name of the SubscriptionsPersisted property of
+    IndicationServiceCapabilities class.
+*/
+PEGASUS_SERVER_LINKAGE extern const CIMName _PROPERTY_SUBSCRIPTIONSPERSISTED;
+
+/**
+    CIM_IndicationService instance default values.
+*/
+
+const Boolean _PROPERTY_FILTERCREATIONENABLED_VALUE = true;
+const Uint16 _PROPERTY_SUBSCRIPTIONREMOVALACTION_VALUE = 4;
+const Uint64 _PROPERTY_SUBSCRIPTIONREMOVALTIMEINTERVAL_VALUE = 2592000;
+const Uint16 _PROPERTY_DELIVERYRETRYATTEMPTS_VALUE = 3;
+const Uint64 _PROPERTY_DELIVERYRETRYINTERVAL_VALUE = 30;
+
+#endif
+
 //
 //  Qualifier names
 //
index 5ce87698c33a223408bef89f8b7d44961c0bd0dd..db7348a31c00c1b7148ddf3a293fa124a5bc8421 100644 (file)
@@ -141,6 +141,14 @@ IndicationService::IndicationService(
         //
         _subscriptionRepository = new SubscriptionRepository(repository);
 
+       //
+       // Create IndicationsProfileInstance Repository
+       //
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+        _indicationServiceConfiguration = 
+            new IndicationServiceConfiguration(repository);
+#endif
+
         //
         //  Create Subscription Table
         //
@@ -161,6 +169,10 @@ IndicationService::~IndicationService()
 {
     delete _subscriptionTable;
     delete _subscriptionRepository;
+
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+    delete _indicationServiceConfiguration;
+#endif
 }
 
 void IndicationService::_handle_async_request(AsyncRequest *req)
@@ -1065,92 +1077,109 @@ void IndicationService::_handleGetInstanceRequest(const Message* message)
             IdentityContainer::NAME)).getUserName();
         _checkNonprivilegedAuthorization(userName);
 
-        //
-        //  Add Creator to property list, if not null
-        //  Also, if a Subscription and Time Remaining is requested,
-        //  Ensure Subscription Duration and Start Time are in property list
-        //
-        Boolean setTimeRemaining;
-        Boolean startTimeAdded;
-        Boolean durationAdded;
-        CIMPropertyList propertyList = request->propertyList;
-        CIMName className = request->instanceName.getClassName();
-        _updatePropertyList(className, propertyList, setTimeRemaining,
-            startTimeAdded, durationAdded);
-
-        //
-        //  Get instance from repository
-        //
-        instance = _subscriptionRepository->getInstance(
-            request->nameSpace, request->instanceName, request->localOnly,
-            request->includeQualifiers, request->includeClassOrigin,
-            propertyList);
-
-        //
-        //  Remove Creator property from instance before returning
-        //
-        String creator;
-        if (!_getCreator(instance, creator))
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+        if (request->className.equal(PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE)||
+            request->className.equal(
+                PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES))
         {
-            //
-            //  This instance from the repository is corrupted
-            //  L10N TODO DONE -- new throw of exception
-            //
-            PEG_METHOD_EXIT();
-            MessageLoaderParms parms(_MSG_INVALID_INSTANCES_KEY,
-                _MSG_INVALID_INSTANCES);
-            throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms);
+            instance = _indicationServiceConfiguration->getInstance(
+                request->nameSpace,
+                request->instanceName,
+                request->localOnly,
+                request->includeQualifiers,
+                request->includeClassOrigin,
+                request->propertyList);
         }
-        instance.removeProperty(instance.findProperty(
-            PEGASUS_PROPERTYNAME_INDSUB_CREATOR));
-
-        //
-        //  Remove the language properties from instance before returning
-        //
-        Uint32 propIndex = instance.findProperty(
-            PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS);
-        if (propIndex != PEG_NOT_FOUND)
+        else
+#endif
         {
-             instance.removeProperty(propIndex);
-        }
+            //
+            //  Add Creator to property list, if not null
+            //  Also, if a Subscription and Time Remaining is requested,
+            //  Ensure Subscription Duration and Start Time are in property list
+            //
+            Boolean setTimeRemaining;
+            Boolean startTimeAdded;
+            Boolean durationAdded;
+            CIMPropertyList propertyList = request->propertyList;
+            CIMName className = request->instanceName.getClassName();
+            _updatePropertyList(
+                className,
+                propertyList,
+                setTimeRemaining,
+                startTimeAdded,
+                durationAdded);
 
-        propIndex = instance.findProperty(
-            PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS);
-        if (propIndex != PEG_NOT_FOUND)
-        {
-             // Get the content languages to be sent in the Content-Language
-             // header
-             instance.getProperty(propIndex).getValue().get(contentLangsString);
-             instance.removeProperty(propIndex);
-        }
+            //
+            //  Get instance from repository
+            //
+            instance = _subscriptionRepository->getInstance(
+                request->nameSpace,
+                request->instanceName,
+                request->localOnly,
+                request->includeQualifiers,
+                request->includeClassOrigin,
+                propertyList);
 
-        //
-        //  If a subscription with a duration, calculate subscription time
-        //  remaining, and add property to the instance
-        //
-        if (setTimeRemaining)
-        {
-            try
-            {
-                _setTimeRemaining(instance);
-            }
-            catch (DateTimeOutOfRangeException&)
+            //
+            //  Remove Creator property from instance before returning
+            //
+            String creator;
+            if (!_getCreator(instance, creator))
             {
                 //
-                //  This instance from the repository is invalid
+                //  This instance from the repository is corrupted
+                //  L10N TODO DONE -- new throw of exception
                 //
-                PEG_METHOD_EXIT();
-                throw;
+                MessageLoaderParms parms(
+                    _MSG_INVALID_INSTANCES_KEY,
+                    _MSG_INVALID_INSTANCES);
+                throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms);
+            }
+            instance.removeProperty(
+                instance.findProperty(
+                    PEGASUS_PROPERTYNAME_INDSUB_CREATOR));
+
+            //
+            //  Remove the language properties from instance before returning
+            //
+            Uint32 propIndex = instance.findProperty(
+                PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS);
+            if (propIndex != PEG_NOT_FOUND)
+            {
+                instance.removeProperty(propIndex);
             }
-            if (startTimeAdded)
+
+            propIndex = instance.findProperty(
+                PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS);
+            if (propIndex != PEG_NOT_FOUND)
             {
-                instance.removeProperty(instance.findProperty(
-                    _PROPERTY_STARTTIME));
+                 // Get the content languages to be sent in the Content-Language
+                 // header
+                 instance.getProperty(propIndex).getValue().
+                     get(contentLangsString);
+                 instance.removeProperty(propIndex);
             }
-            if (durationAdded)
+
+            //
+            //  If a subscription with a duration, calculate subscription time
+            //  remaining, and add property to the instance
+            //
+            if (setTimeRemaining)
             {
-                instance.removeProperty(instance.findProperty(
-                    _PROPERTY_DURATION));
+                _setTimeRemaining(instance);
+                if (startTimeAdded)
+                {
+                    instance.removeProperty(
+                        instance.findProperty(
+                            _PROPERTY_STARTTIME));
+                }
+                if (durationAdded)
+                {
+                    instance.removeProperty(
+                        instance.findProperty(
+                            _PROPERTY_DURATION));
+                }
             }
         }
     }
@@ -1163,7 +1192,11 @@ void IndicationService::_handleGetInstanceRequest(const Message* message)
         cimException =
             PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, exception.getMessage());
     }
-
+    catch(...)
+    {
+        PEG_METHOD_EXIT();
+        throw;
+    }
     CIMGetInstanceResponseMessage * response =
         dynamic_cast<CIMGetInstanceResponseMessage *>(request->buildResponse());
     response->cimException = cimException;
@@ -1195,6 +1228,23 @@ void IndicationService::_handleEnumerateInstancesRequest(const Message* message)
 
     try
     {
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+        if (request->className.equal(PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE) ||
+            request->className.equal(
+                PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES))
+        {
+            returnedInstances = _indicationServiceConfiguration->
+                enumerateInstancesForClass(
+                    request->nameSpace,
+                    request->className,
+                    request->localOnly,
+                    request->includeQualifiers,
+                    request->includeClassOrigin,
+                    request->propertyList);
+        }
+        else
+#endif
+
 #ifdef PEGASUS_ENABLE_INDICATION_COUNT
         if (request->className.equal(PEGASUS_CLASSNAME_PROVIDERINDDATA))
         {
@@ -1373,23 +1423,39 @@ void IndicationService::_handleEnumerateInstanceNamesRequest(
 
     CIMException cimException;
 
-    try
-    {
-        String userName = ((IdentityContainer)request->operationContext.get(
-            IdentityContainer::NAME)).getUserName();
-        _checkNonprivilegedAuthorization(userName);
-        enumInstanceNames =
-            _subscriptionRepository->enumerateInstanceNamesForClass(
-                request->nameSpace, request->className);
-    }
-    catch (CIMException& exception)
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+    if (request->className.equal(PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE) ||
+        request->className.equal(
+            PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES))
     {
-        cimException = exception;
+        enumInstanceNames = _indicationServiceConfiguration->
+            enumerateInstanceNamesForClass(
+                request->nameSpace,
+                request->className);
     }
-    catch (Exception& exception)
+    else
+#endif
     {
-        cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,
-                                             exception.getMessage());
+        try
+        {
+            String userName = ((IdentityContainer)request->operationContext.get(
+                IdentityContainer::NAME)).getUserName();
+            _checkNonprivilegedAuthorization(userName);
+            enumInstanceNames =
+                _subscriptionRepository->enumerateInstanceNamesForClass(
+                    request->nameSpace,
+                    request->className);
+        }
+        catch (CIMException& exception)
+        {
+            cimException = exception;
+        }
+        catch (Exception& exception)
+        {
+            cimException = PEGASUS_CIM_EXCEPTION(
+                CIM_ERR_FAILED,
+                exception.getMessage());
+        }
     }
 
     // Note: not setting Content-Language in the response
index 5ec6a961685e210b0acc95364219abc2c2f0ce44..3eb40fc6cb3fedefad6c490984b2453481cb1e4c 100644 (file)
@@ -51,6 +51,10 @@ ProviderRegistrationManager.h>
 # include <Pegasus/IndicationService/ProviderIndicationCountTable.h>
 #endif
 
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+# include <Pegasus/IndicationService/IndicationServiceConfiguration.h>
+#endif
+
 PEGASUS_NAMESPACE_BEGIN
 
 class SubscriptionRepository;
@@ -1267,6 +1271,10 @@ private:
     ProviderIndicationCountTable _providerIndicationCountTable;
 #endif
 
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+    IndicationServiceConfiguration *_indicationServiceConfiguration;
+#endif
+
     /**
         Handle to Provider Registration Manager
      */
diff --git a/src/Pegasus/IndicationService/IndicationServiceConfiguration.cpp b/src/Pegasus/IndicationService/IndicationServiceConfiguration.cpp
new file mode 100644 (file)
index 0000000..6a07701
--- /dev/null
@@ -0,0 +1,364 @@
+//%2006////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
+// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
+// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation, The Open Group.
+// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; Symantec Corporation; The Open Group.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
+// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
+// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//==============================================================================
+//
+//%/////////////////////////////////////////////////////////////////////////////
+
+#include <Pegasus/Common/Tracer.h>
+
+#include "IndicationConstants.h"
+#include "IndicationServiceConfiguration.h"
+
+PEGASUS_NAMESPACE_BEGIN
+
+IndicationServiceConfiguration::IndicationServiceConfiguration(
+    CIMRepository * repository)
+    : _cimRepository (repository)
+{
+}
+
+IndicationServiceConfiguration::~IndicationServiceConfiguration()
+{
+}
+
+
+CIMInstance IndicationServiceConfiguration::getInstance(
+    const CIMNamespaceName & nameSpace,
+    const CIMObjectPath & instanceName,
+    Boolean localOnly,
+    Boolean includeQualifiers,
+    Boolean includeClassOrigin,
+    const CIMPropertyList & propertyList)
+{
+    CIMInstance instance;
+
+    if (instanceName.getClassName().equal(
+        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE))
+    {
+        instance = _getIndicationServiceInstance(
+            includeQualifiers,
+            includeClassOrigin,
+            propertyList);
+    }
+    else
+    {
+        PEGASUS_ASSERT(instanceName.getClassName().equal(
+            PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES));
+        instance = _getIndicationServiceCapabilitiesInstance(
+            includeQualifiers,
+            includeClassOrigin,
+            propertyList);
+    }
+    CIMObjectPath path = instanceName;
+    path.setNameSpace(nameSpace);
+
+    if (!path.identical(instance.getPath()))
+    {
+        throw PEGASUS_CIM_EXCEPTION(
+            CIM_ERR_NOT_FOUND,
+            instanceName.toString());
+    }
+
+    return instance;
+}
+
+Array<CIMInstance> IndicationServiceConfiguration::
+    enumerateInstancesForClass(
+        const CIMNamespaceName & nameSpace,
+        const CIMName & className,
+        Boolean localOnly,
+        Boolean includeQualifiers,
+        Boolean includeClassOrigin,
+        const CIMPropertyList & propertyList)
+{
+    Array<CIMInstance> instances;
+    if (className.equal(PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE))
+    {
+        instances.append(_getIndicationServiceInstance(
+            includeQualifiers,
+            includeClassOrigin,
+            propertyList));
+    }
+    else
+    {
+        PEGASUS_ASSERT(className.equal(
+            PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES));
+        instances.append(_getIndicationServiceCapabilitiesInstance(
+            includeQualifiers,
+            includeClassOrigin,
+            propertyList));
+    }
+
+    return instances;
+}
+
+Array <CIMObjectPath> IndicationServiceConfiguration::
+    enumerateInstanceNamesForClass(
+        const CIMNamespaceName & nameSpace,
+        const CIMName & className)
+{
+    Array<CIMObjectPath> instanceNames;
+    if (className.equal(PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE))
+    {
+        instanceNames.append(_getIndicationServiceInstance(
+            false,
+            false,
+            CIMPropertyList()).getPath());
+    }
+    else
+    {
+        PEGASUS_ASSERT(className.equal(
+            PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES));
+        instanceNames.append(_getIndicationServiceCapabilitiesInstance(
+            false,
+            false,
+            CIMPropertyList()).getPath());
+    }
+
+    return instanceNames;
+}
+
+CIMInstance IndicationServiceConfiguration::_buildInstanceSkeleton(
+    const CIMNamespaceName & nameSpace,
+    const CIMName& className,
+    CIMClass &returnedClass)
+{
+    returnedClass = _cimRepository->getClass(
+        nameSpace,
+        className,
+        false,
+        true,
+        true);
+
+    CIMInstance skeleton = returnedClass.buildInstance(
+        true,
+        true,
+        CIMPropertyList());
+
+    return skeleton;
+}
+
+void IndicationServiceConfiguration::_setPropertyValue(
+    CIMInstance& instance,
+    const CIMName& propertyName,
+    const CIMValue & value)
+{
+    Uint32 pos;
+
+    if((pos = instance.findProperty(propertyName)) != PEG_NOT_FOUND)
+    {
+        instance.getProperty(pos).setValue(value);
+    }
+}
+
+CIMInstance IndicationServiceConfiguration::_getIndicationServiceInstance(
+    Boolean includeQualifiers,
+    Boolean includeClassOrigin,
+    const CIMPropertyList &propertyList)
+{
+    PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
+        "IndicationServiceConfiguration::"
+            "_getIndicationServiceInstance");
+
+    CIMInstance instance;
+    CIMClass returnedClass;
+
+    instance = _buildInstanceSkeleton(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE,
+        returnedClass);
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_SYSTEMCREATIONCLASSNAME,
+        PEGASUS_CLASSNAME_PG_COMPUTERSYSTEM.getString());
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_SYSTEMNAME,
+        System::getFullyQualifiedHostName());
+
+     _setPropertyValue(
+        instance,
+        _PROPERTY_CREATIONCLASSNAME,
+        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE.getString());
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_NAME,
+        String(PEGASUS_INSTANCEID_GLOBAL_PREFIX) + ":" + "IndicationService");
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_ELEMENTNAME,
+        String("IndicationService"));
+
+    Array<Uint16> operationalStatus;
+    operationalStatus.append(2);
+    _setPropertyValue(
+        instance,
+        _PROPERTY_OPERATIONALSTATUS,
+        operationalStatus);
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_STARTED,
+        CIMValue(Boolean(true)));
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_DESCRIPTION,
+        String("Pegasus Indication Service"));
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_FILTERCREATIONENABLED,
+        CIMValue(_PROPERTY_FILTERCREATIONENABLED_VALUE));
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_SUBSCRIPTIONREMOVALACTION,
+        CIMValue(_PROPERTY_SUBSCRIPTIONREMOVALACTION_VALUE));
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_SUBSCRIPTIONREMOVALTIMEINTERVAL,
+        CIMValue(_PROPERTY_SUBSCRIPTIONREMOVALTIMEINTERVAL_VALUE));
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_DELIVERYRETRYATTEMPTS,
+        CIMValue(_PROPERTY_DELIVERYRETRYATTEMPTS_VALUE));
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_DELIVERYRETRYINTERVAL,
+        CIMValue(_PROPERTY_DELIVERYRETRYINTERVAL_VALUE));
+
+    CIMObjectPath path = instance.buildPath(returnedClass);
+    path.setNameSpace(PEGASUS_NAMESPACENAME_INTEROP);
+    instance.setPath(path);
+    instance.filter(includeQualifiers, includeClassOrigin, propertyList);
+
+    PEG_METHOD_EXIT();
+
+    return instance;
+}
+
+CIMInstance IndicationServiceConfiguration::
+    _getIndicationServiceCapabilitiesInstance(
+        Boolean includeQualifiers,
+        Boolean includeClassOrigin,
+        const CIMPropertyList &propertyList)
+{
+    PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
+        "IndicationServiceConfiguration::"
+            "_getIndicationServiceCapabilitiesInstance");
+
+    CIMInstance instance;
+    CIMClass returnedClass;
+
+    instance = _buildInstanceSkeleton(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES,
+        returnedClass);
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_INSTANCEID,
+        String("CIM:PegasusIndicationServiceCapabilities"));
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_CAPTION,
+        String("IndicationService Capabilities"));
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_DESCRIPTION,
+        String("Pegasus Indication Service Capabilities"));
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_ELEMENTNAME,
+        String("Capabilities for IndicationService"));
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_FILTERCREATIONENABLEDISSETTABLE,
+        CIMValue(Boolean(false)));
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_DELIVERYRETRYATTEMPTSISSETTABLE,
+        CIMValue(Boolean(false)));
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_DELIVERYRETRYINTERVALISSETTABLE,
+        CIMValue(Boolean(false)));
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_SUBSCRIPTIONREMOVALACTIONISSETTABLE,
+        CIMValue(Boolean(false)));
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_SUBSCRIPTIONREMOVALTIMEINTERVALISSETTABLE,
+        CIMValue(Boolean(false)));
+
+    CIMValue value(CIMTYPE_UINT32, false);
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_MAXLISTENERDESTINATIONS,
+        value); 
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_MAXACTIVESUBSCRIPTIONS,
+        value);
+
+    _setPropertyValue(
+        instance,
+        _PROPERTY_SUBSCRIPTIONSPERSISTED,
+        CIMValue(Boolean(true)));
+
+    CIMObjectPath path = instance.buildPath(returnedClass);
+    path.setNameSpace(PEGASUS_NAMESPACENAME_INTEROP);
+    instance.setPath(path);
+    instance.filter(includeQualifiers, includeClassOrigin, propertyList);
+
+    PEG_METHOD_EXIT();
+    return instance;
+}
+
+PEGASUS_NAMESPACE_END
diff --git a/src/Pegasus/IndicationService/IndicationServiceConfiguration.h b/src/Pegasus/IndicationService/IndicationServiceConfiguration.h
new file mode 100644 (file)
index 0000000..18c929b
--- /dev/null
@@ -0,0 +1,108 @@
+//%2006////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
+// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
+// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation, The Open Group.
+// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; Symantec Corporation; The Open Group.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+// 
+// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
+// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
+// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//==============================================================================
+//
+//%/////////////////////////////////////////////////////////////////////////////
+
+#ifndef Pegasus_IndicationServiceConfiguration_h
+#define Pegasus_IndicationServiceConfiguration_h
+
+#include <Pegasus/Common/Config.h>
+#include <Pegasus/Server/Linkage.h>
+#include <Pegasus/Common/Array.h>
+#include <Pegasus/Common/String.h>
+#include <Pegasus/Common/CIMName.h>
+#include <Pegasus/Common/CIMInstance.h>
+#include <Pegasus/Common/CIMObjectPath.h>
+#include <Pegasus/Repository/CIMRepository.h>
+
+PEGASUS_NAMESPACE_BEGIN
+
+/**
+    The IndicationServiceConfiguration class manages the Indications
+    profile configuration instances. This class does not store any
+    instances in the repository. Instances are generated dynamically.
+*/
+
+class PEGASUS_SERVER_LINKAGE IndicationServiceConfiguration
+{
+public:
+
+    IndicationServiceConfiguration(CIMRepository *repository);
+    ~IndicationServiceConfiguration(void);
+
+    CIMInstance getInstance (
+        const CIMNamespaceName & nameSpace,
+        const CIMObjectPath & instanceName,
+        Boolean localOnly = true,
+        Boolean includeQualifiers = false,
+        Boolean includeClassOrigin = false,
+        const CIMPropertyList & propertyList = CIMPropertyList());
+
+    Array <CIMInstance> enumerateInstancesForClass (
+        const CIMNamespaceName & nameSpace,
+        const CIMName & className,
+        Boolean localOnly = true,
+        Boolean includeQualifiers = false,
+        Boolean includeClassOrigin = false,
+        const CIMPropertyList & propertyList = CIMPropertyList());
+
+    Array <CIMObjectPath> enumerateInstanceNamesForClass (
+        const CIMNamespaceName & nameSpace,
+        const CIMName & className);
+private:
+
+    CIMInstance _buildInstanceSkeleton(
+        const CIMNamespaceName &nameSpace,
+        const CIMName &className,
+        CIMClass &returnedClass);
+
+    void _setPropertyValue(
+        CIMInstance &instance,
+        const CIMName &propertyName,
+        const CIMValue &value);
+
+    CIMInstance _getIndicationServiceInstance(
+        Boolean includeQualifiers,
+        Boolean includeClassOrigin,
+        const CIMPropertyList &propertyList);
+
+    CIMInstance _getIndicationServiceCapabilitiesInstance(
+        Boolean includeQualifiers,
+        Boolean includeClassOrigin,
+        const CIMPropertyList &propertyList);
+
+    // Used for getting the Class defintions from the Repository.
+    CIMRepository * _cimRepository;
+};
+
+PEGASUS_NAMESPACE_END
+
+#endif  /* Pegasus_IndicationServiceConfiguration_h */
index 27cc58ea344c29d01592263b717cff9919824e44..14c00e8dec90f4c8b4728b09bcce4f9e9c9c64fb 100644 (file)
@@ -64,6 +64,11 @@ ifeq ($(PEGASUS_ENABLE_INDICATION_COUNT),true)
         ProviderIndicationCountTable.cpp
 endif
 
+ifeq ($(PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT),true)
+    SOURCES += \
+        IndicationServiceConfiguration.cpp
+endif
+
 ifeq ($(OS_TYPE),windows)
 SYS_LIBS = ws2_32.lib advapi32.lib
 endif
diff --git a/src/Pegasus/IndicationService/tests/Configuration/Configuration.cpp b/src/Pegasus/IndicationService/tests/Configuration/Configuration.cpp
new file mode 100644 (file)
index 0000000..db0c2b6
--- /dev/null
@@ -0,0 +1,261 @@
+//%2006////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
+// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
+// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation, The Open Group.
+// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; Symantec Corporation; The Open Group.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+// 
+// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
+// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
+// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//==============================================================================
+//
+//%/////////////////////////////////////////////////////////////////////////////
+
+#include <Pegasus/Common/Config.h>
+#include <Pegasus/Common/Constants.h>
+#include <Pegasus/Common/System.h>
+#include <Pegasus/Common/CIMName.h>
+#include <Pegasus/Common/PegasusAssert.h>
+#include <Pegasus/Client/CIMClient.h>
+
+#include <Pegasus/IndicationService/IndicationConstants.h>
+
+PEGASUS_USING_PEGASUS;
+PEGASUS_USING_STD;
+
+void _testPropertyValue(
+    CIMInstance& instance,
+    const CIMName& propertyName,
+    const CIMValue & testValue)
+{
+    CIMValue value =
+        instance.getProperty(instance.findProperty(propertyName)).getValue();
+    PEGASUS_TEST_ASSERT(testValue == value);
+}
+
+
+void _testIndicationServiceInstance(CIMClient &client)
+{
+    // Get CIM_IndicationService instance names
+    Array<CIMObjectPath> servicePaths = client.enumerateInstanceNames(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE);
+    PEGASUS_TEST_ASSERT(servicePaths.size() == 1);
+
+    // Get CIM_IndicationService instances
+    Array<CIMInstance> serviceInstances = client.enumerateInstances(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE);
+    PEGASUS_TEST_ASSERT(serviceInstances.size() == 1);
+
+    // Get CIM_IndicationService instance
+    CIMInstance serinstance = client.getInstance(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        servicePaths[0]);
+
+    CIMInstance instance = serviceInstances[0];
+
+    _testPropertyValue(
+        instance,
+        _PROPERTY_FILTERCREATIONENABLED,
+        CIMValue(_PROPERTY_FILTERCREATIONENABLED_VALUE));
+
+    _testPropertyValue(
+        instance,
+        _PROPERTY_SUBSCRIPTIONREMOVALACTION,
+        CIMValue(_PROPERTY_SUBSCRIPTIONREMOVALACTION_VALUE));
+
+    _testPropertyValue(
+        instance,
+        _PROPERTY_SUBSCRIPTIONREMOVALTIMEINTERVAL,
+        CIMValue(_PROPERTY_SUBSCRIPTIONREMOVALTIMEINTERVAL_VALUE));
+
+    _testPropertyValue(
+        instance,
+        _PROPERTY_DELIVERYRETRYATTEMPTS,
+        CIMValue(_PROPERTY_DELIVERYRETRYATTEMPTS_VALUE));
+
+    _testPropertyValue(
+        instance,
+        _PROPERTY_DELIVERYRETRYINTERVAL,
+        CIMValue(_PROPERTY_DELIVERYRETRYINTERVAL_VALUE));
+
+    // Test GetInstance() on CIM_IndicationService,
+    // with property list set.
+    Array<CIMName> props;
+    props.append(_PROPERTY_DELIVERYRETRYATTEMPTS);
+    props.append(_PROPERTY_DELIVERYRETRYINTERVAL);
+    CIMPropertyList propList(props);
+
+    CIMInstance seInstance = client.getInstance(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        servicePaths[0],
+        false,
+        true,
+        true,
+        propList);
+    
+    _testPropertyValue(
+        seInstance,
+        _PROPERTY_DELIVERYRETRYATTEMPTS,
+        CIMValue(_PROPERTY_DELIVERYRETRYATTEMPTS_VALUE));
+
+    _testPropertyValue(
+        seInstance,
+        _PROPERTY_DELIVERYRETRYINTERVAL,
+        CIMValue(_PROPERTY_DELIVERYRETRYINTERVAL_VALUE));
+
+    cout << "+++++ CIM_IndicationService instance"
+                " test completed successfully." << endl;
+}
+
+void _testIndicationServiceCapabilitiesInstance(CIMClient &client)
+{
+    // Get CIM_IndicationServiceCapabilities instances
+    Array<CIMInstance> capInstances = client.enumerateInstances(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES);
+    PEGASUS_TEST_ASSERT(capInstances.size() == 1);
+
+    // Get CIM_IndicationServiceCapabilities instance names
+    Array<CIMObjectPath> capPaths = client.enumerateInstanceNames(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES);
+    PEGASUS_TEST_ASSERT(capPaths.size() == 1);
+
+    // Get CIM_IndicationServiceCapabilities instance
+    CIMInstance instance = client.getInstance(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        capPaths[0]);
+
+    instance = capInstances[0];
+
+    _testPropertyValue(
+        instance,
+        _PROPERTY_FILTERCREATIONENABLEDISSETTABLE,
+        CIMValue(Boolean(false)));
+
+    _testPropertyValue(
+        instance,
+        _PROPERTY_DELIVERYRETRYATTEMPTSISSETTABLE,
+        CIMValue(Boolean(false)));
+
+    _testPropertyValue(
+        instance,
+        _PROPERTY_DELIVERYRETRYINTERVALISSETTABLE,
+        CIMValue(Boolean(false)));
+
+    _testPropertyValue(
+        instance,
+        _PROPERTY_SUBSCRIPTIONREMOVALACTIONISSETTABLE,
+        CIMValue(Boolean(false)));
+
+    _testPropertyValue(
+        instance,
+        _PROPERTY_SUBSCRIPTIONREMOVALTIMEINTERVALISSETTABLE,
+        CIMValue(Boolean(false)));
+
+    CIMValue value(CIMTYPE_UINT32, false);
+
+    _testPropertyValue(
+        instance,
+        _PROPERTY_MAXLISTENERDESTINATIONS,
+        value);
+
+    _testPropertyValue(
+        instance,
+        _PROPERTY_MAXACTIVESUBSCRIPTIONS,
+        value);
+
+    _testPropertyValue(
+        instance,
+        _PROPERTY_SUBSCRIPTIONSPERSISTED,
+        CIMValue(Boolean(true)));
+
+    // Test GetInstance() on CIM_IndicationServiceCapabilities,
+    // with property list set.
+    Array<CIMName> props;
+    props.append(_PROPERTY_SUBSCRIPTIONREMOVALACTIONISSETTABLE);
+    props.append(_PROPERTY_SUBSCRIPTIONREMOVALTIMEINTERVALISSETTABLE);
+    CIMPropertyList propList(props);
+
+    CIMInstance caInstance = client.getInstance(
+        PEGASUS_NAMESPACENAME_INTEROP,
+        capPaths[0],
+        false,
+        true,
+        true,
+        propList);
+
+    _testPropertyValue(
+        caInstance,
+        _PROPERTY_SUBSCRIPTIONREMOVALACTIONISSETTABLE,
+        CIMValue(Boolean(false)));
+
+    _testPropertyValue(
+        caInstance,
+        _PROPERTY_SUBSCRIPTIONREMOVALTIMEINTERVALISSETTABLE,
+        CIMValue(Boolean(false)));
+
+    cout << "+++++ CIM_IndicationServiceCapabilities instance"
+                " test completed successfully." << endl;
+}
+
+int main(int argc, char** argv)
+{
+    CIMClient client;
+    client.connectLocal();
+
+    try
+    {
+        client.getClass(
+            PEGASUS_NAMESPACENAME_INTEROP,
+            PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE);
+    }
+    catch(CIMException &e)
+    {
+        PEGASUS_TEST_ASSERT(e.getCode() == CIM_ERR_NOT_FOUND);
+        cout << argv[0]
+             << ": Skipping the test, DMTF Indication Profile"
+                    "classes can not be found in the repository." << endl;
+        return 0;
+    }
+    catch(...)
+    {
+        PEGASUS_TEST_ASSERT(0);
+    }
+
+    try
+    {
+        _testIndicationServiceInstance(client);
+        _testIndicationServiceCapabilitiesInstance(client);
+    }
+    catch (Exception& e)
+    {
+        cerr << e.getMessage() << endl;
+        return -1;
+    }
+    cout << "+++++ Tests completed successfully" << endl;
+
+    return 0;
+}
diff --git a/src/Pegasus/IndicationService/tests/Configuration/Makefile b/src/Pegasus/IndicationService/tests/Configuration/Makefile
new file mode 100644 (file)
index 0000000..4706210
--- /dev/null
@@ -0,0 +1,53 @@
+#//%2006////////////////////////////////////////////////////////////////////////
+#//
+#// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
+#// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
+#// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
+#// IBM Corp.; EMC Corporation, The Open Group.
+#// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
+#// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
+#// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+#// EMC Corporation; VERITAS Software Corporation; The Open Group.
+#// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+#// EMC Corporation; Symantec Corporation; The Open Group.
+#//
+#// Permission is hereby granted, free of charge, to any person obtaining a copy
+#// of this software and associated documentation files (the "Software"), to
+#// deal in the Software without restriction, including without limitation the
+#// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+#// sell copies of the Software, and to permit persons to whom the Software is
+#// furnished to do so, subject to the following conditions:
+#// 
+#// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
+#// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
+#// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+#// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+#// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+#// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+#// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+#// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#//
+#//==============================================================================
+ROOT = ../../../../..
+DIR = Pegasus/IndicationService/tests/Configuration
+include $(ROOT)/mak/config.mak
+
+EXTRA_INCLUDES = $(SYS_INCLUDES)
+
+LOCAL_DEFINES = -DPEGASUS_INTERNALONLY
+
+LIBRARIES = \
+    pegindicationservice \
+    pegclient \
+    pegcommon
+
+PROGRAM = TestConfiguration
+
+SOURCES = Configuration.cpp
+
+include $(ROOT)/mak/program.mak
+
+tests:
+
+poststarttests:
+       @$(PROGRAM)
index 854792e6ebed3d7fb693401a59eeabdb3f6b85b2..5a3615b24cdc6b52e02d3404fe24be0901e1157c 100755 (executable)
@@ -44,4 +44,9 @@ ifeq ($(PEGASUS_ENABLE_INDICATION_COUNT),true)
         IndicationsCount
 endif
 
+ifeq ($(PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT),true)
+    DIRS += \
+        Configuration
+endif
+
 include $(ROOT)/mak/recurse.mak
index 6d26b5f44c0c93fc20f5aec63960d8c7b9b53a5f..762afc47818f3cce2b26178f2e379e3341fb340f 100644 (file)
@@ -1119,6 +1119,38 @@ Boolean CIMOperationRequestDispatcher::_lookupInternalProvider(
                 PEGASUS_QUEUENAME_CONTROLSERVICE);
 #endif // PEGASUS_ENABLE_SLP
 
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+            _routing_table.insert_record(
+                PEGASUS_CLASSNAME_PG_ELEMENTCAPABILITIES,
+                PEGASUS_NAMESPACENAME_INTEROP,
+                DynamicRoutingTable::INTERNAL,
+                0,
+                static_cast<MessageQueueService*>(
+                    MessageQueue::lookup(PEGASUS_QUEUENAME_CONTROLSERVICE)),
+                PEGASUS_MODULENAME_INTEROPPROVIDER,
+                PEGASUS_QUEUENAME_CONTROLSERVICE);
+
+            _routing_table.insert_record(
+                PEGASUS_CLASSNAME_PG_HOSTEDINDICATIONSERVICE,
+                PEGASUS_NAMESPACENAME_INTEROP,
+                DynamicRoutingTable::INTERNAL,
+                0,
+                static_cast<MessageQueueService*>(
+                    MessageQueue::lookup(PEGASUS_QUEUENAME_CONTROLSERVICE)),
+                PEGASUS_MODULENAME_INTEROPPROVIDER,
+                PEGASUS_QUEUENAME_CONTROLSERVICE);
+
+            _routing_table.insert_record(
+                PEGASUS_CLASSNAME_PG_SERVICEAFFECTSELEMENT,
+                PEGASUS_NAMESPACENAME_INTEROP,
+                DynamicRoutingTable::INTERNAL,
+                0,
+                static_cast<MessageQueueService*>(
+                    MessageQueue::lookup(PEGASUS_QUEUENAME_CONTROLSERVICE)),
+                PEGASUS_MODULENAME_INTEROPPROVIDER,
+                PEGASUS_QUEUENAME_CONTROLSERVICE);
+#endif
+
             _routing_table.insert_record(
                 PEGASUS_CLASSNAME_PROVIDERMODULE,
                 PEGASUS_NAMESPACENAME_PROVIDERREG,
@@ -1161,6 +1193,27 @@ Boolean CIMOperationRequestDispatcher::_lookupInternalProvider(
 
             if (_enableIndicationService)
             {
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+                _routing_table.insert_record(
+                    PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE,
+                    PEGASUS_NAMESPACENAME_INTEROP,
+                    DynamicRoutingTable::INTERNAL,
+                    0,
+                    static_cast<MessageQueueService*>(MessageQueue::lookup(
+                        PEGASUS_QUEUENAME_INDICATIONSERVICE)),
+                    String::EMPTY,
+                    PEGASUS_QUEUENAME_INDICATIONSERVICE);
+
+                _routing_table.insert_record(
+                    PEGASUS_CLASSNAME_CIM_INDICATIONSERVICECAPABILITIES,
+                    PEGASUS_NAMESPACENAME_INTEROP,
+                    DynamicRoutingTable::INTERNAL,
+                    0,
+                    static_cast<MessageQueueService*>(MessageQueue::lookup(
+                        PEGASUS_QUEUENAME_INDICATIONSERVICE)),
+                    String::EMPTY,
+                    PEGASUS_QUEUENAME_INDICATIONSERVICE);
+#endif
                 _routing_table.insert_record(
                     PEGASUS_CLASSNAME_INDSUBSCRIPTION,
                     _wild,