IServerContainer.php 12 KB

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