### *** This class provides Binary Compatibility only, not Source Compatibility ***

Package com.sas.services.deployment

# Class AbstractServiceConfigFactory

java.lang.Object
com.sas.services.deployment.AbstractServiceConfigFactory

All Implemented Interfaces:
  `ServiceConfigFactoryInterface`

Direct Known Subclasses:
  `OMRServiceConfigFactory`, `URLServiceConfigFactory`

@SASScope("ALL") @BinaryCompatibilityOnly public abstract class AbstractServiceConfigFactory extends Object implements ServiceConfigFactoryInterface
Abstract factory used to manufacture a service configuration.

A concrete sub-class must implement the following method:

- `createConfigForService(String, String, String, MetadataSourceInterface, boolean)`

Since:
  9.2

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `PROPERTYNAME_INITDATA`
  Value of a metadata `Property`'s `PropertyName` attribute that designates a property specifying platform service initialization data.
  `static final String`
  `PROPERTYROLE_INITIALIZATION`
  Value of a metadata `StoredText`'s `Role` attribute that designates that the text string is used for initialization purposes.

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `AbstractServiceConfigFactory(com.sas.meta.SASOMI.IOMI omi)`
  Constructs a factory which can be used to create service configurations.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected static void`
  `addKeywordAttributes(List<ServiceAttributeInterface> attributes, com.sas.metadata.remote.Root root)`
  Gets a set of `NameValueAttribute` attributes for each Keyword associated to the specified metadata object.
  `protected static void`
  `addServiceAttributes(com.sas.metadata.remote.ServiceComponent serviceComponent, com.sas.metadata.remote.SoftwareComponent softwareComponent, ServiceDiscoveryConfigurationInterface serviceDiscoveryConfiguration)`
  Adds service attributes to the service's discovery configuration.
  `abstract ServiceConfigurationInterface`
  `createConfigForService(String softwareComponentName, String treeName, String serviceComponentName, MetadataSourceInterface metadataSource, boolean isRMIExportEnabled)`
  Query the service's configuration using a metadata resource adaptor.
  `protected ServiceConfigurationInterface`
  `createServiceConfig(String metadataXML, String softwareComponentName, String treeName, String serviceComponentName, MetadataSourceInterface metadataSource, boolean isRMIExportEnabled)`
  Creates a service configuration using the specified metadata.
  `void`
  `destroy()`
  Destroys this factory and its object store.
  `protected final com.sas.metadata.remote.MdFactory`
  `getMdFactory()`
  Gets the object store's metadata factory.
  `protected final com.sas.metadata.remote.MdObjectStore`
  `getMdObjectStore()`
  Gets the object store.
  `protected static Class[]`
  `getServiceTypes(com.sas.metadata.remote.ServiceComponent serviceComponent)`
  Gets the service types a deployed component supports.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### PROPERTYNAME_INITDATA

    public static final String PROPERTYNAME_INITDATA
    Value of a metadata `Property`'s `PropertyName` attribute that designates a property specifying platform service initialization data. This value is "INIT_DATA"
    See Also:
      - Constant Field Values

  - ### PROPERTYROLE_INITIALIZATION

    public static final String PROPERTYROLE_INITIALIZATION
    Value of a metadata `StoredText`'s `Role` attribute that designates that the text string is used for initialization purposes. This value is "initialization"
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### AbstractServiceConfigFactory

    protected AbstractServiceConfigFactory(com.sas.meta.SASOMI.IOMI omi) throws ServiceException
    Constructs a factory which can be used to create service configurations.
    Parameters:
      `omi` - The OMI connection to be used to query the service configuration from the metadata repository or `null` if querying the metadata from a services deployment export XML file.
    Throws:
      `ServiceException` - if unable to initialize a meadata object store.

- ## Method Details

  - ### createConfigForService

    public abstract ServiceConfigurationInterface createConfigForService(String softwareComponentName, String treeName, String serviceComponentName, MetadataSourceInterface metadataSource, boolean isRMIExportEnabled) throws ServiceException
    Query the service's configuration using a metadata resource adaptor. If an identity is not explicitly specified, then use a pre-configured identity obtained from the JAAS login-config.xml.
    Specified by:
      `createConfigForService` in interface `ServiceConfigFactoryInterface`
    Parameters:
      `softwareComponentName` - The name of the SAS Foundation Services deployment. This is the `SoftwareComponent.Name`.
      `treeName` - The name of the service deployment group. This is the `Tree.Name`.
      `serviceComponentName` - The name of the service component. This is the `ServiceComponent.Name`.
      `metadataSource` - Metadata source.
      `isRMIExportEnabled` - `true` if remote objects should be exported to the RMI system or `false` if they shouldn't.
    Returns:
      Service configuration
    Throws:
      `ServiceException` - if unable to get the service configuration. The ServiceException may wrap an exception that provides details concerning the cause of the failure.

  - ### getMdObjectStore

    protected final com.sas.metadata.remote.MdObjectStore getMdObjectStore() throws IllegalStateException
    Gets the object store.
    Returns:
      Metadata object store.
    Throws:
      `IllegalStateException` - if the metadata object store has been destroyed.

  - ### getMdFactory

    protected final com.sas.metadata.remote.MdFactory getMdFactory() throws ServiceException
    Gets the object store's metadata factory.
    Returns:
      Metadata factory.
    Throws:
      `ServiceException` - if unable to get the factory from the metadata object store.
      `IllegalStateException` - if the metadata object store has been destroyed.

  - ### createServiceConfig

    protected ServiceConfigurationInterface createServiceConfig(String metadataXML, String softwareComponentName, String treeName, String serviceComponentName, MetadataSourceInterface metadataSource, boolean isRMIExportEnabled) throws ServiceException
    Creates a service configuration using the specified metadata.
    Parameters:
      `metadataXML` - Metadata describing the service configuration.
      `softwareComponentName` - The name of the SAS Foundation Services deployment. This is the `SoftwareComponent.Name`.
      `treeName` - The name of the service deployment group. This is the `Tree.Name`.
      `serviceComponentName` - The name of the service component. This is the `ServiceComponent.Name`.
      `metadataSource` - The metadata source which will be used to query the service configuration.
      `isRMIExportEnabled` - `true` if remote objects should be exported to the RMI system or `false` if they shouldn't.
    Returns:
      Service configuration.
    Throws:
      `ServiceException` - if unable to create a configuration.

  - ### destroy

    public void destroy()
    Destroys this factory and its object store.

  - ### getServiceTypes

    protected static Class[] getServiceTypes(com.sas.metadata.remote.ServiceComponent serviceComponent) throws ServiceException
    Gets the service types a deployed component supports.
    Parameters:
      `serviceComponent` - Deployed component.
    Returns:
      Service types or `null` if no service types are supported.
    Throws:
      `ServiceException` - if unable to determine the service's service types.

  - ### addServiceAttributes

    protected static void addServiceAttributes(com.sas.metadata.remote.ServiceComponent serviceComponent, com.sas.metadata.remote.SoftwareComponent softwareComponent, ServiceDiscoveryConfigurationInterface serviceDiscoveryConfiguration) throws ServiceException
    Adds service attributes to the service's discovery configuration.
    Parameters:
      `serviceComponent` - Service component whose configuration is to be updated.
      `softwareComponent` - Application that owns the services deployment.
      `serviceDiscoveryConfiguration` - Service's discovery configuration which is to be updated with optional attributes which may be used to lookup a service.
    Throws:
      `ServiceException` - if unable to determine the service's attributes.

  - ### addKeywordAttributes

    protected static void addKeywordAttributes(List<ServiceAttributeInterface> attributes, com.sas.metadata.remote.Root root) throws ServiceException
    Gets a set of `NameValueAttribute` attributes for each Keyword associated to the specified metadata object. The attribute's name corresponds to the Keyword.Name and its value corresponds to Keyword.Desc.
    Parameters:
      `attributes` - List of `ServiceAttributeInterface` objects to which `name/value` attributes describing this metadata object keywords will be added.
      `root` - Metadata object whose associated keywords are to be represented using name/value attributes.
    Throws:
      `ServiceException` - if unable to obtain name/value attributes representing the metadata object's keywords.