IServerContainer.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  6. * @author Bart Visscher <bartv@thisnet.nl>
  7. * @author Bernhard Posselt <dev@bernhard-posselt.com>
  8. * @author Bjoern Schiessle <bjoern@schiessle.org>
  9. * @author Björn Schießle <bjoern@schiessle.org>
  10. * @author Christopher Schäpers <kondou@ts.unde.re>
  11. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  12. * @author Georg Ehrke <oc.list@georgehrke.com>
  13. * @author Joas Schilling <coding@schilljs.com>
  14. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  15. * @author Lukas Reschke <lukas@statuscode.ch>
  16. * @author Morris Jobke <hey@morrisjobke.de>
  17. * @author Robin Appelman <robin@icewind.nl>
  18. * @author Robin McCorkell <robin@mccorkell.me.uk>
  19. * @author Roeland Jago Douma <roeland@famdouma.nl>
  20. * @author Thomas Müller <thomas.mueller@tmit.eu>
  21. * @author Thomas Tanghus <thomas@tanghus.net>
  22. * @author Vincent Petry <pvince81@owncloud.com>
  23. *
  24. * @license AGPL-3.0
  25. *
  26. * This code is free software: you can redistribute it and/or modify
  27. * it under the terms of the GNU Affero General Public License, version 3,
  28. * as published by the Free Software Foundation.
  29. *
  30. * This program is distributed in the hope that it will be useful,
  31. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  32. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  33. * GNU Affero General Public License for more details.
  34. *
  35. * You should have received a copy of the GNU Affero General Public License, version 3,
  36. * along with this program. If not, see <http://www.gnu.org/licenses/>
  37. *
  38. */
  39. /**
  40. * Public interface of ownCloud for apps to use.
  41. * Server container interface
  42. *
  43. */
  44. // use OCP namespace for all classes that are considered public.
  45. // This means that they should be used by apps instead of the internal ownCloud classes
  46. namespace OCP;
  47. use OCP\Federation\ICloudFederationFactory;
  48. use OCP\Federation\ICloudFederationProviderManager;
  49. use OCP\Log\ILogFactory;
  50. use OCP\Security\IContentSecurityPolicyManager;
  51. use Symfony\Component\EventDispatcher\EventDispatcherInterface;
  52. /**
  53. * Class IServerContainer
  54. * @package OCP
  55. *
  56. * This container holds all ownCloud services
  57. * @since 6.0.0
  58. */
  59. interface IServerContainer extends IContainer {
  60. /**
  61. * The calendar manager will act as a broker between consumers for calendar information and
  62. * providers which actual deliver the calendar information.
  63. *
  64. * @return \OCP\Calendar\IManager
  65. * @since 13.0.0
  66. */
  67. public function getCalendarManager();
  68. /**
  69. * The calendar resource backend manager will act as a broker between consumers
  70. * for calendar resource information an providers which actual deliver the room information.
  71. *
  72. * @return \OCP\Calendar\Resource\IBackend
  73. * @since 14.0.0
  74. */
  75. public function getCalendarResourceBackendManager();
  76. /**
  77. * The calendar room backend manager will act as a broker between consumers
  78. * for calendar room information an providers which actual deliver the room information.
  79. *
  80. * @return \OCP\Calendar\Room\IBackend
  81. * @since 14.0.0
  82. */
  83. public function getCalendarRoomBackendManager();
  84. /**
  85. * The contacts manager will act as a broker between consumers for contacts information and
  86. * providers which actual deliver the contact information.
  87. *
  88. * @return \OCP\Contacts\IManager
  89. * @since 6.0.0
  90. */
  91. public function getContactsManager();
  92. /**
  93. * The current request object holding all information about the request currently being processed
  94. * is returned from this method.
  95. * In case the current execution was not initiated by a web request null is returned
  96. *
  97. * @return \OCP\IRequest
  98. * @since 6.0.0
  99. */
  100. public function getRequest();
  101. /**
  102. * Returns the preview manager which can create preview images for a given file
  103. *
  104. * @return \OCP\IPreview
  105. * @since 6.0.0
  106. */
  107. public function getPreviewManager();
  108. /**
  109. * Returns the tag manager which can get and set tags for different object types
  110. *
  111. * @see \OCP\ITagManager::load()
  112. * @return \OCP\ITagManager
  113. * @since 6.0.0
  114. */
  115. public function getTagManager();
  116. /**
  117. * Returns the root folder of ownCloud's data directory
  118. *
  119. * @return \OCP\Files\IRootFolder
  120. * @since 6.0.0 - between 6.0.0 and 8.0.0 this returned \OCP\Files\Folder
  121. */
  122. public function getRootFolder();
  123. /**
  124. * Returns a view to ownCloud's files folder
  125. *
  126. * @param string $userId user ID
  127. * @return \OCP\Files\Folder
  128. * @since 6.0.0 - parameter $userId was added in 8.0.0
  129. * @see getUserFolder in \OCP\Files\IRootFolder
  130. */
  131. public function getUserFolder($userId = null);
  132. /**
  133. * Returns an app-specific view in ownClouds data directory
  134. *
  135. * @return \OCP\Files\Folder
  136. * @since 6.0.0
  137. * @deprecated 9.2.0 use IAppData
  138. */
  139. public function getAppFolder();
  140. /**
  141. * Returns a user manager
  142. *
  143. * @return \OCP\IUserManager
  144. * @since 8.0.0
  145. */
  146. public function getUserManager();
  147. /**
  148. * Returns a group manager
  149. *
  150. * @return \OCP\IGroupManager
  151. * @since 8.0.0
  152. */
  153. public function getGroupManager();
  154. /**
  155. * Returns the user session
  156. *
  157. * @return \OCP\IUserSession
  158. * @since 6.0.0
  159. */
  160. public function getUserSession();
  161. /**
  162. * Returns the navigation manager
  163. *
  164. * @return \OCP\INavigationManager
  165. * @since 6.0.0
  166. */
  167. public function getNavigationManager();
  168. /**
  169. * Returns the config manager
  170. *
  171. * @return \OCP\IConfig
  172. * @since 6.0.0
  173. */
  174. public function getConfig();
  175. /**
  176. * Returns a Crypto instance
  177. *
  178. * @return \OCP\Security\ICrypto
  179. * @since 8.0.0
  180. */
  181. public function getCrypto();
  182. /**
  183. * Returns a Hasher instance
  184. *
  185. * @return \OCP\Security\IHasher
  186. * @since 8.0.0
  187. */
  188. public function getHasher();
  189. /**
  190. * Returns a SecureRandom instance
  191. *
  192. * @return \OCP\Security\ISecureRandom
  193. * @since 8.1.0
  194. */
  195. public function getSecureRandom();
  196. /**
  197. * Returns a CredentialsManager instance
  198. *
  199. * @return \OCP\Security\ICredentialsManager
  200. * @since 9.0.0
  201. */
  202. public function getCredentialsManager();
  203. /**
  204. * Returns the app config manager
  205. *
  206. * @return \OCP\IAppConfig
  207. * @since 7.0.0
  208. */
  209. public function getAppConfig();
  210. /**
  211. * @return \OCP\L10N\IFactory
  212. * @since 8.2.0
  213. */
  214. public function getL10NFactory();
  215. /**
  216. * get an L10N instance
  217. * @param string $app appid
  218. * @param string $lang
  219. * @return \OCP\IL10N
  220. * @since 6.0.0 - parameter $lang was added in 8.0.0
  221. */
  222. public function getL10N($app, $lang = null);
  223. /**
  224. * @return \OC\Encryption\Manager
  225. * @since 8.1.0
  226. */
  227. public function getEncryptionManager();
  228. /**
  229. * @return \OC\Encryption\File
  230. * @since 8.1.0
  231. */
  232. public function getEncryptionFilesHelper();
  233. /**
  234. * @return \OCP\Encryption\Keys\IStorage
  235. * @since 8.1.0
  236. */
  237. public function getEncryptionKeyStorage();
  238. /**
  239. * Returns the URL generator
  240. *
  241. * @return \OCP\IURLGenerator
  242. * @since 6.0.0
  243. */
  244. public function getURLGenerator();
  245. /**
  246. * Returns an ICache instance
  247. *
  248. * @return \OCP\ICache
  249. * @since 6.0.0
  250. */
  251. public function getCache();
  252. /**
  253. * Returns an \OCP\CacheFactory instance
  254. *
  255. * @return \OCP\ICacheFactory
  256. * @since 7.0.0
  257. */
  258. public function getMemCacheFactory();
  259. /**
  260. * Returns the current session
  261. *
  262. * @return \OCP\ISession
  263. * @since 6.0.0
  264. */
  265. public function getSession();
  266. /**
  267. * Returns the activity manager
  268. *
  269. * @return \OCP\Activity\IManager
  270. * @since 6.0.0
  271. */
  272. public function getActivityManager();
  273. /**
  274. * Returns the current session
  275. *
  276. * @return \OCP\IDBConnection
  277. * @since 6.0.0
  278. */
  279. public function getDatabaseConnection();
  280. /**
  281. * Returns an avatar manager, used for avatar functionality
  282. *
  283. * @return \OCP\IAvatarManager
  284. * @since 6.0.0
  285. */
  286. public function getAvatarManager();
  287. /**
  288. * Returns an job list for controlling background jobs
  289. *
  290. * @return \OCP\BackgroundJob\IJobList
  291. * @since 7.0.0
  292. */
  293. public function getJobList();
  294. /**
  295. * Returns a logger instance
  296. *
  297. * @return \OCP\ILogger
  298. * @since 8.0.0
  299. */
  300. public function getLogger();
  301. /**
  302. * returns a log factory instance
  303. *
  304. * @return ILogFactory
  305. * @since 14.0.0
  306. */
  307. public function getLogFactory();
  308. /**
  309. * Returns a router for generating and matching urls
  310. *
  311. * @return \OCP\Route\IRouter
  312. * @since 7.0.0
  313. */
  314. public function getRouter();
  315. /**
  316. * Returns a search instance
  317. *
  318. * @return \OCP\ISearch
  319. * @since 7.0.0
  320. */
  321. public function getSearch();
  322. /**
  323. * Get the certificate manager for the user
  324. *
  325. * @param string $userId (optional) if not specified the current loggedin user is used, use null to get the system certificate manager
  326. * @return \OCP\ICertificateManager | null if $userId is null and no user is logged in
  327. * @since 8.0.0
  328. */
  329. public function getCertificateManager($userId = null);
  330. /**
  331. * Create a new event source
  332. *
  333. * @return \OCP\IEventSource
  334. * @since 8.0.0
  335. */
  336. public function createEventSource();
  337. /**
  338. * Returns an instance of the HTTP client service
  339. *
  340. * @return \OCP\Http\Client\IClientService
  341. * @since 8.1.0
  342. */
  343. public function getHTTPClientService();
  344. /**
  345. * Get the active event logger
  346. *
  347. * @return \OCP\Diagnostics\IEventLogger
  348. * @since 8.0.0
  349. */
  350. public function getEventLogger();
  351. /**
  352. * Get the active query logger
  353. *
  354. * The returned logger only logs data when debug mode is enabled
  355. *
  356. * @return \OCP\Diagnostics\IQueryLogger
  357. * @since 8.0.0
  358. */
  359. public function getQueryLogger();
  360. /**
  361. * Get the manager for temporary files and folders
  362. *
  363. * @return \OCP\ITempManager
  364. * @since 8.0.0
  365. */
  366. public function getTempManager();
  367. /**
  368. * Get the app manager
  369. *
  370. * @return \OCP\App\IAppManager
  371. * @since 8.0.0
  372. */
  373. public function getAppManager();
  374. /**
  375. * Get the webroot
  376. *
  377. * @return string
  378. * @since 8.0.0
  379. */
  380. public function getWebRoot();
  381. /**
  382. * @return \OCP\Files\Config\IMountProviderCollection
  383. * @since 8.0.0
  384. */
  385. public function getMountProviderCollection();
  386. /**
  387. * Get the IniWrapper
  388. *
  389. * @return \bantu\IniGetWrapper\IniGetWrapper
  390. * @since 8.0.0
  391. */
  392. public function getIniWrapper();
  393. /**
  394. * @return \OCP\Command\IBus
  395. * @since 8.1.0
  396. */
  397. public function getCommandBus();
  398. /**
  399. * Creates a new mailer
  400. *
  401. * @return \OCP\Mail\IMailer
  402. * @since 8.1.0
  403. */
  404. public function getMailer();
  405. /**
  406. * Get the locking provider
  407. *
  408. * @return \OCP\Lock\ILockingProvider
  409. * @since 8.1.0
  410. */
  411. public function getLockingProvider();
  412. /**
  413. * @return \OCP\Files\Mount\IMountManager
  414. * @since 8.2.0
  415. */
  416. public function getMountManager();
  417. /**
  418. * Get the MimeTypeDetector
  419. *
  420. * @return \OCP\Files\IMimeTypeDetector
  421. * @since 8.2.0
  422. */
  423. public function getMimeTypeDetector();
  424. /**
  425. * Get the MimeTypeLoader
  426. *
  427. * @return \OCP\Files\IMimeTypeLoader
  428. * @since 8.2.0
  429. */
  430. public function getMimeTypeLoader();
  431. /**
  432. * Get the EventDispatcher
  433. *
  434. * @return EventDispatcherInterface
  435. * @since 8.2.0
  436. */
  437. public function getEventDispatcher();
  438. /**
  439. * Get the Notification Manager
  440. *
  441. * @return \OCP\Notification\IManager
  442. * @since 9.0.0
  443. */
  444. public function getNotificationManager();
  445. /**
  446. * @return \OCP\Comments\ICommentsManager
  447. * @since 9.0.0
  448. */
  449. public function getCommentsManager();
  450. /**
  451. * Returns the system-tag manager
  452. *
  453. * @return \OCP\SystemTag\ISystemTagManager
  454. *
  455. * @since 9.0.0
  456. */
  457. public function getSystemTagManager();
  458. /**
  459. * Returns the system-tag object mapper
  460. *
  461. * @return \OCP\SystemTag\ISystemTagObjectMapper
  462. *
  463. * @since 9.0.0
  464. */
  465. public function getSystemTagObjectMapper();
  466. /**
  467. * Returns the share manager
  468. *
  469. * @return \OCP\Share\IManager
  470. * @since 9.0.0
  471. */
  472. public function getShareManager();
  473. /**
  474. * @return IContentSecurityPolicyManager
  475. * @since 9.0.0
  476. * @deprecated 17.0.0 Use the AddContentSecurityPolicyEvent
  477. */
  478. public function getContentSecurityPolicyManager();
  479. /**
  480. * @return \OCP\IDateTimeZone
  481. * @since 8.0.0
  482. */
  483. public function getDateTimeZone();
  484. /**
  485. * @return \OCP\IDateTimeFormatter
  486. * @since 8.0.0
  487. */
  488. public function getDateTimeFormatter();
  489. /**
  490. * @return \OCP\Federation\ICloudIdManager
  491. * @since 12.0.0
  492. */
  493. public function getCloudIdManager();
  494. /**
  495. * @return \OCP\GlobalScale\IConfig
  496. * @since 14.0.0
  497. */
  498. public function getGlobalScaleConfig();
  499. /**
  500. * @return ICloudFederationFactory
  501. * @since 14.0.0
  502. */
  503. public function getCloudFederationFactory();
  504. /**
  505. * @return ICloudFederationProviderManager
  506. * @since 14.0.0
  507. */
  508. public function getCloudFederationProviderManager();
  509. /**
  510. * @return \OCP\Remote\Api\IApiFactory
  511. * @since 13.0.0
  512. */
  513. public function getRemoteApiFactory();
  514. /**
  515. * @return \OCP\Remote\IInstanceFactory
  516. * @since 13.0.0
  517. */
  518. public function getRemoteInstanceFactory();
  519. /**
  520. * @return \OCP\Files\Storage\IStorageFactory
  521. * @since 15.0.0
  522. */
  523. public function getStorageFactory();
  524. }