TITLE: PEP#323 DMTF Indications Profile (DSP1054) Implementation, stage 1.
DESCRIPTION: PEP 323 implementation.
--- /dev/null
+//%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")
--- /dev/null
+// 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;
+
+
+};
--- /dev/null
+// 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;
+
+
+};
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"
@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)"
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 {
+};
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.
#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
//
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
//
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");
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");
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(
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() +
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;
}
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,
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))
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
};
/***************************************************************
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;
}
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
#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>
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
///////////////////////////////////////////////////////////////
}
testDMTFProfileInstances(client);
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+ testIndicationProfileInstances(client);
+#endif
//testAssociationTraversal(client);
cout << endl << "Server Profile Tests complete" << endl;
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;
}
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;
}
*/
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
//
#include <Pegasus/Common/Config.h>
#include <Pegasus/Common/CIMName.h>
+#include <Pegasus/Server/Linkage.h>
PEGASUS_NAMESPACE_BEGIN
*/
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
//
//
_subscriptionRepository = new SubscriptionRepository(repository);
+ //
+ // Create IndicationsProfileInstance Repository
+ //
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+ _indicationServiceConfiguration =
+ new IndicationServiceConfiguration(repository);
+#endif
+
//
// Create Subscription Table
//
{
delete _subscriptionTable;
delete _subscriptionRepository;
+
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+ delete _indicationServiceConfiguration;
+#endif
}
void IndicationService::_handle_async_request(AsyncRequest *req)
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));
+ }
}
}
}
cimException =
PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, exception.getMessage());
}
-
+ catch(...)
+ {
+ PEG_METHOD_EXIT();
+ throw;
+ }
CIMGetInstanceResponseMessage * response =
dynamic_cast<CIMGetInstanceResponseMessage *>(request->buildResponse());
response->cimException = cimException;
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))
{
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
# include <Pegasus/IndicationService/ProviderIndicationCountTable.h>
#endif
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+# include <Pegasus/IndicationService/IndicationServiceConfiguration.h>
+#endif
+
PEGASUS_NAMESPACE_BEGIN
class SubscriptionRepository;
ProviderIndicationCountTable _providerIndicationCountTable;
#endif
+#ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
+ IndicationServiceConfiguration *_indicationServiceConfiguration;
+#endif
+
/**
Handle to Provider Registration Manager
*/
--- /dev/null
+//%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
--- /dev/null
+//%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 */
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
--- /dev/null
+//%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;
+}
--- /dev/null
+#//%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)
IndicationsCount
endif
+ifeq ($(PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT),true)
+ DIRS += \
+ Configuration
+endif
+
include $(ROOT)/mak/recurse.mak
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,
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,