All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Foundation |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

*** This interface provides Binary Compatibility only, not Source Compatibility ***

## com.sas.services.discovery
Interface ServiceDiscoveryConfigurationInterface

All Superinterfaces:
  java.io.Serializable

All Known Implementing Classes:
  ServiceDiscoveryConfiguration

    @SASScope(value="ALL")
    @BinaryCompatibilityOnly
    public interface ServiceDiscoveryConfigurationInterface

extends java.io.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
`abstract boolean` | `addServiceAttribute(ServiceAttributeInterface serviceAttribute)` Adds a service lookup attribute.
`abstract void` | `addServiceAttributes(java.util.List<ServiceAttributeInterface> serviceAttributes)` Adds service lookup attributes.
`abstract void` | `destroy()` Destroys this configuration.
`abstract java.lang.String` | `getDiscoveryId()` Gets an ID associated with a service that's registered with the discovery service.
`abstract java.lang.String` | `getJVMId()` Gets an identifier used to represent the JVM in which the service was deployed.
`abstract java.lang.String` | `getRepositoryId()` Gets the ID associated with the repository instance of a metadata `ServiceComponent` element.
`abstract ServiceAttributeInterface[]` | `getServiceAttributes()` Gets optional attributes that may be provided to specify additional lookup criteria about a service.
`abstract ServiceComponentAttribute` | `getServiceComponentAttribute()` Get the ServiceComponent attribute.
`abstract ServiceDeploymentAttribute` | `getServiceDeploymentAttribute()` Get the attribute that represents the service's deployment.
`abstract java.lang.String` | `getServiceFactory()` Gets the fully qualified name of the Java class that serves as the services factory.
`abstract java.lang.String` | `getServiceGroup()` Gets the name of the service's deployment group.
`abstract java.lang.Class[]` | `getServiceTypes()` Gets the service types supported by the service.
`abstract boolean` | `isDelegateRegistrationEnabled()` Determines whether or not the service should be registered with discovery delegates.
`abstract boolean` | `removeServiceAttribute(ServiceAttributeInterface serviceAttribute)` Removes a service lookup attribute.
`abstract void` | `setDelegateRegistrationEnabled(boolean isDelegateRegistrationEnabled)` Sets the service discovery registration policy.
`abstract void` | `setServiceAttributes(ServiceAttributeInterface[] serviceAttributes)` Sets optional attributes that may be provided to specify additional lookup criteria about a service.
`abstract void` | `setServiceComponentAttribute(ServiceComponentAttribute serviceComponentAttribute)` Set the ServiceComponent attribute.
`abstract void` | `setServiceDeploymentAttribute(ServiceDeploymentAttribute serviceDeploymentAttribute)` Sets the attribute that represents the service deployment that contains the service.
`abstract void` | `setServiceFactory(java.lang.String serviceFactory)` Sets the fully qualified name of the Java class that serves as the services factory.
`abstract void` | `setServiceGroup(java.lang.String serviceGroup)` Set the name of the service's deployment group.
`abstract void` | `setServiceTypes(java.lang.Class[] serviceTypes)` Sets service types that a service is, extends, or implements.
`abstract void` | `unbindFromRMIRegistry()` Unbinds any RMI name bindings from the RMI registry.

Method Detail

### getDiscoveryId

    java.lang.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

    java.lang.String getRepositoryId()

  Gets the ID associated with the repository instance of a metadata `ServiceComponent` element.

  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:
    `true` if registration is enabled or `false` if it isn't.

### setDelegateRegistrationEnabled

    void setDelegateRegistrationEnabled(boolean isDelegateRegistrationEnabled)

  Sets the service discovery registration policy.

  Parameters:
    `isDelegateRegistrationEnabled` - `true` if the service is to be registered with discovery delegates or `false` if it isn't.

### getServiceTypes

    java.lang.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

    void setServiceTypes(java.lang.Class[] serviceTypes)
                         throws ServiceException

  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 `null` if no attributes are associated with this service.

### setServiceAttributes

    void setServiceAttributes(ServiceAttributeInterface[] serviceAttributes)

  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 or `null` if no attributes are associated with this service.

### addServiceAttribute

    boolean addServiceAttribute(ServiceAttributeInterface serviceAttribute)

  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:
    `true` if the service lookup attribute was added or `false` if it wasn't.

### addServiceAttributes

    void addServiceAttributes(java.util.List<ServiceAttributeInterface> serviceAttributes)

  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 of `ServiceAttributeInterface`.

### removeServiceAttribute

    boolean removeServiceAttribute(ServiceAttributeInterface serviceAttribute)

  Removes a service lookup attribute.

  Parameters:
    `serviceAttribute` - Service lookup attribute to be removed.
  Returns:
    `true` if the service lookup attribute was removed or `false` if it wasn't.

### getServiceFactory

    java.lang.String getServiceFactory()

  Gets the fully qualified name of the Java class that serves as the services factory. Note that this factory must implement `ServiceFactoryInterface`.

  Returns:
    Fully qualified Java name of a class that serves as a service's factory. This class must implement `ServiceFactoryInterface`.

### setServiceFactory

    void setServiceFactory(java.lang.String serviceFactory)
                           throws InitializationException

  Sets the fully qualified name of the Java class that serves as the services factory. Note that this factory must implement `ServiceFactoryInterface`.

  Parameters:
    `serviceFactory` - Fully qualified Java name of a class that serves as a service's factory. This class must implement `ServiceFactoryInterface`.
  Throws:
    `InitializationException` - if an invalid service factory is specified.

### setServiceComponentAttribute

    void setServiceComponentAttribute(ServiceComponentAttribute serviceComponentAttribute)

  Set the ServiceComponent attribute.

  Parameters:
    `serviceComponentAttribute` - The ServiceComponent attribute.

### getServiceComponentAttribute

    ServiceComponentAttribute getServiceComponentAttribute()

  Get the ServiceComponent attribute.

  Returns:
    The ServiceComponent attribute or `null` if no ServiceComponent attribute is associated with this service.

### setServiceGroup

    void setServiceGroup(java.lang.String serviceGroup)

  Set the name of the service's deployment group.

  Parameters:
    `serviceGroup` - The service's deployment group. This corresponds to the name of the `Tree` that represents service's group.

### getServiceGroup

    java.lang.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

    java.lang.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

    void setServiceDeploymentAttribute(ServiceDeploymentAttribute serviceDeploymentAttribute)

  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 metadata `SoftwareComponent`.

  Returns:
    The service deployment attribute or `null` if 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.

*** This interface provides Binary Compatibility only, not Source Compatibility ***

All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Foundation |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 SAS Institute Inc. All Rights Reserved.