/** @since 3.0 */ protected IServiceTypeID createServiceTypeID( org.osgi.service.remoteserviceadmin.EndpointDescription endpointDescription, IDiscoveryAdvertiser advertiser) { Map props = endpointDescription.getProperties(); String[] scopes = PropertiesUtil.getStringArrayWithDefault( props, RemoteConstants.DISCOVERY_SCOPE, IServiceTypeID.DEFAULT_SCOPE); String[] protocols = PropertiesUtil.getStringArrayWithDefault( props, RemoteConstants.DISCOVERY_PROTOCOLS, IServiceTypeID.DEFAULT_SCOPE); String namingAuthority = PropertiesUtil.getStringWithDefault( props, RemoteConstants.DISCOVERY_NAMING_AUTHORITY, IServiceTypeID.DEFAULT_NA); return ServiceIDFactory.getDefault() .createServiceTypeID( advertiser.getServicesNamespace(), new String[] {RemoteConstants.DISCOVERY_SERVICE_TYPE}, scopes, protocols, namingAuthority); }
/** @since 3.0 */ protected String createServiceName( org.osgi.service.remoteserviceadmin.EndpointDescription endpointDescription, IDiscoveryAdvertiser advertiser, IServiceTypeID serviceTypeID) { // First create unique default name String defaultServiceName = createDefaultServiceName(endpointDescription, advertiser, serviceTypeID); // Look for service name that was explicitly set String serviceName = PropertiesUtil.getStringWithDefault( endpointDescription.getProperties(), RemoteConstants.DISCOVERY_SERVICE_NAME, defaultServiceName); return serviceName; }