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 ofIServiceInfoFactory.
-
-
Field Summary
-
Fields inherited from class org.eclipse.ecf.osgi.services.remoteserviceadmin.AbstractMetadataFactory
LIST_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description ServiceInfoFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcreateDefaultServiceName(EndpointDescription endpointDescription, IDiscoveryAdvertiser advertiser, IServiceTypeID serviceTypeID)protected IServiceInfocreateServiceInfo(URI uri, String serviceName, IServiceTypeID serviceTypeID, IServiceProperties serviceProperties)IServiceInfocreateServiceInfo(IDiscoveryAdvertiser advertiser, EndpointDescription endpointDescription)Create an service info instance to represent the given endpointDescription for discovery using the given discovery advertiser.protected StringcreateServiceName(EndpointDescription endpointDescription, IDiscoveryAdvertiser advertiser, IServiceTypeID serviceTypeID)protected IServicePropertiescreateServiceProperties(EndpointDescription endpointDescription, IDiscoveryAdvertiser advertiser, IServiceTypeID serviceTypeID, String serviceName, URI uri)protected IServiceTypeIDcreateServiceTypeID(EndpointDescription endpointDescription, IDiscoveryAdvertiser advertiser)protected URIcreateURI(EndpointDescription endpointDescription, IDiscoveryAdvertiser advertiser, IServiceTypeID serviceTypeID, String serviceName)-
Methods inherited from class org.eclipse.ecf.osgi.services.remoteserviceadmin.AbstractMetadataFactory
close, decodeEndpointDescription, decodeList, decodeLong, decodeNonStandardServiceProperties, decodeOSGiProperties, decodeString, encodeList, encodeLong, encodeNonStandardServiceProperties, encodeOSGiServiceProperties, encodeServiceProperties, encodeString, logError, logWarning
-
-
-
-
Method Detail
-
createServiceInfo
public IServiceInfo createServiceInfo(IDiscoveryAdvertiser advertiser, EndpointDescription endpointDescription)
Description copied from interface:IServiceInfoFactoryCreate an service info instance to represent the given endpointDescription for discovery using the given discovery advertiser.- Specified by:
createServiceInfoin interfaceIServiceInfoFactory- Parameters:
advertiser- the advertiser to use for creating the service info result. Must not benull.endpointDescription- the endpoint description that the service info is to represent. Must not benull.- 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,nullwill 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 descriptionadvertiser- advertiserserviceTypeID- serviceTypeIDserviceName- serviceNameuri- 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 descriptionadvertiser- advertiserserviceTypeID- serviceTypeIDserviceName- 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 descriptionadvertiser- advertiserserviceTypeID- 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 descriptionadvertiser- advertiserserviceTypeID- serviceTypeID- Returns:
- String default service name created
- Since:
- 3.0
-
createServiceTypeID
protected IServiceTypeID createServiceTypeID(EndpointDescription endpointDescription, IDiscoveryAdvertiser advertiser)
- Parameters:
endpointDescription- endpoint descriptionadvertiser- advertiser- Returns:
- IServiceTypeID created service type ID
- Since:
- 3.0
-
-