Checks if notification service is supported

@param string $serviceName
@return string
@throws DomainException
552006
public static function validateServiceName($serviceName)
    {
        if (!in_array($serviceName, self::getAvailableServices())) {
            throw new DomainException(sprintf("Notification service '%s' is not supported.", $serviceName));
        }
        return $serviceName;
    }
830460
public function getCredentialsByService($serviceName)
    {
        if (!in_array($serviceName, $this->getInitializedServices())) {
            throw new DomainException(
                sprintf("Credentials for service '%s' was not initialized", $serviceName)
            );
        }

        return $this->serviceCredentials[$serviceName];
    }
1271939
public function getWsdlNoCache($serviceName)
	{
		if(null === $this->cacheInstance)
		{
			$this->createCacheInstance();
		}
		$ctw = new ClassToWsdl($serviceName,Dispatch::url($this->exec,array('serviceName'=>$serviceName)),$this->wsdlStyle,$this->wsdlUse);
		$result = $ctw->getWsdl();
		$cacheName = 'WSDL' . $serviceName;
		$this->cacheInstance->set($cacheName,$result,array('raw'=>true));
		return $result;
	}
131303
private function _resolveService($className) {
        $serviceDependencies = $this->_serviceDependencyErrorCheck($className);
        if (empty($serviceDependencies)) {
            return $this->_instanciateService($className, []);
        } else {
            $di = [];
            foreach ($serviceDependencies as $dependency) {
                //set $di[] with all dependencies and invoke
                $di[] = $this->_resolveService($dependency);
            }
            return $this->_instanciateService($className, $di);
        }
    }
231092
protected function getRegisterServiceArguments($serviceName)
    {
        $this->assertServiceExist($serviceName);

        return isset($this->services[$serviceName]['arguments'])
            ? $this->services[$serviceName]['arguments']
            : $this->services[$serviceName]['arguments'] = $this->getServiceArgumentNames($this->services[$serviceName]['definition']);
    }
528803
public function notification(array $notification) : array
    {
        try {
            $response = $this->client->post(
                'notices',
                ['body' => json_encode($notification)]
            );
        } catch (Exception $e) {
            throw ServiceException::generic();
        }

        if ($response->getStatusCode() !== Response::HTTP_CREATED) {
            throw (new ServiceExceptionFactory($response))->make();
        }

        return (string) $response->getBody()
            ? json_decode($response->getBody(), true)
            : [];
    }
1018476
public static function oneById($serviceName, $id)
	{
		if(!self::has($serviceName)) {
			return null;
		}
		/** @var ReadOneInterface $serviceInstance */
		$serviceInstance = self::get($serviceName);
		try {
			$result = $serviceInstance->oneById($id);
		} catch (NotFoundHttpException $e) {
			$result = null;
		}
		return $result;
	}
426216
public function getService($serviceName) {
        if (static::$container->offsetExists($serviceName) === false) {
            return null;
        }

        return static::$container->offsetGet($serviceName);
    }
325577
public function getServiceConfig($serviceName)
    {
        if (!$this->registeredServices->keyExists($serviceName)) {
            throw new ServiceManagerException(ServiceManagerException::SERVICE_DEFINITION_NOT_FOUND, [$serviceName]);
        }

        return $this->registeredServices[$serviceName];
    }
973864
public function get($serviceName)
    {
        if ($this->registry->has($serviceName)) {
            $service = $this->registry->getStrict($serviceName);
        }
        elseif ($this->parameterContainer->has($serviceName)) {
            $service = $this->parameterContainer->get($serviceName);
        }
        else {
            $service = $this->resolveService($serviceName);
        }

        return $service;
    }
723160
public static function createService($serviceName)
    {
        switch ($serviceName) {
            case self::SERVICE_REST:
                return new RestService();
            break;
            case self::SERVICE_SOAP:
                return new SoapService();
            break;
            case self::SERVICE_XMLRPC:
                return new XmlRpcService();
            break;
        }

        throw new \Exception(sprintf('Unknown service %s', $serviceName));
    }
999249
private boolean isServiceSupportedInRegion(String serviceName) {
        return partition.getServices().get(serviceName) != null
                && partition.getServices().get(serviceName).getEndpoints()
                .containsKey(region);
    }
579548
private function instantiateService($serviceName)
    {
        // Make sure service is registered
        if (!$this->registeredServices->keyExists($serviceName)) {
            throw new ServiceManagerException(ServiceManagerException::SERVICE_DEFINITION_NOT_FOUND, [$serviceName]);
        }

        // Get service config from registered services array
        $config = $this->registeredServices->key($serviceName);

        // Check circular referencing
        if ($this->references->keyExists($serviceName)) {
            throw new ServiceManagerException(ServiceManagerException::SERVICE_CIRCULAR_REFERENCE, [$serviceName]);
        }

        // Set service name reference for circular referencing checks
        $this->references->key($serviceName, $serviceName);

        // Compile ConfigObject into ServiceConfig
        $configCompiler = new ConfigCompiler($serviceName, $config, $this->parameters);
        $this->compiledConfig->key($serviceName, $configCompiler->compile());

        /**
         * @var $config ServiceConfig
         */
        $config = $this->compiledConfig->key($serviceName);

        // Construct service container and get service instance
        $serviceCreator = new ServiceCreator($config);
        $service = $serviceCreator->getService();

        // Unset service name reference
        $this->references->removeKey($serviceName);

        // Store instance if this service has a CONTAINER scope
        if ($config->getScope() == ServiceScope::CONTAINER) {
            $this->instantiatedServices->key($serviceName, $service);
        }

        return $service;
    }
1306903
public function unpersistService($serviceName)
    {
        if (isset($this->persistentServices[$serviceName])) {
            unset($this->persistentServices[$serviceName]);
        }
        if (isset($this->permanentServices[$serviceName])) {
            unset($this->permanentServices[$serviceName]);
        }
        if ($this->client && isset($this->client->persistentServices[$serviceName])) {
            unset($this->client->persistentServices[$serviceName]);
        }
    }
122776
public function isAvailable($serviceName) {
        $failures = $this->getFailures($serviceName);
        $maxFailures = $this->getMaxFailures($serviceName);
        if ($failures < $maxFailures) {
            // this is what happens most of the time so we evaluate first
            return true;
        } else {
            $lastTest = $this->getLastTest($serviceName);
            $retryTimeout = $this->getRetryTimeout($serviceName);
            if ($lastTest + $retryTimeout < time()) {
                // Once we wait $retryTimeout, we have to allow one 
                // thread to try to connect again. To prevent all other threads
                // from flooding, the potentially dead db, we update the time first
                // and then try to connect. If db is dead only one thread will hang
                // waiting for the connection. Others will get updated timeout from stats.
                // 
                // 'Race condition' is between first thread getting into this line and
                // time it takes to store the settings. In that time other threads will
                // also be entering this statement. Even on very busy servers it 
                // wont allow more than a few requests to get through before stats are updated.
                //
                // updating lastTest
                $this->setFailures($serviceName, $failures);
                // allowing this thread to try to connect to the resource
                return true;
            } else {
                return false;
            }
        }
    }
365800
public function getServiceDump($serviceName)
    {
        $this->assertServiceExist($serviceName);

        return [
            'class'      => get_class($this->services[$serviceName]['definition']),
            'arguments'  => $this->getRegisterServiceArguments($serviceName)
        ];
    }
285649
public function get($serviceName) {
        $container = $this->serviceData[$serviceName] ?? NULL;
        if($container) {
            return $container->getInstance();
        }

        if(in_array($serviceName, $this->getSelfReferenceNames()))
            return $this;

        $e = new UnknownServiceException("Service $serviceName is not registered", E_USER_ERROR);
        $e->setServiceName($serviceName);
        throw $e;
    }