[asterisk-scf-commits] asterisk-scf/release/slice.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Nov 11 12:43:04 CST 2011


branch "master" has been updated
       via  d30be6ad2e0df0dce54107fcb38fb3a073372c7c (commit)
      from  392bea5bac84da946d5990ddd7afb977bdcb102c (commit)

Summary of changes:
 slice/AsteriskSCF/Presence/PresenceIf.ice |  208 +++++++++++++++++++++++++++++
 1 files changed, 208 insertions(+), 0 deletions(-)
 create mode 100644 slice/AsteriskSCF/Presence/PresenceIf.ice


- Log -----------------------------------------------------------------
commit d30be6ad2e0df0dce54107fcb38fb3a073372c7c
Author: Joshua Colp <jcolp at digium.com>
Date:   Fri Nov 11 14:44:02 2011 -0400

    Add presence design.

diff --git a/slice/AsteriskSCF/Presence/PresenceIf.ice b/slice/AsteriskSCF/Presence/PresenceIf.ice
new file mode 100644
index 0000000..dad6e6c
--- /dev/null
+++ b/slice/AsteriskSCF/Presence/PresenceIf.ice
@@ -0,0 +1,208 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2011, 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
+
+#include <Ice/BuiltinSequences.ice>
+
+module AsteriskSCF
+{
+
+module Presence
+{
+
+["suppress"]
+module V1
+{
+   /**
+    * String representation of the version of this interface
+    */
+   const string Version = "V1";
+
+   /**
+    * Various states for presence
+    */
+   enum State
+   {
+       /**
+        * State of the given resource is not yet known.
+        */
+       UNKNOWN,
+
+       /**
+        * Resource is not in use.
+        */
+       NOTINUSE,
+
+       /**
+        * Resource is in use.
+        */
+       INUSE,
+
+       /**
+        * Resource is busy.
+        */
+       BUSY,
+
+       /**
+        * Given resource is invalid.
+        */
+       INVALID,
+
+       /**
+        * Resource is currently unavailable.
+        */
+       UNAVAILABLE,
+
+       /**
+        * Resource is ringing.
+        */
+       RINGING,
+
+       /**
+        * Resource is ringing and in use.
+        */
+       RINGINGINUSE,
+
+       /**
+        * Resource is on hold.
+        */
+       ONHOLD,
+
+       /**
+        * Resource is away.
+        */
+       AWAY,
+
+       /**
+        * Resource does not wish to be disturbed.
+        */
+       DONOTDISTURB,
+
+       /**
+        * Resource has been away for quite awhile.
+        */
+       EXTENDEDAWAY,
+
+       /**
+        * The state is not permitted to be known.
+        */
+       NOTPERMITTED,
+   };
+
+   /**
+    * Class which contains presence information about an resource
+    *
+    * This class can be extended to provide additional status information specific to
+    * the type of resource.
+    */
+   unsliceable class Status
+   {
+       /**
+        * Current state of the resource
+        */
+       State currentState;
+   };
+
+   /**
+    * Dictionary of resources and their status
+    */
+   dictionary<string, Status> ResourceStatusDict;
+
+   /**
+    * Interface for a presence consumer
+    */
+   interface Consumer
+   {
+       /**
+        * Method used to indicate that an resource has updated its status.
+        *
+        * @param resource Name of the resource that the status is for.
+        *
+        * @param newStatus Concrete class containing the status of the resource.
+        */
+       void update(ResourceStatusDict newStatus);
+   };
+
+   /**
+    * Class which contains authentication credentials, extended by the router implementation.
+    */
+   unsliceable class Credentials
+   {
+   };
+
+   /**
+    * Class which contains an authentication token, extended by the router implementation.
+    */
+   unsliceable class Token
+   {
+   };
+
+   /**
+    * Interface for a presence router
+    */
+   interface Router extends Consumer
+   {
+       /**
+        * Method used to authenticate with the router.
+        *
+        * @param authDetails Authentication credentials.
+        *
+        * @return Token An authentication token if authenticated, none if not.
+        */
+       idempotent Token authenticate(Credentials authDetails);
+
+       /**
+        * Method used to query for the current status of an resource.
+        *
+        * @param authToken Authentication token received when authenticate was called.
+        *
+        * @param resources Name of the resources to get the status for.
+        *
+        * @return ResourceStatusDict Dictionary containing status of requested resources.
+        */
+       idempotent ResourceStatusDict query(Token authToken, Ice::StringSeq resources);
+
+       /**
+        * Method used to subscribe to specific resource status updates.
+        *
+        * Note that the current status for each resource will be sent to the consumer before returning.
+        *
+        * @param authToken Authentication token received when authenticate was called.
+        *
+        * @param resources A sequence of resources to subscribe to.
+        *
+        * @param presenceConsumer A proxy to a consumer that will receive status updates for the resources.
+        *
+        * @see Consumer
+        */
+       void subscribe(Token authToken, Ice::StringSeq resources, Consumer *presenceConsumer);
+
+       /**
+        * Method used to unsubscribe from specific resource status updates.
+        *
+        * @param resources A sequence of resources that will no longer be subscribed to.
+        *
+        * @param presenceConsumer A proxy to the consumer that was subscribed.
+        */
+       void unsubscribe(Ice::StringSeq resources, Consumer *presenceConsumer);
+   };
+
+}; /* End of module V1 */
+
+}; /* End of module Presence */
+
+}; /* End of module AsteriskSCF */

-----------------------------------------------------------------------


-- 
asterisk-scf/release/slice.git



More information about the asterisk-scf-commits mailing list