Get the relying party id for a service.

@param service       the service to get an id for
@param configuration the configuration
@return relying party id
519755
public String getRelyingPartyIdentifier(final Service service, final WsFederationConfiguration configuration) {
        val relyingPartyIdentifier = configuration.getRelyingPartyIdentifier();
        if (service != null) {
            val registeredService = this.servicesManager.findServiceBy(service);
            RegisteredServiceAccessStrategyUtils.ensureServiceAccessIsAllowed(service, registeredService);
            if (RegisteredServiceProperty.RegisteredServiceProperties.WSFED_RELYING_PARTY_ID.isAssignedTo(registeredService)) {
                LOGGER.debug("Determined relying party identifier from service [{}] to be [{}]", service, relyingPartyIdentifier);
                return RegisteredServiceProperty.RegisteredServiceProperties.WSFED_RELYING_PARTY_ID.getPropertyValue(registeredService).getValue();
            }
        }
        LOGGER.debug("Determined relying party identifier to be [{}]", relyingPartyIdentifier);
        return relyingPartyIdentifier;
    }
1179516
public BrokerServiceAccessor getServiceAccessor(String serviceId) {
        for (BrokerServiceAccessor serviceAccessor : serviceAccessors) {
            if (serviceId.equals(serviceAccessor.getServiceDescription().getId())) {
                return serviceAccessor;
            }
        }

        throw new NotFoundException("Could not find service broker with service_id " + serviceId);
    }
911815
public function getConfigServiceId()
    {
        return strtolower(str_replace(
            '%bundle_service_id%',
            str_replace('%bundle_name%', $this->id, BundleInterface::BUNDLE_SERVICE_ID_PATTERN),
            BundleInterface::CONFIG_SERVICE_ID_PATTERN
        ));
    }
804707
public Service getService(String type, String name) {
        for (int i = 0; i < configs.length; i++) {
            Provider p = getProvider(i);
            Service s = p.getService(type, name);
            if (s != null) {
                return s;
            }
        }
        return null;
    }
229240
def getService(self, serviceIdentifier):
        
        if serviceIdentifier in self._services:
            return self._services[serviceIdentifier]
        else:
            message = "Application - getService() - " \
                      "Service with identifier {} does not exist." \
                      .format(serviceIdentifier)
            raise Exception(message)
934411
public static I_CmsCoreServiceAsync getService() {

        if (SERVICE == null) {
            SERVICE = GWT.create(I_CmsCoreService.class);
            String serviceUrl = CmsCoreProvider.get().link("org.opencms.gwt.CmsCoreService.gwt");
            ((ServiceDefTarget)SERVICE).setServiceEntryPoint(serviceUrl);
        }
        return SERVICE;
    }
28332
private String getErrorForUnknownService(String id) {
		StringBuffer error = new StringBuffer();
		error.append("Services path: " + ServiceConfigurationManager.CONFIGURATION_DIR);
		error.append("The service with id: " + id + " is not registered");

		error.append("\n Available services are: ");

		Set<String> keys = serviceManager.getRegisteredConfigurations().keySet();

		Iterator<String> it = keys.iterator();

		while (it.hasNext()) {
			error.append(it.next()).append(" ");
		}

		return error.toString();
	}
178321
private AuthenticationService getAuthenticationService(String id) {
        AuthenticationService service = authentication.getService(id);
        if (service == null) {
            throwIllegalArgumentExceptionInvalidAttributeValue(SecurityConfiguration.CFG_KEY_AUTHENTICATION_REF, id);
        }
        return service;
    }
881378
protected String determineIdentity(final OpenIdService service, final Assertion assertion) {
        if (assertion != null && OpenIdProtocolConstants.OPENID_IDENTIFIERSELECT.equals(service.getIdentity())) {
            return this.openIdPrefixUrl + '/' + assertion.getPrimaryAuthentication().getPrincipal().getId();
        }
        return service.getIdentity();
    }
1209131
public static boolean validateServiceName(Configuration conf,
      String nameServiceId) {
    Collection<String> nameserviceIds = DFSUtil.getNameServiceIds(conf);
    if (nameserviceIds != null && !nameserviceIds.isEmpty()) {
      if (nameServiceId == null) {
        System.err.println("Need to input a nameservice id");
        return false;
      } else if (!nameserviceIds.contains(nameServiceId)) {
        System.err.println("An invalid nameservice id: " + nameServiceId);
        return false;
      }
    } else if (nameServiceId != null) {
      System.err.println("An invalid nameservice id: " + nameServiceId);
      return false;
    }
    return true;
  }
570651
public ServiceInstanceEntity get(final String serviceId)
	{
		try
		{
			return serviceCache.get(serviceId, () -> dao.getById(serviceId));
		}
		catch (Exception e)
		{
			throw new RuntimeException("Error loading service: " + serviceId, e);
		}
	}
1197425
public Service getServiceObjectFromId(String id) {
        log.fine("Return service object for " + id);
        Service service = null;
        for (Service s : services.getServices()) {
            if (id.equals(s.getId())) {
                return s;
            }
        }
        return service;
    }
1056840
public static String[] setGenericConf(String[] argv, Configuration conf) {
    String[] serviceId = new String[1];
    serviceId[0] = "";
    String[] filteredArgv = getServiceName(argv, serviceId);
    if (!serviceId[0].equals("")) {
      if (!NameNode.validateServiceName(conf, serviceId[0])) {
        throw new IllegalArgumentException("Service Id doesn't match the config");
      }
      setGenericConf(conf, serviceId[0], NameNode.NAMESERVICE_SPECIFIC_KEYS);
      NameNode.setupDefaultURI(conf);
    }
    return filteredArgv;
  }
1231519
@Override
    public ConfigurationAdmin getService(Bundle bundle, ServiceRegistration<ConfigurationAdmin> registration) {
        ServiceReference<ConfigurationAdmin> reference = registration.getReference();
        ced.setServiceReference(reference);
        return new ConfigurationAdminImpl(this, bundle);
    }
91718
protected static List<String> getSupportedNameIdFormats(final SamlRegisteredService service,
                                                            final SamlRegisteredServiceServiceProviderMetadataFacade adaptor) {
        val supportedNameFormats = adaptor.getSupportedNameIdFormats();
        LOGGER.debug("Metadata for [{}] declares the following NameIDs [{}]", adaptor.getEntityId(), supportedNameFormats);

        if (supportedNameFormats.isEmpty()) {
            supportedNameFormats.add(NameIDType.TRANSIENT);
            LOGGER.debug("No supported nameId formats could be determined from metadata. Added default [{}]", NameIDType.TRANSIENT);
        }
        if (StringUtils.isNotBlank(service.getRequiredNameIdFormat())) {
            val fmt = parseAndBuildRequiredNameIdFormat(service);
            supportedNameFormats.add(0, fmt);
            LOGGER.debug("Added required nameId format [{}] based on saml service configuration for [{}]", fmt, service.getServiceId());
        }
        return supportedNameFormats;
    }
1283366
def find_service_by_id(self, service_id):
        
        service_id_key = 'serviceDefinitionId'
        service_id = str(service_id)
        for service in self._services:
            if service_id_key in service.values and str(
                    service.values[service_id_key]) == service_id:
                return service

        try:
            # If service_id is int or can be converted to int then we couldn't find it
            int(service_id)
            return None
        except ValueError:
            pass

        # try to find by type
        return self.find_service_by_type(service_id)
1119063
@Override
    public String build(final RegisteredService service, final String extension) {
        return StringUtils.remove(service.getName(), ' ') + '-' + service.getId() + '.' + extension;
    }