From: Michael Chase-S. <mc...@us...> - 2011-04-29 20:49:48
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SFCB - Small Footprint CIM Broker". The branch, master has been updated via 4b32cde24cd555357d1137b8ababa20c7d46d4e8 (commit) from 6a399e90cf5647165b89436ed5e9f8c9b95027ee (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4b32cde24cd555357d1137b8ababa20c7d46d4e8 Author: Michael Chase-Salerno <br...@li...> Date: Fri Apr 29 16:48:53 2011 -0400 3190623 Set *IsSettable propperties to false for IndicationService Squashed commit of the following: commit 9fb69ac1c0bd6f21f0c75cf11bebe4f25c13b1b2 Author: Michael Chase-Salerno <br...@li...> Date: Thu Apr 28 19:26:00 2011 -0400 Enable setting the properties if --enable-test commit f357eb6819e306b5c13d702929132a862ae5ab4c Author: Michael Chase-Salerno <br...@li...> Date: Thu Apr 28 19:10:51 2011 -0400 Get properties from config file, store in instance on start. commit 2664a953c87d931962a47bbdd7b224ef78e1ce6f Author: Michael Chase-Salerno <br...@li...> Date: Wed Apr 27 16:59:24 2011 -0400 Prevent MI if the isSettable's are false commit dccb09a038ffe603da2eeabf743cae87a3c5aade Author: Michael Chase-Salerno <br...@li...> Date: Tue Apr 26 13:08:20 2011 -0400 Configure option for settable retry, and setting of repo props. ----------------------------------------------------------------------- Summary of changes: diff --git a/20_indication.mof b/20_indication.mof.pre.in similarity index 75% rename from 20_indication.mof rename to 20_indication.mof.pre.in index 0a84b00..c199618 100644 --- a/20_indication.mof +++ b/20_indication.mof.pre.in @@ -11,10 +11,10 @@ instance of SFCB_IndicationServiceCapabilities { InstanceID = "CIM:SFCB_ISC"; FilterCreationEnabledIsSettable = FALSE; - DeliveryRetryAttemptsIsSettable = TRUE; - DeliveryRetryIntervalIsSettable = TRUE; - SubscriptionRemovalActionIsSettable = TRUE; - SubscriptionRemovalTimeIntervalIsSettable = TRUE; + DeliveryRetryAttemptsIsSettable = SETTABLE; + DeliveryRetryIntervalIsSettable = SETTABLE; + SubscriptionRemovalActionIsSettable = SETTABLE; + SubscriptionRemovalTimeIntervalIsSettable = SETTABLE; MaxListenerDestinations = 100; MaxActiveSubscriptions = 100; SubscriptionsPersisted = TRUE; diff --git a/ChangeLog b/ChangeLog index 4d84728..16e3b4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-04-29 Michael Chase-Salerno <br...@li...> + + * 20_indication.mof.pre.in, Makefile.am, configure.ac + control.c, interopServerProvider.c, sfcb.cfg.pre.in: + [ 3190623 ] Set *IsSettable propperties to false for IndicationService + 2011-04-28 Chris Buccella <buc...@li...> * cimcClientSfcbLocal.c: diff --git a/Makefile.am b/Makefile.am index 828863c..11e6e2c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -481,6 +481,15 @@ getSchema.sh: getSchema.sh.pre sed -e s?$$\{prefix\}?$(prefix)?g \ -e s?$$\{exec_prefix\}?$(prefix)?g $< > $@ +if SETTABLERETRY +20_indication.mof: 20_indication.mof.pre + sed -e s?SETTABLE?TRUE?g $< > $@ +else +20_indication.mof: 20_indication.mof.pre + sed -e s?SETTABLE?FALSE?g $< > $@ +endif + + sfcb: sfcb.$(INIT_STYLE) sed -e s?$$\{prefix\}?$(prefix)?g \ -e s?$$\{exec_prefix\}?$(prefix)?g $< > $@ diff --git a/NEWS b/NEWS index d2b9025..241a6c6 100644 --- a/NEWS +++ b/NEWS @@ -2,12 +2,12 @@ Changes in 1.4.2 ================ New features: +- 3190623 Set *IsSettable propperties to false for IndicationService Bugs fixed: Everything in 1.3.12, plus: - Changes in 1.4.1 ================ diff --git a/configure.ac b/configure.ac index 6349c2c..cceff62 100644 --- a/configure.ac +++ b/configure.ac @@ -103,6 +103,10 @@ AC_ARG_ENABLE(tests, [AC_HELP_STRING([--enable-tests(=TESTS)], [Enable listed tests. If none are listed, all are enabled.])]) +AC_ARG_ENABLE(settableretry, + [AC_HELP_STRING([--enable-settableretry], + [Allow reliable indication params to be settable.])]) + AC_ARG_ENABLE(uds, [AC_HELP_STRING([--enable-uds], [Enable UDS authentication.])]) @@ -176,6 +180,7 @@ fi # Check and configure requested tests. if test "$enable_tests" == "yes"; then + enable_settableretry="yes" if test "$enable_local_connect_only" == "yes"; then enable_tests="localtests,gcov" else @@ -336,6 +341,10 @@ if test "$enable_uds" == "yes"; then AC_DEFINE(HAVE_UDS,,[UDS authentication enabled]) fi +if test "$enable_settableretry" == "yes"; then + AC_DEFINE(SETTABLERETRY,,[Settable indication parameters enabled]) +fi + if test "$enable_qualifierrep" == "yes"; then LOAD_QUALIFIER_PROVIDER= @@ -525,6 +534,7 @@ if test -d $srcdir/cmpi-devel; then fi AM_CONDITIONAL(INDICATIONS,[test "$enable_indications" == "yes"]) +AM_CONDITIONAL(SETTABLERETRY,[test "$enable_settableretry" == "yes"]) AM_CONDITIONAL(SSL,[test "$enable_ssl" == "yes"]) AM_CONDITIONAL(SLP,[test "$enable_slp" == "yes"]) AM_CONDITIONAL(SLP_HOSTNAME_LIB,[test "$enable_slp_hostname_lib" == "yes"]) @@ -537,7 +547,7 @@ AM_CONDITIONAL(LOCAL_CONNECT_NO_INDICATION,[test "$enable_local_connect_only" == AM_CONDITIONAL(LOCAL_CONNECT_ONLY,[test "$enable_local_connect_only" == "yes"]) AC_CONFIG_FILES([Makefile sfcb.spec sfcbrepos.sh sfcbstage.sh sfcbunstage.sh - sfcbuuid.sh sfcb.cfg.pre getSchema.sh.pre + sfcbuuid.sh sfcb.cfg.pre getSchema.sh.pre 20_indication.mof.pre sfcb.init-redhat sfcb.init-suse sfcb.init-none default.reg man/genSslCert.1.pre man/sfcbmof.1.pre man/sfcbunstage.1.pre man/sfcbuuid.1.pre man/getSchema.1.pre @@ -562,6 +572,7 @@ echo -e "uds"\\t\\t\\t\\t"${enable_uds:-no}" echo -e "tests"\\t\\t\\t\\t"${enable_tests:-no}" echo -e "debug"\\t\\t\\t\\t"${enable_debug:-no}" echo -e "Request types"\\t\\t\\t"${enable_request_types}" +echo -e "Settable retry parameters"\\t"${enable_settableretry:-no}" echo ================================================================= echo echo "sfcb configuration complete. you may now run 'make'" diff --git a/control.c b/control.c index c632b8c..9d76bfd 100644 --- a/control.c +++ b/control.c @@ -55,6 +55,9 @@ static UtilHashTable *ct = NULL; char *configfile = NULL; +// Control initial values +// { property, type, value} +// Type: 0=string, 1=num, 2=bool, 3=unstripped string Control init[] = { {"httpPort", 1, "5988"}, {"enableHttp", 2, "true"}, @@ -112,6 +115,11 @@ Control init[] = { {"validateMethodParamTypes", 2, "false"}, {"maxMsgLen", 1, "10000000"}, {"networkInterface", 3, NULL}, + {"DeliveryRetryInterval",1,"20"}, + {"DeliveryRetryAttempts",1,"3"}, + {"SubscriptionRemovalTimeInterval",1,"2592000"}, + {"SubscriptionRemovalAction",1,"2"}, + }; void diff --git a/interopServerProvider.c b/interopServerProvider.c index 8e66ce5..c5158e8 100644 --- a/interopServerProvider.c +++ b/interopServerProvider.c @@ -798,6 +798,29 @@ ServerProviderModifyInstance(CMPIInstanceMI * mi, if (!CMClassPathIsA(_broker, cop, "cim_indicationservice", NULL)) return rc; + + // Get the settable props + int settable=0; + CMPIObjectPath *iscop = CMNewObjectPath(_broker, "root/interop", "SFCB_IndicationServiceCapabilities",NULL); + CMPIEnumeration *iscenm = _broker->bft->enumerateInstances(_broker, ctx, iscop, NULL, NULL); + CMPIData iscinst = CMGetNext(iscenm, NULL); + CMPIData iscprop = CMGetProperty(iscinst.value.inst, "DeliveryRetryAttemptsIsSettable", NULL); + if (!iscprop.value.boolean) settable++; + iscprop = CMGetProperty(iscinst.value.inst, "DeliveryRetryIntervalIsSettable", NULL); + if (!iscprop.value.boolean) settable++; + iscprop = CMGetProperty(iscinst.value.inst, "SubscriptionRemovalActionIsSettable", NULL); + if (!iscprop.value.boolean) settable++; + iscprop = CMGetProperty(iscinst.value.inst, "SubscriptionRemovalTimeIntervalIsSettable", NULL); + if (!iscprop.value.boolean) settable++; + + if (iscop) CMRelease(iscop); + if (iscenm) CMRelease(iscenm); + + // If any of the settable props were false, no MI of indication service allowed + // We're assuming that this is the only reason for doing an MI + if (settable > 0) return rc; + + // Ok, all is well to continue with the operation... ctxLocal = native_clone_CMPIContext(ctx); val.string = sfcb_native_new_CMPIString("$DefaultProvider$", NULL, 0); ctxLocal->ft->addEntry(ctxLocal, "rerouteToProvider", &val, CMPI_string); @@ -837,10 +860,29 @@ ServerProviderInitInstances(const CMPIContext *ctx) CMPIInstance *ci = NULL; CMPIContext *ctxLocal; CMPIBoolean filterCreation = 1; - CMPIUint16 retryAttempts = 3; /* retry indications 3 times */ - CMPIUint32 retryInterval = 20; /* at a 20 second interval */ - CMPIUint16 subRemoval = 2; /* 3 == "Disable" */ - CMPIUint32 subRemovalInterval = 2592000; /* 30 days */ + + CMPIUint16 retryAttempts,subRemoval; + CMPIUint32 tmp,retryInterval,subRemovalInterval; + + // Get the retry parameters from the config file + getControlUNum("DeliveryRetryInterval", &retryInterval); + getControlUNum("DeliveryRetryAttempts", &tmp); + if (tmp > UINT16_MAX) { + // Exceeded max range, set to default + mlogf(M_ERROR, M_SHOW, "--- Value for DeliveryRetryAttempts exceeds range, using default.\n"); + retryAttempts=3; + } else { + retryAttempts=(CMPIUint16) tmp; + } + getControlUNum("SubscriptionRemovalTimeInterval", &subRemovalInterval); + getControlUNum("SubscriptionRemovalAction", &tmp); + if (tmp > UINT16_MAX) { + // Exceeded max range, set to default + mlogf(M_ERROR, M_SHOW, "--- Value for SubscriptionRemovalAction exceeds range, using default.\n"); + subRemoval=2; + } else { + subRemoval= (CMPIUint16) tmp; + } ctxLocal = native_clone_CMPIContext(ctx); val.string = sfcb_native_new_CMPIString("$DefaultProvider$", NULL, 0); @@ -848,7 +890,6 @@ ServerProviderInitInstances(const CMPIContext *ctx) op = CMNewObjectPath(_broker, "root/interop", "CIM_IndicationService", &st); - ci = CMNewInstance(_broker, op, &st); CMAddKey(op, "CreationClassName", "CIM_IndicationService", CMPI_chars); CMAddKey(op, "SystemCreationClassName", "CIM_ComputerSystem", CMPI_chars); @@ -856,6 +897,10 @@ ServerProviderInitInstances(const CMPIContext *ctx) gethostname(str, 511); CMAddKey(op, "SystemName", str, CMPI_chars); CMAddKey(op, "Name", getSfcbUuid(), CMPI_chars); + // Delete the instance so we can replace with proper values + CBDeleteInstance(_broker,ctxLocal,op); + ci = CMNewInstance(_broker, op, &st); + CMSetProperty(ci, "CreationClassName", "CIM_IndicationService", CMPI_chars); CMSetProperty(ci, "SystemCreationClassName", "CIM_ComputerSystem", diff --git a/sfcb.cfg.pre.in b/sfcb.cfg.pre.in index e1d7424..acc28ba 100644 --- a/sfcb.cfg.pre.in +++ b/sfcb.cfg.pre.in @@ -230,3 +230,25 @@ certificateAuthLib: sfcCertificateAuthentication ## Can be overriden by setting environment variable SFCB_TRACE_LEVEL. ## Default is 0. If trace mask is set (by any method) the default is 1. #traceLevel: 0 + +##----------------------------Reliable Indications ---------------------------- +## Interval between indication retry attempts +## Default is 20 seconds +#DeliveryRetryInterval: 20 + +## Number of retry attempts before giving up +## Default is 3 attempts (not including initial attempt) +## A value of 0 disables reliable indications +#DeliveryRetryAttempts: 3 + +## The length of time an destination can fail before the subscription +## removal action below is taken +## Default is 2592000 seconds (30 days) +#SubscriptionRemovalTimeInterval: 2592000 + +## The action taken when the time interval expires +## Default is 2, remove the subscription +## Other values: 3, disable the subscription +## 4, ignore (do nothing) +#SubscriptionRemovalAction: 2 + hooks/post-receive -- SFCB - Small Footprint CIM Broker |