diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2016-01-14 14:35:24 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2016-01-22 10:32:42 +0100 |
commit | ee02165005f3fd24e1a17fdb3faeedda036d93c7 (patch) | |
tree | 1fd047788bb8f439665ff3e61d135bb6a62856c9 /lib/private | |
parent | e2e5eedb40a15ef3a6971e2145abec24873c4400 (diff) | |
download | nextcloud-server-ee02165005f3fd24e1a17fdb3faeedda036d93c7.tar.gz nextcloud-server-ee02165005f3fd24e1a17fdb3faeedda036d93c7.zip |
Move the notification API to public namespace
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/notification/action.php | 2 | ||||
-rw-r--r-- | lib/private/notification/iaction.php | 109 | ||||
-rw-r--r-- | lib/private/notification/iapp.php | 56 | ||||
-rw-r--r-- | lib/private/notification/imanager.php | 70 | ||||
-rw-r--r-- | lib/private/notification/inotification.php | 227 | ||||
-rw-r--r-- | lib/private/notification/inotifier.php | 43 | ||||
-rw-r--r-- | lib/private/notification/manager.php | 5 | ||||
-rw-r--r-- | lib/private/notification/notification.php | 3 | ||||
-rw-r--r-- | lib/private/server.php | 2 |
9 files changed, 11 insertions, 506 deletions
diff --git a/lib/private/notification/action.php b/lib/private/notification/action.php index 1730756c1de..deac6807653 100644 --- a/lib/private/notification/action.php +++ b/lib/private/notification/action.php @@ -22,6 +22,8 @@ namespace OC\Notification; +use OCP\Notification\IAction; + class Action implements IAction { /** @var string */ diff --git a/lib/private/notification/iaction.php b/lib/private/notification/iaction.php deleted file mode 100644 index 79e28ecef89..00000000000 --- a/lib/private/notification/iaction.php +++ /dev/null @@ -1,109 +0,0 @@ -<?php -/** - * @author Joas Schilling <nickvergessen@owncloud.com> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * 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, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace OC\Notification; - -/** - * Interface IAction - * - * @package OC\Notification - * @since 8.2.0 - * - * DEVELOPER NOTE: - * The notification api is experimental only in 8.2.0! Do not start using it, - * if you can not prepare an update for the next version afterwards. - */ -interface IAction { - /** - * @param string $label - * @return $this - * @throws \InvalidArgumentException if the label is invalid - * @since 8.2.0 - */ - public function setLabel($label); - - /** - * @return string - * @since 8.2.0 - */ - public function getLabel(); - - /** - * @param string $label - * @return $this - * @throws \InvalidArgumentException if the label is invalid - * @since 8.2.0 - */ - public function setParsedLabel($label); - - /** - * @return string - * @since 8.2.0 - */ - public function getParsedLabel(); - - /** - * @param $primary bool - * @return $this - * @throws \InvalidArgumentException if $primary is invalid - * @since 9.0.0 - */ - public function setPrimary($primary); - - /** - * @return bool - * @since 9.0.0 - */ - public function isPrimary(); - - /** - * @param string $link - * @param string $requestType - * @return $this - * @throws \InvalidArgumentException if the link is invalid - * @since 8.2.0 - */ - public function setLink($link, $requestType); - - /** - * @return string - * @since 8.2.0 - */ - public function getLink(); - - /** - * @return string - * @since 8.2.0 - */ - public function getRequestType(); - - /** - * @return bool - * @since 8.2.0 - */ - public function isValid(); - - /** - * @return bool - * @since 8.2.0 - */ - public function isValidParsed(); -} diff --git a/lib/private/notification/iapp.php b/lib/private/notification/iapp.php deleted file mode 100644 index 8ae4f6a5437..00000000000 --- a/lib/private/notification/iapp.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * @author Joas Schilling <nickvergessen@owncloud.com> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * 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, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace OC\Notification; - -/** - * Interface IApp - * - * @package OC\Notification - * @since 8.2.0 - * - * DEVELOPER NOTE: - * The notification api is experimental only in 8.2.0! Do not start using it, - * if you can not prepare an update for the next version afterwards. - */ -interface IApp { - /** - * @param INotification $notification - * @return null - * @throws \InvalidArgumentException When the notification is not valid - * @since 8.2.0 - */ - public function notify(INotification $notification); - - /** - * @param INotification $notification - * @return null - * @since 8.2.0 - */ - public function markProcessed(INotification $notification); - - /** - * @param INotification $notification - * @return int - * @since 8.2.0 - */ - public function getCount(INotification $notification); -} diff --git a/lib/private/notification/imanager.php b/lib/private/notification/imanager.php deleted file mode 100644 index 2f8e3ba39fc..00000000000 --- a/lib/private/notification/imanager.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -/** - * @author Joas Schilling <nickvergessen@owncloud.com> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * 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, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace OC\Notification; - -/** - * Interface IManager - * - * @package OC\Notification - * @since 8.2.0 - * - * DEVELOPER NOTE: - * The notification api is experimental only in 8.2.0! Do not start using it, - * if you can not prepare an update for the next version afterwards. - */ -interface IManager extends IApp, INotifier { - /** - * @param \Closure $service The service must implement IApp, otherwise a - * \InvalidArgumentException is thrown later - * @return null - * @since 8.2.0 - */ - public function registerApp(\Closure $service); - - /** - * @param \Closure $service The service must implement INotifier, otherwise a - * \InvalidArgumentException is thrown later - * @param \Closure $info An array with the keys 'id' and 'name' containing - * the app id and the app name - * @return null - * @since 8.2.0 - Parameter $info was added in 9.0.0 - */ - public function registerNotifier(\Closure $service, \Closure $info); - - /** - * @return array App ID => App Name - * @since 9.0.0 - */ - public function listNotifiers(); - - /** - * @return INotification - * @since 8.2.0 - */ - public function createNotification(); - - /** - * @return bool - * @since 8.2.0 - */ - public function hasNotifiers(); -} diff --git a/lib/private/notification/inotification.php b/lib/private/notification/inotification.php deleted file mode 100644 index 921f0779b92..00000000000 --- a/lib/private/notification/inotification.php +++ /dev/null @@ -1,227 +0,0 @@ -<?php -/** - * @author Joas Schilling <nickvergessen@owncloud.com> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * 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, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace OC\Notification; - -/** - * Interface INotification - * - * @package OC\Notification - * @since 8.2.0 - * - * DEVELOPER NOTE: - * The notification api is experimental only in 8.2.0! Do not start using it, - * if you can not prepare an update for the next version afterwards. - */ -interface INotification { - /** - * @param string $app - * @return $this - * @throws \InvalidArgumentException if the app id are invalid - * @since 8.2.0 - */ - public function setApp($app); - - /** - * @return string - * @since 8.2.0 - */ - public function getApp(); - - /** - * @param string $user - * @return $this - * @throws \InvalidArgumentException if the user id are invalid - * @since 8.2.0 - */ - public function setUser($user); - - /** - * @return string - * @since 8.2.0 - */ - public function getUser(); - - /** - * @param \DateTime $dateTime - * @return $this - * @throws \InvalidArgumentException if the $dateTime is invalid - * @since 9.0.0 - */ - public function setDateTime(\DateTime $dateTime); - - /** - * @return \DateTime - * @since 9.0.0 - */ - public function getDateTime(); - - /** - * @param string $type - * @param string $id - * @return $this - * @throws \InvalidArgumentException if the object type or id is invalid - * @since 8.2.0 - 9.0.0: Type of $id changed to string - */ - public function setObject($type, $id); - - /** - * @return string - * @since 8.2.0 - */ - public function getObjectType(); - - /** - * @return string - * @since 8.2.0 - 9.0.0: Return type changed to string - */ - public function getObjectId(); - - /** - * @param string $subject - * @param array $parameters - * @return $this - * @throws \InvalidArgumentException if the subject or parameters are invalid - * @since 8.2.0 - */ - public function setSubject($subject, array $parameters = []); - - /** - * @return string - * @since 8.2.0 - */ - public function getSubject(); - - /** - * @return string[] - * @since 8.2.0 - */ - public function getSubjectParameters(); - - /** - * @param string $subject - * @return $this - * @throws \InvalidArgumentException if the subject are invalid - * @since 8.2.0 - */ - public function setParsedSubject($subject); - - /** - * @return string - * @since 8.2.0 - */ - public function getParsedSubject(); - - /** - * @param string $message - * @param array $parameters - * @return $this - * @throws \InvalidArgumentException if the message or parameters are invalid - * @since 8.2.0 - */ - public function setMessage($message, array $parameters = []); - - /** - * @return string - * @since 8.2.0 - */ - public function getMessage(); - - /** - * @return string[] - * @since 8.2.0 - */ - public function getMessageParameters(); - - /** - * @param string $message - * @return $this - * @throws \InvalidArgumentException if the message are invalid - * @since 8.2.0 - */ - public function setParsedMessage($message); - - /** - * @return string - * @since 8.2.0 - */ - public function getParsedMessage(); - - /** - * @param string $link - * @return $this - * @throws \InvalidArgumentException if the link are invalid - * @since 8.2.0 - */ - public function setLink($link); - - /** - * @return string - * @since 8.2.0 - */ - public function getLink(); - - /** - * @return IAction - * @since 8.2.0 - */ - public function createAction(); - - /** - * @param IAction $action - * @return $this - * @throws \InvalidArgumentException if the action are invalid - * @since 8.2.0 - */ - public function addAction(IAction $action); - - /** - * @return IAction[] - * @since 8.2.0 - */ - public function getActions(); - - /** - * @param IAction $action - * @return $this - * @throws \InvalidArgumentException if the action are invalid - * @since 8.2.0 - */ - public function addParsedAction(IAction $action); - - /** - * @return IAction[] - * @since 8.2.0 - */ - public function getParsedActions(); - - /** - * @return bool - * @since 8.2.0 - */ - public function isValid(); - - /** - * @return bool - * @since 8.2.0 - */ - public function isValidParsed(); -} diff --git a/lib/private/notification/inotifier.php b/lib/private/notification/inotifier.php deleted file mode 100644 index c4312308fc0..00000000000 --- a/lib/private/notification/inotifier.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * @author Joas Schilling <nickvergessen@owncloud.com> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * 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, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace OC\Notification; - -/** - * Interface INotifier - * - * @package OC\Notification - * @since 8.2.0 - * - * DEVELOPER NOTE: - * The notification api is experimental only in 8.2.0! Do not start using it, - * if you can not prepare an update for the next version afterwards. - */ -interface INotifier { - /** - * @param INotification $notification - * @param string $languageCode The code of the language that should be used to prepare the notification - * @return INotification - * @throws \InvalidArgumentException When the notification was not prepared by a notifier - * @since 8.2.0 - */ - public function prepare(INotification $notification, $languageCode); -} diff --git a/lib/private/notification/manager.php b/lib/private/notification/manager.php index 239b5bfe5c7..a14a1deec0c 100644 --- a/lib/private/notification/manager.php +++ b/lib/private/notification/manager.php @@ -22,6 +22,11 @@ namespace OC\Notification; +use OCP\Notification\IApp; +use OCP\Notification\IManager; +use OCP\Notification\INotification; +use OCP\Notification\INotifier; + class Manager implements IManager { /** @var IApp */ protected $apps; diff --git a/lib/private/notification/notification.php b/lib/private/notification/notification.php index 677658eb3e8..6568f53f255 100644 --- a/lib/private/notification/notification.php +++ b/lib/private/notification/notification.php @@ -22,6 +22,9 @@ namespace OC\Notification; +use OCP\Notification\IAction; +use OCP\Notification\INotification; + class Notification implements INotification { /** @var string */ protected $app; diff --git a/lib/private/server.php b/lib/private/server.php index a16e6b9839b..0cb52b79184 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -1152,7 +1152,7 @@ class Server extends ServerContainer implements IServerContainer { /** * Get the Notification Manager * - * @return \OC\Notification\IManager + * @return \OCP\Notification\IManager * @since 8.2.0 */ public function getNotificationManager() { |