Class ServiceInfoFactory

java.lang.Object
org.eclipse.ecf.osgi.services.remoteserviceadmin.AbstractMetadataFactory
org.eclipse.ecf.osgi.services.remoteserviceadmin.ServiceInfoFactory
All Implemented Interfaces:
IServiceInfoFactory

public class ServiceInfoFactory extends AbstractMetadataFactory implements IServiceInfoFactory
Default implementation of IServiceInfoFactory.
  • Constructor Details

    • ServiceInfoFactory

      public ServiceInfoFactory()
  • Method Details

    • createServiceInfo

      public IServiceInfo createServiceInfo(IDiscoveryAdvertiser advertiser, EndpointDescription endpointDescription)
      Description copied from interface: IServiceInfoFactory
      Create an service info instance to represent the given endpointDescription for discovery using the given discovery advertiser.
      Specified by:
      createServiceInfo in interface IServiceInfoFactory
      Parameters:
      advertiser - the advertiser to use for creating the service info result. Must not be null.
      endpointDescription - the endpoint description that the service info is to represent. Must not be null.
      Returns:
      IServiceInfo to use to publish the endpointDescription for discovery (via IDiscoveryAdvertiser.registerService(IServiceInfo). If a service info instance has previously been created for the given endpointDescription by this service info factory, then that serviceInfo will be returned in favor of creating a new one. Otherwise, a new service info will be created and returned. If some error occurs in the creation of the serviceInfo, null will be returned.
      Since:
      3.0
    • createServiceInfo

      protected IServiceInfo createServiceInfo(URI uri, String serviceName, IServiceTypeID serviceTypeID, IServiceProperties serviceProperties)
    • createServiceProperties

      protected IServiceProperties createServiceProperties(EndpointDescription endpointDescription, IDiscoveryAdvertiser advertiser, IServiceTypeID serviceTypeID, String serviceName, URI uri)
      Parameters:
      endpointDescription - endpoint description
      advertiser - advertiser
      serviceTypeID - serviceTypeID
      serviceName - serviceName
      uri - uri
      Returns:
      IServiceProperties for the given input parameters
      Since:
      3.0
    • createURI

      protected URI createURI(EndpointDescription endpointDescription, IDiscoveryAdvertiser advertiser, IServiceTypeID serviceTypeID, String serviceName) throws URISyntaxException
      Parameters:
      endpointDescription - endpoint description
      advertiser - advertiser
      serviceTypeID - serviceTypeID
      serviceName - service name
      Returns:
      URI created
      Throws:
      URISyntaxException - thrown if URI cannot be created
      Since:
      3.0
    • createServiceName

      protected String createServiceName(EndpointDescription endpointDescription, IDiscoveryAdvertiser advertiser, IServiceTypeID serviceTypeID)
      Parameters:
      endpointDescription - endpoint description
      advertiser - advertiser
      serviceTypeID - serviceTypeID
      Returns:
      String created service name for input parameters
      Since:
      3.0
    • createDefaultServiceName

      protected String createDefaultServiceName(EndpointDescription endpointDescription, IDiscoveryAdvertiser advertiser, IServiceTypeID serviceTypeID)
      Parameters:
      endpointDescription - endpoint description
      advertiser - advertiser
      serviceTypeID - serviceTypeID
      Returns:
      String default service name created
      Since:
      3.0
    • createServiceTypeID

      protected IServiceTypeID createServiceTypeID(EndpointDescription endpointDescription, IDiscoveryAdvertiser advertiser)
      Parameters:
      endpointDescription - endpoint description
      advertiser - advertiser
      Returns:
      IServiceTypeID created service type ID
      Since:
      3.0