summaryrefslogtreecommitdiffstats
path: root/lib/private/Server.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-10-04 16:21:50 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-12-08 16:37:14 +0100
commit5133a31d3c713e3e3c562e6fcd131ed2738d8798 (patch)
tree7bb2499876e7a75caa8e4921de46d528b97ee062 /lib/private/Server.php
parent74b5ce8fd4311f0d6f6a59e0636d343807b79d74 (diff)
downloadnextcloud-server-5133a31d3c713e3e3c562e6fcd131ed2738d8798.tar.gz
nextcloud-server-5133a31d3c713e3e3c562e6fcd131ed2738d8798.zip
Add public api for remote api
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Server.php')
-rw-r--r--lib/private/Server.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 0c6338f6a4c..f4f7cb75ad1 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -89,6 +89,8 @@ use OC\Memcache\ArrayCache;
use OC\Memcache\Factory;
use OC\Notification\Manager;
use OC\OCS\DiscoveryService;
+use OC\Remote\Api\ApiFactory;
+use OC\Remote\InstanceFactory;
use OC\Repair\NC11\CleanPreviewsBackgroundJob;
use OC\RichObjectStrings\Validator;
use OC\Security\Bruteforce\Throttler;
@@ -123,6 +125,8 @@ use OCP\IServerContainer;
use OCP\ITempManager;
use OCP\Contacts\ContactsMenu\IActionFactory;
use OCP\Lock\ILockingProvider;
+use OCP\Remote\Api\IApiFactory;
+use OCP\Remote\IInstanceFactory;
use OCP\RichObjectStrings\IValidator;
use OCP\Security\IContentSecurityPolicyManager;
use OCP\Share;
@@ -1109,6 +1113,15 @@ class Server extends ServerContainer implements IServerContainer {
$c->getConfig()
);
});
+
+ $this->registerService(IApiFactory::class, function(Server $c) {
+ return new ApiFactory($c->getHTTPClientService());
+ });
+
+ $this->registerService(IInstanceFactory::class, function(Server $c) {
+ $memcacheFactory = $c->getMemCacheFactory();
+ return new InstanceFactory($memcacheFactory->createLocal('remoteinstance.'), $c->getHTTPClientService());
+ });
}
/**
@@ -1878,4 +1891,18 @@ class Server extends ServerContainer implements IServerContainer {
public function getCloudIdManager() {
return $this->query(ICloudIdManager::class);
}
+
+ /**
+ * @return \OCP\Remote\Api\IApiFactory
+ */
+ public function getRemoteApiFactory() {
+ return $this->query(IApiFactory::class);
+ }
+
+ /**
+ * @return \OCP\Remote\IInstanceFactory
+ */
+ public function getRemoteInstanceFactory() {
+ return $this->query(IInstanceFactory::class);
+ }
}