### *** This class is subject to change. ***

Package com.sas.services.deployment

# Class OMRMetadataSource

java.lang.Object
com.sas.services.deployment.AbstractMetadataSource
com.sas.services.deployment.OMRMetadataSource

All Implemented Interfaces:
  `MetadataSourceInterface`, `Serializable`

@SASScope("ALL") @SubjectToChange public final class OMRMetadataSource extends AbstractMetadataSource implements MetadataSourceInterface
SAS Metadata Repository metadata source from which a foundation services deployment can be queried.

A connection will be opened to the SAS Metadata Server when this object is constructed. The creator of this object is responsible for invoking the `destroy()` method to ensure that this object is destroyed and its connection to the server closed.

Use the `OMRMetadataSource(String, String, Set, String, String, String, String, Environment)` constructor to create an instance that uses single sign-on specifying the desired service principal name and the security package list.

Since:
  1.0
See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final short`
  `TEMPLATE_ALL_SERVICES`
  Specifies use of a template that retrieves all services.
  `static final short`
  `TEMPLATE_REMOTE_DISCOVERY_SERVICES`
  Specifies use of a template that retrieves only remote discovery services.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `OMRMetadataSource(com.sas.meta.SASOMI.IOMI omi, String repositoryNameOrID, String softwareComponentName, Set<String> serviceGroupNames, Environment environment)`
  Constructs an instance with the specified SAS Metadata Server host, port, identity and password, and `Set` of `String` elements representing the foundation service deployments that are to be deployed.
  `OMRMetadataSource(String omrHost, String omrPort, String omrIdentity, String omrIdentityPassword, String repositoryName, String softwareComponentName)`
  Constructs an instance with the specified SAS Metadata Server host, port, identity and password, and name of the foundation service deployment that is to be deployed.
  `OMRMetadataSource(String omrHost, String omrPort, String omrIdentity, String omrIdentityPassword, String repositoryNameOrID, String softwareComponentName, String serviceGroupName)`
  Constructs an instance with the specified SAS Metadata Server host, port, identity and password, and name of the foundation service deployment that is to be deployed.
  `OMRMetadataSource(String omrHost, String omrPort, String omrIdentity, String omrIdentityPassword, String repositoryNameOrID, String softwareComponentName, Set<String> serviceGroupNames)`
  Constructs an instance with the specified SAS Metadata Server host, port, identity and password, and `Set` of `String` elements representing the foundation service deployments that are to be deployed.
  `OMRMetadataSource(String omrHost, String omrPort, String omrIdentity, String omrIdentityPassword, String repositoryNameOrID, String softwareComponentName, Set<String> serviceGroupNames, Environment environment)`
  Constructs an instance with the specified SAS Metadata Server host, port, identity and password, and `Set` of `String` elements representing the foundation service deployments that are to be deployed.
  `OMRMetadataSource(String repositoryNameOrID, String softwareComponentName, Set<String> serviceGroupNames, String omrHost, String omrPort, String secSPN, String secPackageList, Environment environment)`
  Constructs an instance which will open a single sign-on connection to the specified SAS Metadata Server.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `destroy()`
  Destroys the metadata source.
  `boolean`
  `equals(Object other)`
  Determines whether or not the other object equals this object.
  `protected String`
  `getDeployFailureMessage()`
  Gets a message describing this metadata source's inability to deploy services.
  `String`
  `getMetadata()`
  Gets metadata representing a foundation services deployment queried from a SAS Metadata Repository.
  `String`
  `getRepositoryId()`
  Gets SAS Metadata Server repository ID.
  `int`
  `hashCode()`
  Gets a hash code for this service attribute.
  `String`
  `toString()`
  Gets a string representation of this SAS Metadata Server metadata source which includes its host and port.

  ### Methods inherited from class com.sas.services.deployment.AbstractMetadataSource

  `addRMIBinding, addServiceDeploymentName, createMdStore, getApplicationServiceDeployment, getMdObjectStore, getProperties, getRMIClientSocketFactory, getRMIServerSocketFactory, getServiceDeploymentNames, getSoftwareComponentName, getStringFromInputSource, isServiceDeploymentDeployable, isServiceDeploymentDeployable, lookupServices, removeServiceDeploymentName, setApplicationServiceDeployment, setProperties, setRMIClientSocketFactory, setRMIServerSocketFactory, setServiceDeploymentNames, setSoftwareComponentName`

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

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface com.sas.services.deployment.MetadataSourceInterface

  `getApplicationServiceDeployment, getMdObjectStore, getProperties, getServiceDeploymentNames, isServiceDeploymentDeployable, isServiceDeploymentDeployable, setApplicationServiceDeployment, setProperties`

- ## Field Details

  - ### TEMPLATE_ALL_SERVICES

    public static final short TEMPLATE_ALL_SERVICES
    Specifies use of a template that retrieves all services. It is intended for use in deploying a set of services.
    See Also:
      - Constant Field Values

  - ### TEMPLATE_REMOTE_DISCOVERY_SERVICES

    public static final short TEMPLATE_REMOTE_DISCOVERY_SERVICES
    Specifies use of a template that retrieves only remote discovery services. This is used in the case where one is not deploying any services, but relying upon them to have already been deployed. This template is used to obtain handles to any remote discovery services.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### OMRMetadataSource

    public OMRMetadataSource(String omrHost, String omrPort, String omrIdentity, String omrIdentityPassword, String repositoryName, String softwareComponentName) throws InitializationException
    Constructs an instance with the specified SAS Metadata Server host, port, identity and password, and name of the foundation service deployment that is to be deployed.

    Use this constructor if you want the `ServiceLoader` utility to obtain its own metadata connection to SAS Metadata Server.

    Use this constructor if you want to deploy all services that are defined in the service deployment.

    If you want to only deploy certain groups of services, then either use either `OMRMetadataSource(String, String, String, String, String, String, String)` to only deploy services in the specified group or use `OMRMetadataSource(String, String, String, String, String, String, Set)` if you have multiple groups of services, and wish to deploy services in some, but not all groups (e.g. only deploy services in "Core" and "Stored Process" groups, but not any other group).

    A connection will be opened to the metadata server. Invoke the `destroy()` method when this metadata source is no longer needed in order to close the connection to the metadata server.

    Parameters:
      `omrHost` - SAS Metadata Server host.
      `omrPort` - SAS Metadata Server port.
      `omrIdentity` - SAS Metadata Server login identity.
      `omrIdentityPassword` - SAS Metadata Server login identity's password. The password should be encoded using `SasPasswordString`, but unencoded passwords are also supported. If an encoded password is desired then the password should be encoded using the following method. `SasPasswordString.encode(String)`.
      `repositoryName` - Name of the SAS Metadata Server repository that contains the service deployment.
      `softwareComponentName` - The name of the metadata `SoftwareComponent` that serves as the root of the service deployment hierarchy.
    Throws:
      `InitializationException` - if unable to construct an instance.

  - ### OMRMetadataSource

    public OMRMetadataSource(String omrHost, String omrPort, String omrIdentity, String omrIdentityPassword, String repositoryNameOrID, String softwareComponentName, String serviceGroupName) throws InitializationException
    Constructs an instance with the specified SAS Metadata Server host, port, identity and password, and name of the foundation service deployment that is to be deployed.

    Use this constructor if you want the `ServiceLoader` utility to obtain its own metadata connection to SAS Metadata Server.

    Use `OMRMetadataSource(String, String, String, String, String, String, Set)` if more than one service deployment is to be deployed.

    A connection will be opened to the metadata server. Invoke the `destroy()` method when this metadata source is no longer needed in order to close the connection to the metadata server.

    Parameters:
      `omrHost` - SAS Metadata Server host.
      `omrPort` - SAS Metadata Server port.
      `omrIdentity` - SAS Metadata Server login identity.
      `omrIdentityPassword` - SAS Metadata Server login identity's password. The password should be encoded using `SasPasswordString`, but unencoded passwords are also supported. If an encoded password is desired then the password should be encoded using `SasPasswordString.encode(String)`.
      `repositoryNameOrID` - Name or ID of the SAS Metadata Server repository that contains the service deployment.
      `softwareComponentName` - The name of the metadata `SoftwareComponent` that serves as the root of the service deployment hierarchy.
      `serviceGroupName` - The name of a service group that is to be deployed. Only services that are defined in this group will be deployed. The service deployment name corresponds to the `Name` attribute of a metadata `Tree` that is a subtree of the `SoftwareComponent`.
    Throws:
      `InitializationException` - if unable to construct an instance.

  - ### OMRMetadataSource

    public OMRMetadataSource(String omrHost, String omrPort, String omrIdentity, String omrIdentityPassword, String repositoryNameOrID, String softwareComponentName, Set<String> serviceGroupNames) throws InitializationException
    Constructs an instance with the specified SAS Metadata Server host, port, identity and password, and `Set` of `String` elements representing the foundation service deployments that are to be deployed.

    Use this constructor if you want the `ServiceLoader` utility to obtain its own metadata connection to SAS Metadata Server.

    Use `OMRMetadataSource(String, String, String, String, String, String)` if deploying a single service deployment.

    A connection will be opened to the metadata server. Invoke the `destroy()` method when this metadata source is no longer needed in order to close the connection to the metadata server.

    Parameters:
      `omrHost` - SAS Metadata Server host.
      `omrPort` - SAS Metadata Server port.
      `omrIdentity` - SAS Metadata Server login identity.
      `omrIdentityPassword` - SAS Metadata Server login identity's password. The password should be encoded using `SasPasswordString`, but unencoded passwords are also supported. If an encoded password is desired then the password should be encoded using `SasPasswordString.encode(String unencodedPassword)`.
      `repositoryNameOrID` - Name or ID of the SAS Metadata Server repository that contains the service deployment.
      `softwareComponentName` - The name of the metadata `SoftwareComponent` that serves as the root of the service deployment hierarchy.
      `serviceGroupNames` - `Set` of `String` names designating the service groups that are to be deployed. Use this parameter if you want to deploy services that belong to specified groups, but not all groups (e.g. services in the "Core" and "Stored Process" groups, but not in any other groups). If a `null` or empty set is specified, then no filter will be applied. The service deployment name corresponds to the `Name` attribute of a metadata `Tree` that is a subtree of the `SoftwareComponent`.
    Throws:
      `InitializationException` - if unable to construct an instance.

  - ### OMRMetadataSource

    public OMRMetadataSource(String omrHost, String omrPort, String omrIdentity, String omrIdentityPassword, String repositoryNameOrID, String softwareComponentName, Set<String> serviceGroupNames, Environment environment) throws InitializationException
    Constructs an instance with the specified SAS Metadata Server host, port, identity and password, and `Set` of `String` elements representing the foundation service deployments that are to be deployed.

    Use this constructor if you want the `ServiceLoader` utility to obtain its own metadata connection to SAS Metadata Server.

    Use `OMRMetadataSource(String, String, String, String, String, String)` if deploying a single service deployment.

    A connection will be opened to the metadata server. Invoke the `destroy()` method when this metadata source is no longer needed in order to close the connection to the metadata server.

    Parameters:
      `omrHost` - SAS Metadata Server host.
      `omrPort` - SAS Metadata Server port.
      `omrIdentity` - SAS Metadata Server logon identity.
      `omrIdentityPassword` - SAS Metadata Server logon identity's password. The password should be encoded using `SasPasswordString`, but unencoded passwords are also supported. If an encoded password is desired then the password should be encoded using `SasPasswordString.encode(String)`.
      `repositoryNameOrID` - Name or ID of the SAS Metadata Server repository that contains the service deployment.
      `softwareComponentName` - The name of the metadata `SoftwareComponent` that serves as the root of the service deployment hierarchy.
      `serviceGroupNames` - `Set` of `String` names designating the service groups that are to be deployed. Use this parameter if you want to deploy services that belong to specified groups, but not all groups (e.g. services in the "Core" and "Stored Process" groups, but not in any other groups). If a `null` or empty set is specified, then no filter will be applied. The service deployment name corresponds to the `Name` attribute of a metadata `Tree` that is a subtree of the `SoftwareComponent`.
      `environment` - The environment encapsulates resources provided by the container or `null` if a container environment is not applicable.
    Throws:
      `InitializationException` - if unable to construct an instance.

  - ### OMRMetadataSource

    public OMRMetadataSource(String repositoryNameOrID, String softwareComponentName, Set<String> serviceGroupNames, String omrHost, String omrPort, String secSPN, String secPackageList, Environment environment) throws ServiceException
    Constructs an instance which will open a single sign-on connection to the specified SAS Metadata Server.

    Single sign-on uses Microsoft's Security Support Provider Interface (SSPI), so one both the client and the metadata server must be running on the Windows platform.

    Invoke the `destroy()` method when this metadata source is no longer needed in order to release resources such as the connection to the metadata server.

    Parameters:
      `repositoryNameOrID` - Name or ID of the SAS Metadata Server repository that contains the service deployment.
      `softwareComponentName` - The name of the metadata `SoftwareComponent` that serves as the root of the service deployment hierarchy.
      `serviceGroupNames` - `Set` of `String` names designating the service groups that are to be deployed. Use this parameter if you want to deploy services that belong to specified groups, but not all groups (e.g. services in the "Core" and "Stored Process" groups, but not in any other groups). If a `null` or empty set is specified, then no filter will be applied causing all services to be deployed regardless of their group. The service group name corresponds to the `Name` attribute of a metadata `Tree` that is a subtree of the `SoftwareComponent`.
      `omrHost` - SAS Metadata Server host.
      `omrPort` - SAS Metadata Server port.
      `secSPN` - Single sign-on service principal name.
      `secPackageList` - Single sign-on security packages, e.g. "Kerberos,NTLM", (or `null` for default).
      `environment` - The environment encapsulates resources provided by the container or `null` if a container environment is not applicable.
    Throws:
      `ServiceException` - if unable to construct an instance.
    See Also:
      - `MdOMRConnection.makeOMRConnectionUsingSecurityPackage(String, String, String, String)`

  - ### OMRMetadataSource

    public OMRMetadataSource(com.sas.meta.SASOMI.IOMI omi, String repositoryNameOrID, String softwareComponentName, Set<String> serviceGroupNames, Environment environment) throws InitializationException
    Constructs an instance with the specified SAS Metadata Server host, port, identity and password, and `Set` of `String` elements representing the foundation service deployments that are to be deployed.

    Use this constructor if you want the `ServiceLoader` utility to obtain its own metadata connection to SAS Metadata Server.

    Use `OMRMetadataSource(String, String, String, String, String, String)` if deploying a single service deployment.

    This metadata source will use the connection provided by the OMI object.

    Parameters:
      `omi` - SAS Metadata Server OMI.
      `repositoryNameOrID` - Name or ID of the SAS Metadata Server repository that contains the service deployment.
      `softwareComponentName` - The name of the metadata `SoftwareComponent` that serves as the root of the service deployment hierarchy.
      `serviceGroupNames` - `Set` of `String` names designating the service groups that are to be deployed. Use this parameter if you want to deploy services that belong to specified groups, but not all groups (e.g. services in the "Core" and "Stored Process" groups, but not in any other groups). If a `null` or empty set is specified, then no filter will be applied. The service deployment name corresponds to the `Name` attribute of a metadata `Tree` that is a subtree of the `SoftwareComponent`.
      `environment` - The environment encapsulates resources provided by the container or `null` if a container environment is not applicable.
    Throws:
      `InitializationException` - if unable to construct an instance.

- ## Method Details

  - ### getRepositoryId

    public String getRepositoryId()
    Gets SAS Metadata Server repository ID.
    Returns:
      SAS Metadata Server repository ID or `null` if it is undefined.

  - ### getMetadata

    public String getMetadata() throws ServiceException
    Gets metadata representing a foundation services deployment queried from a SAS Metadata Repository.
    Specified by:
      `getMetadata` in interface `MetadataSourceInterface`
    Specified by:
      `getMetadata` in class `AbstractMetadataSource`
    Returns:
      Foundation services deployment metadata. The return value will be non-`null`.
    Throws:
      `ServiceException` - if unable to obtain metadata describing a foundation services deployment from a SAS Metadata Repository.
    See Also:
      - `MetadataSourceInterface.getMetadata()`

  - ### destroy

    public void destroy()
    Destroys the metadata source.

    If a connection was passed into this object, then it will be cleared from the metadata factory's connection.

    Specified by:
      `destroy` in interface `MetadataSourceInterface`
    Overrides:
      `destroy` in class `AbstractMetadataSource`

  - ### getDeployFailureMessage

    protected String getDeployFailureMessage()
    Gets a message describing this metadata source's inability to deploy services.
    Overrides:
      `getDeployFailureMessage` in class `AbstractMetadataSource`
    Returns:
      Message describing a failure to deploy services. The return value will be non-`null`.

  - ### toString

    public String toString()
    Gets a string representation of this SAS Metadata Server metadata source which includes its host and port.
    Overrides:
      `toString` in class `AbstractMetadataSource`
    Returns:
      String representation of this instance. The return value will be non-`null`.

  - ### hashCode

    public int hashCode()
    Gets a hash code for this service attribute. The hash is an XOR of all of this service's fields.
    Overrides:
      `hashCode` in class `AbstractMetadataSource`
    Returns:
      Hash code.

  - ### equals

    public boolean equals(Object other)
    Determines whether or not the other object equals this object.
    Overrides:
      `equals` in class `AbstractMetadataSource`
    Parameters:
      `other` - Other object.
    Returns:
      `true` if the objects are equivalent.