[asterisk-scf-commits] asterisk-scf/integration/slice.git branch "configuration" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Mon Dec 20 19:52:41 UTC 2010
branch "configuration" has been updated
via 92dbdaa28b3fdbc1c628788c358e91ab8578e01d (commit)
from aaac63aad229bd0ef45fb03a9b62ad453a717ea8 (commit)
Summary of changes:
System/Component/ConfigurationIf.ice | 165 ++++++++++++++++++++++++++++++++++
1 files changed, 165 insertions(+), 0 deletions(-)
create mode 100644 System/Component/ConfigurationIf.ice
- Log -----------------------------------------------------------------
commit 92dbdaa28b3fdbc1c628788c358e91ab8578e01d
Author: Joshua Colp <jcolp at digium.com>
Date: Mon Dec 20 15:51:45 2010 -0400
Add a design for a configuration mechanism that can be used in components.
diff --git a/System/Component/ConfigurationIf.ice b/System/Component/ConfigurationIf.ice
new file mode 100644
index 0000000..1f0f08b
--- /dev/null
+++ b/System/Component/ConfigurationIf.ice
@@ -0,0 +1,165 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2010, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#pragma once
+
+module AsteriskSCF
+{
+
+module System
+{
+
+module Configuration
+{
+
+["suppress"]
+module V1
+{
+ /**
+ * Generic configuration item class that can be extended by components.
+ *
+ * This essentially represents a single configurable aspect.
+ */
+ ["preserved"]
+ class ConfigurationItem
+ {
+ /**
+ * Serial number of the configuration item. This number should be incremented each
+ * time an update is sent to the setConfiguration method on the Configuration interface.
+ *
+ * If the serial number is older then is currently presently on the configured item then
+ * an exception will be thrown indicating that the configured item has already been changed
+ * from another source.
+ *
+ * The serial number check can be disabled by passing a serial number of -1. This will force
+ * the update to proceed no matter what.
+ */
+ int mSerialNumber;
+ };
+
+ /**
+ * A special configuration item class that is used with the getConfiguration and removeConfiguration
+ * methods.
+ *
+ * Using this item with the getConfiguration method causes all configuration items to be returned for
+ * a group instead of a subset.
+ *
+ * Using this item with the removeConfiguration method causes all configuration items to be removed
+ * along with the configuration group itself.
+ */
+ class ConfigurationItemAll extends ConfigurationItem
+ {
+ };
+
+ /**
+ * A dictionary of configuration items. The key is a string to encourage only having a single
+ * instance of each configuratiom item, and to also provide a value for logging information.
+ */
+ dictionary<string, ConfigurationItem> ConfigurationItemDict;
+
+ /**
+ * Generic configuration group class that can be extended by components.
+ *
+ * This essentially represents a group of configurable items that configure a specific concept.
+ */
+ ["preserved"]
+ class ConfigurationGroup
+ {
+ /**
+ * Dictionary of configuration items for this group.
+ */
+ ConfigurationItemDict mConfigurationItems;
+ };
+
+ /**
+ * A sequence of configuration groups.
+ */
+ sequence<ConfigurationGroup> ConfigurationGroupSeq;
+
+ /**
+ * Exception thrown when a configuration item serial number is older then is currently configured.
+ */
+ exception SerialConflict
+ {
+ /**
+ * The configuration group that the item belongs to. This includes all configuration items so that
+ * they can all be updated and retried.
+ */
+ ConfigurationGroup mGroup;
+
+ /**
+ * The configuration item that the serial conflict applies to.
+ */
+ ConfigurationItem mConfigurationItem;
+ };
+
+ /**
+ * The configuration interface provides methods that allow the manipulating of the configuration
+ * data for a specific component.
+ *
+ * This interface purposely does not provide explicit methods for individual group retrieval
+ * or updating to encourage batching updates which reduces RPCs. This also makes it easier to
+ * implement a transaction approach where a configuration update is an all-or-nothing operation.
+ */
+ interface ConfigurationService
+ {
+ /**
+ * Retrieves a sequence of configuration groups containing the configuration items specified
+ * in the ConfigurationGroup classes in the sequence itself and their current values.
+ *
+ * @param groups A sequence of group classes to be retrieved, along with the configuration items to be retrieved
+ * in each class.
+ *
+ * @return A sequence of group classes containing the current values of the configuration items requested.
+ *
+ */
+ idempotent ConfigurationGroupSeq getConfiguration(ConfigurationGroupSeq groups);
+
+ /**
+ * Retrieves a sequence of current configuration groups. This does not return all the configuration items.
+ * If the configuration items are needed the getConfiguration method must be called afterwards.
+ *
+ * @return A sequence of current configuration groups.
+ *
+ */
+ idempotent ConfigurationGroupSeq getConfigurationGroups();
+
+ /**
+ * Update the configuration of one or more configuration groups.
+ *
+ * @param groups The groups and configuration items to update (or add).
+ *
+ * @throws SerialConflict when serial number of a configuration item is out of date.
+ *
+ */
+ void setConfiguration(ConfigurationGroupSeq groups) throws SerialConflict;
+
+ /**
+ * Remove a configuration group or specific configuration items.
+ *
+ * @param groups The groups or configuration items to remove.
+ *
+ */
+ void removeConfiguration(ConfigurationGroupSeq groups);
+ };
+
+}; /* End of namespace V1 */
+
+}; /* End of namespace Configuration */
+
+}; /* End of namespace System */
+
+}; /* End of namespace AsteriskSCF */
-----------------------------------------------------------------------
--
asterisk-scf/integration/slice.git
More information about the asterisk-scf-commits
mailing list