2014-06-18 00:06:56 +04:00
|
|
|
<?php
|
2015-03-26 13:44:34 +03:00
|
|
|
/**
|
2016-07-21 18:07:57 +03:00
|
|
|
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
|
|
|
*
|
2015-03-26 13:44:34 +03:00
|
|
|
* @author Jörn Friedrich Dreyer <jfd@butonic.de>
|
|
|
|
* @author Morris Jobke <hey@morrisjobke.de>
|
2019-12-03 21:57:53 +03:00
|
|
|
* @author Robin Appelman <robin@icewind.nl>
|
2017-11-06 17:56:42 +03:00
|
|
|
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
2015-03-26 13:44:34 +03:00
|
|
|
*
|
|
|
|
* @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,
|
2019-12-03 21:57:53 +03:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
2015-03-26 13:44:34 +03:00
|
|
|
*
|
|
|
|
*/
|
2019-11-22 22:52:10 +03:00
|
|
|
|
2014-06-18 00:06:56 +04:00
|
|
|
namespace OCP\Files\ObjectStore;
|
|
|
|
|
2018-11-19 17:34:07 +03:00
|
|
|
use OCP\Files\NotFoundException;
|
|
|
|
|
2015-04-16 18:00:08 +03:00
|
|
|
/**
|
|
|
|
* Interface IObjectStore
|
|
|
|
*
|
|
|
|
* @package OCP\Files\ObjectStore
|
|
|
|
* @since 7.0.0
|
|
|
|
*/
|
2014-06-18 00:06:56 +04:00
|
|
|
interface IObjectStore {
|
|
|
|
|
2014-06-18 17:20:26 +04:00
|
|
|
/**
|
|
|
|
* @return string the container or bucket name where objects are stored
|
2015-04-16 18:00:08 +03:00
|
|
|
* @since 7.0.0
|
2014-06-18 17:20:26 +04:00
|
|
|
*/
|
2017-07-22 22:10:16 +03:00
|
|
|
public function getStorageId();
|
2014-06-18 17:20:26 +04:00
|
|
|
|
2014-06-18 00:06:56 +04:00
|
|
|
/**
|
|
|
|
* @param string $urn the unified resource name used to identify the object
|
2014-06-20 14:27:47 +04:00
|
|
|
* @return resource stream with the read data
|
2015-04-16 18:00:08 +03:00
|
|
|
* @throws \Exception when something goes wrong, message will be logged
|
2018-11-19 17:34:07 +03:00
|
|
|
* @throws NotFoundException if file does not exist
|
2015-04-16 18:00:08 +03:00
|
|
|
* @since 7.0.0
|
2014-06-18 00:06:56 +04:00
|
|
|
*/
|
2017-07-22 22:10:16 +03:00
|
|
|
public function readObject($urn);
|
2014-06-18 17:20:26 +04:00
|
|
|
|
2014-06-18 00:06:56 +04:00
|
|
|
/**
|
|
|
|
* @param string $urn the unified resource name used to identify the object
|
2014-06-20 14:27:47 +04:00
|
|
|
* @param resource $stream stream with the data to write
|
2015-04-16 18:00:08 +03:00
|
|
|
* @throws \Exception when something goes wrong, message will be logged
|
|
|
|
* @since 7.0.0
|
2014-06-18 00:06:56 +04:00
|
|
|
*/
|
2017-07-22 22:10:16 +03:00
|
|
|
public function writeObject($urn, $stream);
|
2014-06-18 00:06:56 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $urn the unified resource name used to identify the object
|
|
|
|
* @return void
|
2015-04-16 18:00:08 +03:00
|
|
|
* @throws \Exception when something goes wrong, message will be logged
|
|
|
|
* @since 7.0.0
|
2014-06-18 00:06:56 +04:00
|
|
|
*/
|
2017-07-22 22:10:16 +03:00
|
|
|
public function deleteObject($urn);
|
2018-12-10 19:20:45 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Check if an object exists in the object store
|
|
|
|
*
|
|
|
|
* @param string $urn
|
|
|
|
* @return bool
|
|
|
|
* @since 16.0.0
|
|
|
|
*/
|
|
|
|
public function objectExists($urn);
|
2015-04-16 18:00:08 +03:00
|
|
|
}
|