Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2018-06-18 15:26:32 +0300
committerGeorg Ehrke <developer@georgehrke.com>2018-06-25 05:58:08 +0300
commitc83629674eca793cd184462fce5d85902964878c (patch)
treec8845f1adfdeffc102740bf97be20051c1f8844f /lib/public/Calendar/Room
parentb832edabbfce23daca6edbb010c4bf180123930f (diff)
update resource booking interfaces and add managers
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'lib/public/Calendar/Room')
-rw-r--r--lib/public/Calendar/Room/IBackend.php12
-rw-r--r--lib/public/Calendar/Room/IManager.php58
-rw-r--r--lib/public/Calendar/Room/IRoom.php20
3 files changed, 83 insertions, 7 deletions
diff --git a/lib/public/Calendar/Room/IBackend.php b/lib/public/Calendar/Room/IBackend.php
index a7550347c74..84e01f6e320 100644
--- a/lib/public/Calendar/Room/IBackend.php
+++ b/lib/public/Calendar/Room/IBackend.php
@@ -36,14 +36,14 @@ interface IBackend {
*
* @return IRoom[]
*/
- public function getAllRooms();
+ public function getAllRooms():array;
/**
* get a list of all room identifiers in this backend
*
* @return string[]
*/
- public function listAllRooms();
+ public function listAllRooms():array;
/**
* get a room by it's id
@@ -52,4 +52,12 @@ interface IBackend {
* @return IRoom|null
*/
public function getRoom($id);
+
+ /**
+ * Get unique identifier of the backend
+ *
+ * @return string
+ * @since 14.0.0
+ */
+ public function getBackendIdentifier():string;
}
diff --git a/lib/public/Calendar/Room/IManager.php b/lib/public/Calendar/Room/IManager.php
new file mode 100644
index 00000000000..a04e75c41b4
--- /dev/null
+++ b/lib/public/Calendar/Room/IManager.php
@@ -0,0 +1,58 @@
+<?php
+/**
+ * @copyright 2018, Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @author Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\Calendar\Room;
+
+interface IManager {
+
+ /**
+ * Registers a room backend
+ *
+ * @param IBackend $backend
+ * @return void
+ * @since 14.0.0
+ */
+ public function registerBackend(IBackend $backend);
+
+ /**
+ * Unregisters a room backend
+ *
+ * @param IBackend $backend
+ * @return void
+ * @since 14.0.0
+ */
+ public function unregisterBackend(IBackend $backend);
+
+ /**
+ * @return IBackend[]
+ * @since 14.0.0
+ */
+ public function getBackends():array;
+
+ /**
+ * removes all registered backend instances
+ * @return void
+ * @since 14.0.0
+ */
+ public function clear();
+}
diff --git a/lib/public/Calendar/Room/IRoom.php b/lib/public/Calendar/Room/IRoom.php
index deac92a79d2..d860bb6fc57 100644
--- a/lib/public/Calendar/Room/IRoom.php
+++ b/lib/public/Calendar/Room/IRoom.php
@@ -39,7 +39,7 @@ interface IRoom {
* @return string
* @since 14.0.0
*/
- public function getId();
+ public function getId():string;
/**
* get the display name for a room
@@ -47,7 +47,7 @@ interface IRoom {
* @return string
* @since 14.0.0
*/
- public function getDisplayName();
+ public function getDisplayName():string;
/**
* Get a list of groupIds that are allowed to access this room
@@ -58,13 +58,23 @@ interface IRoom {
* @return string[]
* @since 14.0.0
*/
- public function getGroupRestrictions();
+ public function getGroupRestrictions():array;
/**
- * Get the name of the backend class the room is connected with
+ * get email-address for room
+ *
+ * The email address has to be globally unique
*
* @return string
* @since 14.0.0
*/
- public function getBackendClassName();
+ public function getEMail():string;
+
+ /**
+ * Get corresponding backend object
+ *
+ * @return IBackend
+ * @since 14.0.0
+ */
+ public function getBackend():IBackend;
}