*** This interface provides Binary Compatibility only, not Source Compatibility ***
Package com.sas.services.discovery
Interface ServiceDiscoveryConfigurationInterface
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ServiceDiscoveryConfiguration
@SASScope("ALL")
@BinaryCompatibilityOnly
public interface ServiceDiscoveryConfigurationInterface
extends Serializable
Interface describing a service discovery configuration consisting of
- an ID used to uniquely identify a service across JVMs and
- optional service attributes which may be used to qualify a discovery lookup to distinguish among multiple services that satisfy the same service types.
Each discoverable service will be associated with a unique ID. This ID may be used by a client to re-acquire a previously discovered service from the Discovery service.
While services are primarily looked up based upon the service types they
implement, service attributes may optionally be associated to provide
additional filtering criteria. Optional service attributes are specified
as part of a service's
com.sas.services.discovery.ServiceDiscoveryConfiguration. If a
service has a service discovery configuration it will be accessible as
follows:
String serviceDiscoveryId = null;
final ServiceConfigurationInterface serviceConfig =
service.getServiceConfiguration();
if (serviceConfig != null) {
final ServiceDiscoveryConfigurationInterface serviceDiscoveryConfig =
serviceConfig.getServiceConfiguration(
ServiceConfigurationInterface.CONFIGURATION_SERVICE_DISCOVERY);
if ((serviceDiscoveryConfig != null) &&
(serviceDiscoveryConfig instanceof
ServiceDiscoveryConfigurationInterface)) {
serviceDiscoveryId = ((ServiceDiscoveryConfigurationInterface)
serviceDiscoveryConfig).getDiscoveryId();
}
}
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddServiceAttribute(ServiceAttributeInterface serviceAttribute) Adds a service lookup attribute.voidaddServiceAttributes(List<ServiceAttributeInterface> serviceAttributes) Adds service lookup attributes.voiddestroy()Destroys this configuration.StringGets an ID associated with a service that's registered with the discovery service.StringgetJVMId()Gets an identifier used to represent the JVM in which the service was deployed.StringGets the ID associated with the repository instance of a metadataServiceComponentelement.Gets optional attributes that may be provided to specify additional lookup criteria about a service.Get the ServiceComponent attribute.Get the attribute that represents the service's deployment.StringGets the fully qualified name of the Java class that serves as the services factory.StringGets the name of the service's deployment group.Class[]Gets the service types supported by the service.booleanDetermines whether or not the service should be registered with discovery delegates.booleanremoveServiceAttribute(ServiceAttributeInterface serviceAttribute) Removes a service lookup attribute.voidsetDelegateRegistrationEnabled(boolean isDelegateRegistrationEnabled) Sets the service discovery registration policy.voidsetServiceAttributes(ServiceAttributeInterface[] serviceAttributes) Sets optional attributes that may be provided to specify additional lookup criteria about a service.voidsetServiceComponentAttribute(ServiceComponentAttribute serviceComponentAttribute) Set the ServiceComponent attribute.voidsetServiceDeploymentAttribute(ServiceDeploymentAttribute serviceDeploymentAttribute) Sets the attribute that represents the service deployment that contains the service.voidsetServiceFactory(String serviceFactory) Sets the fully qualified name of the Java class that serves as the services factory.voidsetServiceGroup(String serviceGroup) Set the name of the service's deployment group.voidsetServiceTypes(Class[] serviceTypes) Sets service types that a service is, extends, or implements.voidUnbinds any RMI name bindings from the RMI registry.
-
Method Details
-
getDiscoveryId
String getDiscoveryId()Gets an ID associated with a service that's registered with the discovery service.- Returns:
- ID that may be used to lookup a service.
-
getRepositoryId
String getRepositoryId()Gets the ID associated with the repository instance of a metadataServiceComponentelement.- Returns:
- ID used to represent a service as a deployable component in a repository.
-
isDelegateRegistrationEnabled
boolean isDelegateRegistrationEnabled()Determines whether or not the service should be registered with discovery delegates.- Returns:
trueif registration is enabled orfalseif it isn't.
-
setDelegateRegistrationEnabled
void setDelegateRegistrationEnabled(boolean isDelegateRegistrationEnabled) Sets the service discovery registration policy.- Parameters:
isDelegateRegistrationEnabled-trueif the service is to be registered with discovery delegates orfalseif it isn't.
-
getServiceTypes
Class[] getServiceTypes()Gets the service types supported by the service. These represent the Java classes the service is, extends, or implements.- Returns:
- Service types supported by the service.
-
setServiceTypes
Sets service types that a service is, extends, or implements. A service must specify 1..* service types.- Parameters:
serviceTypes- Service types supported by the service.- Throws:
ServiceException- if no service types are specified.
-
getServiceAttributes
ServiceAttributeInterface[] getServiceAttributes()Gets optional attributes that may be provided to specify additional lookup criteria about a service. These provide the capability to provide some level of filtering among services which satisfy the same service types.- Returns:
- Service attributes or
nullif no attributes are associated with this service.
-
setServiceAttributes
Sets optional attributes that may be provided to specify additional lookup criteria about a service. These provide the capability to provide some level of filtering among services which satisfy the same service types.- Parameters:
serviceAttributes- Service attributes ornullif no attributes are associated with this service.
-
addServiceAttribute
Adds a service lookup attribute. A service may optionally designate attributes which can be used to distinguish itself from other services satisfying the same service interfaces. A client would then use the DiscoveryService to lookup a service satisfying particular service interface(s) and optionally designated service attributes.- Parameters:
serviceAttribute- Service lookup attribute.- Returns:
trueif the service lookup attribute was added orfalseif it wasn't.
-
addServiceAttributes
Adds service lookup attributes. A service may optionally designate attributes which can be used to distinguish itself from other services satisfying the same service interfaces. A client would then use the DiscoveryService to lookup a service satisfying particular service interface(s) and optionally designated service attributes.- Parameters:
serviceAttributes- List ofServiceAttributeInterface.
-
removeServiceAttribute
Removes a service lookup attribute.- Parameters:
serviceAttribute- Service lookup attribute to be removed.- Returns:
trueif the service lookup attribute was removed orfalseif it wasn't.
-
getServiceFactory
String getServiceFactory()Gets the fully qualified name of the Java class that serves as the services factory. Note that this factory must implementServiceFactoryInterface.- Returns:
- Fully qualified Java name of a class that serves as a service's
factory. This class must implement
ServiceFactoryInterface.
-
setServiceFactory
Sets the fully qualified name of the Java class that serves as the services factory. Note that this factory must implementServiceFactoryInterface.- Parameters:
serviceFactory- Fully qualified Java name of a class that serves as a service's factory. This class must implementServiceFactoryInterface.- Throws:
InitializationException- if an invalid service factory is specified.
-
setServiceComponentAttribute
Set the ServiceComponent attribute.- Parameters:
serviceComponentAttribute- The ServiceComponent attribute.
-
getServiceComponentAttribute
ServiceComponentAttribute getServiceComponentAttribute()Get the ServiceComponent attribute.- Returns:
- The ServiceComponent attribute or
nullif no ServiceComponent attribute is associated with this service.
-
setServiceGroup
void setServiceGroup(String serviceGroup) Set the name of the service's deployment group.- Parameters:
serviceGroup- The service's deployment group. This corresponds to the name of theTreethat represents service's group.
-
getServiceGroup
String getServiceGroup()Gets the name of the service's deployment group.- Returns:
- The name of the service's deployment group which
is represented in metadata as a
Tree.
-
getJVMId
String getJVMId()Gets an identifier used to represent the JVM in which the service was deployed.- Returns:
- Identifier used to represent the JVM in which the service was deployed.
-
setServiceDeploymentAttribute
Sets the attribute that represents the service deployment that contains the service.- Parameters:
serviceDeploymentAttribute- The attribute that represents the service deployment,SoftwareComponent, that contains the service.
-
getServiceDeploymentAttribute
ServiceDeploymentAttribute getServiceDeploymentAttribute()Get the attribute that represents the service's deployment. This corresponds to the metadataSoftwareComponent.- Returns:
- The service deployment attribute or
nullif no service deployment attribute is associated with this service.
-
unbindFromRMIRegistry
void unbindFromRMIRegistry()Unbinds any RMI name bindings from the RMI registry. -
destroy
void destroy()Destroys this configuration.
-