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. *
  55. * This container holds all ownCloud services
  56. * @since 6.0.0
  57. */
  58. interface IServerContainer extends IContainer {
  59. /**
  60. * The calendar manager will act as a broker between consumers for calendar information and
  61. * providers which actual deliver the calendar information.
  62. *
  63. * @return \OCP\Calendar\IManager
  64. * @since 13.0.0
  65. */
  66. public function getCalendarManager();
  67. /**
  68. * The calendar resource backend manager will act as a broker between consumers
  69. * for calendar resource information an providers which actual deliver the room information.
  70. *
  71. * @return \OCP\Calendar\Resource\IBackend
  72. * @since 14.0.0
  73. */
  74. public function getCalendarResourceBackendManager();
  75. /**
  76. * The calendar room backend manager will act as a broker between consumers
  77. * for calendar room information an providers which actual deliver the room information.
  78. *
  79. * @return \OCP\Calendar\Room\IBackend
  80. * @since 14.0.0
  81. */
  82. public function getCalendarRoomBackendManager();
  83. /**
  84. * The contacts manager will act as a broker between consumers for contacts information and
  85. * providers which actual deliver the contact information.
  86. *
  87. * @return \OCP\Contacts\IManager
  88. * @since 6.0.0
  89. */
  90. public function getContactsManager();
  91. /**
  92. * The current request object holding all information about the request currently being processed
  93. * is returned from this method.
  94. * In case the current execution was not initiated by a web request null is returned
  95. *
  96. * @return \OCP\IRequest
  97. * @since 6.0.0
  98. */
  99. public function getRequest();
  100. /**
  101. * Returns the preview manager which can create preview images for a given file
  102. *
  103. * @return \OCP\IPreview
  104. * @since 6.0.0
  105. */
  106. public function getPreviewManager();
  107. /**
  108. * Returns the tag manager which can get and set tags for different object types
  109. *
  110. * @see \OCP\ITagManager::load()
  111. * @return \OCP\ITagManager
  112. * @since 6.0.0
  113. */
  114. public function getTagManager();
  115. /**
  116. * Returns the root folder of ownCloud's data directory
  117. *
  118. * @return \OCP\Files\IRootFolder
  119. * @since 6.0.0 - between 6.0.0 and 8.0.0 this returned \OCP\Files\Folder
  120. */
  121. public function getRootFolder();
  122. /**
  123. * Returns a view to ownCloud's files folder
  124. *
  125. * @param string $userId user ID
  126. * @return \OCP\Files\Folder
  127. * @since 6.0.0 - parameter $userId was added in 8.0.0
  128. * @see getUserFolder in \OCP\Files\IRootFolder
  129. */
  130. public function getUserFolder($userId = null);
  131. /**
  132. * Returns an app-specific view in ownClouds data directory
  133. *
  134. * @return \OCP\Files\Folder
  135. * @since 6.0.0
  136. * @deprecated 9.2.0 use IAppData
  137. */
  138. public function getAppFolder();
  139. /**
  140. * Returns a user manager
  141. *
  142. * @return \OCP\IUserManager
  143. * @since 8.0.0
  144. */
  145. public function getUserManager();
  146. /**
  147. * Returns a group manager
  148. *
  149. * @return \OCP\IGroupManager
  150. * @since 8.0.0
  151. */
  152. public function getGroupManager();
  153. /**
  154. * Returns the user session
  155. *
  156. * @return \OCP\IUserSession
  157. * @since 6.0.0
  158. */
  159. public function getUserSession();
  160. /**
  161. * Returns the navigation manager
  162. *
  163. * @return \OCP\INavigationManager
  164. * @since 6.0.0
  165. */
  166. public function getNavigationManager();
  167. /**
  168. * Returns the config manager
  169. *
  170. * @return \OCP\IConfig
  171. * @since 6.0.0
  172. */
  173. public function getConfig();
  174. /**
  175. * Returns a Crypto instance
  176. *
  177. * @return \OCP\Security\ICrypto
  178. * @since 8.0.0
  179. */
  180. public function getCrypto();
  181. /**
  182. * Returns a Hasher instance
  183. *
  184. * @return \OCP\Security\IHasher
  185. * @since 8.0.0
  186. */
  187. public function getHasher();
  188. /**
  189. * Returns a SecureRandom instance
  190. *
  191. * @return \OCP\Security\ISecureRandom
  192. * @since 8.1.0
  193. */
  194. public function getSecureRandom();
  195. /**
  196. * Returns a CredentialsManager instance
  197. *
  198. * @return \OCP\Security\ICredentialsManager
  199. * @since 9.0.0
  200. */
  201. public function getCredentialsManager();
  202. /**
  203. * Returns the app config manager
  204. *
  205. * @return \OCP\IAppConfig
  206. * @since 7.0.0
  207. */
  208. public function getAppConfig();
  209. /**
  210. * @return \OCP\L10N\IFactory
  211. * @since 8.2.0
  212. */
  213. public function getL10NFactory();
  214. /**
  215. * get an L10N instance
  216. * @param string $app appid
  217. * @param string $lang
  218. * @return \OCP\IL10N
  219. * @since 6.0.0 - parameter $lang was added in 8.0.0
  220. */
  221. public function getL10N($app, $lang = null);
  222. /**
  223. * @return \OC\Encryption\Manager
  224. * @since 8.1.0
  225. */
  226. public function getEncryptionManager();
  227. /**
  228. * @return \OC\Encryption\File
  229. * @since 8.1.0
  230. */
  231. public function getEncryptionFilesHelper();
  232. /**
  233. * @return \OCP\Encryption\Keys\IStorage
  234. * @since 8.1.0
  235. */
  236. public function getEncryptionKeyStorage();
  237. /**
  238. * Returns the URL generator
  239. *
  240. * @return \OCP\IURLGenerator
  241. * @since 6.0.0
  242. */
  243. public function getURLGenerator();
  244. /**
  245. * Returns an ICache instance
  246. *
  247. * @return \OCP\ICache
  248. * @since 6.0.0
  249. */
  250. public function getCache();
  251. /**
  252. * Returns an \OCP\CacheFactory instance
  253. *
  254. * @return \OCP\ICacheFactory
  255. * @since 7.0.0
  256. */
  257. public function getMemCacheFactory();
  258. /**
  259. * Returns the current session
  260. *
  261. * @return \OCP\ISession
  262. * @since 6.0.0
  263. */
  264. public function getSession();
  265. /**
  266. * Returns the activity manager
  267. *
  268. * @return \OCP\Activity\IManager
  269. * @since 6.0.0
  270. */
  271. public function getActivityManager();
  272. /**
  273. * Returns the current session
  274. *
  275. * @return \OCP\IDBConnection
  276. * @since 6.0.0
  277. */
  278. public function getDatabaseConnection();
  279. /**
  280. * Returns an avatar manager, used for avatar functionality
  281. *
  282. * @return \OCP\IAvatarManager
  283. * @since 6.0.0
  284. */
  285. public function getAvatarManager();
  286. /**
  287. * Returns an job list for controlling background jobs
  288. *
  289. * @return \OCP\BackgroundJob\IJobList
  290. * @since 7.0.0
  291. */
  292. public function getJobList();
  293. /**
  294. * Returns a logger instance
  295. *
  296. * @return \OCP\ILogger
  297. * @since 8.0.0
  298. */
  299. public function getLogger();
  300. /**
  301. * returns a log factory instance
  302. *
  303. * @return ILogFactory
  304. * @since 14.0.0
  305. */
  306. public function getLogFactory();
  307. /**
  308. * Returns a router for generating and matching urls
  309. *
  310. * @return \OCP\Route\IRouter
  311. * @since 7.0.0
  312. */
  313. public function getRouter();
  314. /**
  315. * Returns a search instance
  316. *
  317. * @return \OCP\ISearch
  318. * @since 7.0.0
  319. */
  320. public function getSearch();
  321. /**
  322. * Get the certificate manager for the user
  323. *
  324. * @param string $userId (optional) if not specified the current loggedin user is used, use null to get the system certificate manager
  325. * @return \OCP\ICertificateManager | null if $userId is null and no user is logged in
  326. * @since 8.0.0
  327. */
  328. public function getCertificateManager($userId = null);
  329. /**
  330. * Create a new event source
  331. *
  332. * @return \OCP\IEventSource
  333. * @since 8.0.0
  334. */
  335. public function createEventSource();
  336. /**
  337. * Returns an instance of the HTTP client service
  338. *
  339. * @return \OCP\Http\Client\IClientService
  340. * @since 8.1.0
  341. */
  342. public function getHTTPClientService();
  343. /**
  344. * Get the active event logger
  345. *
  346. * @return \OCP\Diagnostics\IEventLogger
  347. * @since 8.0.0
  348. */
  349. public function getEventLogger();
  350. /**
  351. * Get the active query logger
  352. *
  353. * The returned logger only logs data when debug mode is enabled
  354. *
  355. * @return \OCP\Diagnostics\IQueryLogger
  356. * @since 8.0.0
  357. */
  358. public function getQueryLogger();
  359. /**
  360. * Get the manager for temporary files and folders
  361. *
  362. * @return \OCP\ITempManager
  363. * @since 8.0.0
  364. */
  365. public function getTempManager();
  366. /**
  367. * Get the app manager
  368. *
  369. * @return \OCP\App\IAppManager
  370. * @since 8.0.0
  371. */
  372. public function getAppManager();
  373. /**
  374. * Get the webroot
  375. *
  376. * @return string
  377. * @since 8.0.0
  378. */
  379. public function getWebRoot();
  380. /**
  381. * @return \OCP\Files\Config\IMountProviderCollection
  382. * @since 8.0.0
  383. */
  384. public function getMountProviderCollection();
  385. /**
  386. * Get the IniWrapper
  387. *
  388. * @return \bantu\IniGetWrapper\IniGetWrapper
  389. * @since 8.0.0
  390. */
  391. public function getIniWrapper();
  392. /**
  393. * @return \OCP\Command\IBus
  394. * @since 8.1.0
  395. */
  396. public function getCommandBus();
  397. /**
  398. * Creates a new mailer
  399. *
  400. * @return \OCP\Mail\IMailer
  401. * @since 8.1.0
  402. */
  403. public function getMailer();
  404. /**
  405. * Get the locking provider
  406. *
  407. * @return \OCP\Lock\ILockingProvider
  408. * @since 8.1.0
  409. */
  410. public function getLockingProvider();
  411. /**
  412. * @return \OCP\Files\Mount\IMountManager
  413. * @since 8.2.0
  414. */
  415. public function getMountManager();
  416. /**
  417. * Get the MimeTypeDetector
  418. *
  419. * @return \OCP\Files\IMimeTypeDetector
  420. * @since 8.2.0
  421. */
  422. public function getMimeTypeDetector();
  423. /**
  424. * Get the MimeTypeLoader
  425. *
  426. * @return \OCP\Files\IMimeTypeLoader
  427. * @since 8.2.0
  428. */
  429. public function getMimeTypeLoader();
  430. /**
  431. * Get the EventDispatcher
  432. *
  433. * @return EventDispatcherInterface
  434. * @since 8.2.0
  435. */
  436. public function getEventDispatcher();
  437. /**
  438. * Get the Notification Manager
  439. *
  440. * @return \OCP\Notification\IManager
  441. * @since 9.0.0
  442. */
  443. public function getNotificationManager();
  444. /**
  445. * @return \OCP\Comments\ICommentsManager
  446. * @since 9.0.0
  447. */
  448. public function getCommentsManager();
  449. /**
  450. * Returns the system-tag manager
  451. *
  452. * @return \OCP\SystemTag\ISystemTagManager
  453. *
  454. * @since 9.0.0
  455. */
  456. public function getSystemTagManager();
  457. /**
  458. * Returns the system-tag object mapper
  459. *
  460. * @return \OCP\SystemTag\ISystemTagObjectMapper
  461. *
  462. * @since 9.0.0
  463. */
  464. public function getSystemTagObjectMapper();
  465. /**
  466. * Returns the share manager
  467. *
  468. * @return \OCP\Share\IManager
  469. * @since 9.0.0
  470. */
  471. public function getShareManager();
  472. /**
  473. * @return IContentSecurityPolicyManager
  474. * @since 9.0.0
  475. * @deprecated 17.0.0 Use the AddContentSecurityPolicyEvent
  476. */
  477. public function getContentSecurityPolicyManager();
  478. /**
  479. * @return \OCP\IDateTimeZone
  480. * @since 8.0.0
  481. */
  482. public function getDateTimeZone();
  483. /**
  484. * @return \OCP\IDateTimeFormatter
  485. * @since 8.0.0
  486. */
  487. public function getDateTimeFormatter();
  488. /**
  489. * @return \OCP\Federation\ICloudIdManager
  490. * @since 12.0.0
  491. */
  492. public function getCloudIdManager();
  493. /**
  494. * @return \OCP\GlobalScale\IConfig
  495. * @since 14.0.0
  496. */
  497. public function getGlobalScaleConfig();
  498. /**
  499. * @return ICloudFederationFactory
  500. * @since 14.0.0
  501. */
  502. public function getCloudFederationFactory();
  503. /**
  504. * @return ICloudFederationProviderManager
  505. * @since 14.0.0
  506. */
  507. public function getCloudFederationProviderManager();
  508. /**
  509. * @return \OCP\Remote\Api\IApiFactory
  510. * @since 13.0.0
  511. */
  512. public function getRemoteApiFactory();
  513. /**
  514. * @return \OCP\Remote\IInstanceFactory
  515. * @since 13.0.0
  516. */
  517. public function getRemoteInstanceFactory();
  518. /**
  519. * @return \OCP\Files\Storage\IStorageFactory
  520. * @since 15.0.0
  521. */
  522. public function getStorageFactory();
  523. }