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

com.sas.services.deployment
Class ServiceDeployment

com.sas.services.deployment.ServiceDeployment

public final class ServiceDeployment

Utilities to manipulate a foundation services deployment.

Since:
9.2
See Also:
ServiceDeploymentDeleter, ServiceDeploymentExporter, ServiceDeploymentImporter, ServiceConfigInstaller, ServiceConfigUninstaller, ServiceConsumerUtil, ServiceDeployments

Constructor Summary
ServiceDeployment(com.sas.metadata.remote.SoftwareComponent softwareComponent)
          Constructs a representation of a foundation services deployment.
ServiceDeployment(java.lang.String repositoryName, java.lang.String softwareComponentName, com.sas.metadata.remote.MdStore mdStore)
          Constructs a representation of a foundation services deployment.
 
Method Summary
 void exportServiceConfiguration(java.io.File file, com.sas.metadata.remote.ServiceComponent serviceComponent, boolean isExportingBaseConfig, java.util.List appConfigNames)
          Exports the specified configurations for a service to a UTF-8 encoded XML file.
 void exportServiceConfigurations(java.io.File exportDirectory)
          Exports each consumer's service configuration to a UTF-8 encoded XML file.
 void exportServiceConfigurations(java.io.File exportDirectory, java.io.File propertiesFile)
          Exports each consumer's service configuration to a UTF-8 encoded XML file.
 com.sas.metadata.remote.ServiceComponent getServiceComponent(java.lang.String serviceInterfaceClassName)
          Gets the metadata object which represents the foundation service that implements the specified interface.
 com.sas.metadata.remote.ServiceComponent getServiceComponent(java.lang.String serviceGroupName, java.lang.String serviceName)
          Gets the services which are defined in the deployment.
 java.util.Set getServiceComponents()
          Gets the services which are defined in the deployment.
static java.util.List getServiceConfigProperties(com.sas.metadata.remote.ServiceComponent serviceComponent)
          Gets the service component's property that represents the service's configuration data.
 com.sas.metadata.remote.Property installServiceConfig(java.lang.String configName, java.lang.String configDesc, java.io.File configFile, java.lang.String serviceInterfaceClassName)
          Adds an application configuration to the foundation service that implements the specified interface.
 com.sas.metadata.remote.Property installServiceConfiguration(ServiceProfile serviceProfile, com.sas.metadata.remote.ServiceComponent serviceComponent, AbstractServiceComponentConfig newConfig, MergePolicy mergePolicy)
          Merges a configuration into the service's specified configuration.
 com.sas.metadata.remote.Property installServiceConfiguration(java.lang.String configName, java.lang.String configDesc, java.io.File configFile, com.sas.metadata.remote.ServiceComponent serviceComponent)
          Adds an application configuration to the foundation service that represented by the specified metadata service component.
 boolean installServiceConfiguration(java.lang.String configName, java.lang.String configDesc, java.io.File configFile, java.lang.String serviceInterfaceClassName)
          Adds an application configuration to the foundation service that implements the specified interface.
 com.sas.metadata.remote.Property installServiceConfigurationUsingPolicy(java.lang.String configName, java.io.File configFile, com.sas.metadata.remote.ServiceComponent serviceComponent, MergePolicy mergePolicy)
          Adds an application configuration to the foundation service that represented by the specified metadata service component.
 boolean isAccessibleToRemoteClients()
          Determines whether the services deployment contains at least one service which is configured to be accessed by a client in a remote JVM.
 boolean isConfigInstalled(java.lang.String configName, com.sas.metadata.remote.ServiceComponent serviceComponent)
          Determines whether or not the service has a configuration for the specified name.
 boolean isConfigInstalled(java.lang.String configName, java.lang.String serviceInterfaceClassName)
          Determines whether or not the deployment contains a service that implements the specified interface has a configuration for the specified name.
 void mergeServiceConfiguration(java.io.File configFile, com.sas.metadata.remote.ServiceComponent serviceComponent, com.sas.metadata.remote.Property property)
          Merges a configuration into the service's specified configuration.
 java.util.Set<com.sas.metadata.remote.ServiceComponent> renameConsumer(java.lang.String oldConsumerName, java.lang.String newConsumerName)
          Renames the service configuration consumer.
 void uninstallServiceConfiguration(AbstractServiceComponentConfig serviceConfig, java.lang.String configName, java.lang.String serviceInterfaceClassName, boolean isRemoveUnusedResources)
          Deletes the specified application configuration from the foundation service that implements the specified interface.
 void uninstallServiceConfiguration(com.sas.metadata.remote.ServiceComponent serviceComponent, AbstractServiceComponentConfig serviceConfig, java.lang.String configName)
          Deletes the specified application configuration from the foundation service that implements the specified interface.
 void uninstallServiceConfiguration(com.sas.metadata.remote.ServiceComponent serviceComponent, AbstractServiceComponentConfig serviceConfig, java.lang.String consumerName, boolean isRemoveUnusedResources)
          Deletes the specified application configuration from the foundation service that implements the specified interface.
 
Methods inherited from class com.sas.services.deployment.AbstractServiceDeployment
getSearchOptions, getServiceFactory, getSoftwareComponentName, getXMLSelectProperty
 

Constructor Detail

ServiceDeployment

public ServiceDeployment(com.sas.metadata.remote.SoftwareComponent softwareComponent)
                  throws ServiceException,
                         java.rmi.RemoteException
Constructs a representation of a foundation services deployment.

Parameters:
softwareComponent - SoftwareComponent which represents a foundation services deployment.
Throws:
ServiceException - if unable to query the service deployment metadata.
java.rmi.RemoteException - if a remote object failure occurs.
Since:
9.2

ServiceDeployment

public ServiceDeployment(java.lang.String repositoryName,
                         java.lang.String softwareComponentName,
                         com.sas.metadata.remote.MdStore mdStore)
                  throws ServiceException
Constructs a representation of a foundation services deployment.

Parameters:
repositoryName - Name of the metadata repository which contains the foundation services deployment.
softwareComponentName - Name of the SoftwareComponent which represents a foundation services deployment.
mdStore - Metadata store.
Throws:
ServiceException - if unable to query the service deployment metadata.
Since:
9.2
Method Detail

getServiceComponents

public java.util.Set getServiceComponents()
Gets the services which are defined in the deployment.

Returns:
Collection of ServiceComponent metadata objects representing the services which are defined in the deployment. An empty collection will be returned if no services are defined. The collection will be non-null.
Since:
9.2

getServiceComponent

public com.sas.metadata.remote.ServiceComponent getServiceComponent(java.lang.String serviceGroupName,
                                                                    java.lang.String serviceName)
                                                             throws ServiceException
Gets the services which are defined in the deployment.

Parameters:
serviceGroupName - Name of the group (Tree.Name) that contains the desired service.
serviceName - Name of the desired service (ServiceComponent.Name) which is a member of the specified group in this services deployment.
Returns:
ServiceComponent metadata object representing the service for the specified service and group name or null if the specified service is not defined.
Throws:
ServiceException - if an error is encountered.
Since:
9.2

isAccessibleToRemoteClients

public boolean isAccessibleToRemoteClients()
                                    throws ServiceException
Determines whether the services deployment contains at least one service which is configured to be accessed by a client in a remote JVM.

Returns:
true if the services deployment contains at least one service which is intended to be accessed by a client in a remote JVM.
Throws:
ServiceException - if unable to determine if the services deployment contains services which are accessible by remote clients.
Since:
9.1.3

getServiceComponent

public com.sas.metadata.remote.ServiceComponent getServiceComponent(java.lang.String serviceInterfaceClassName)
                                                             throws ServiceException
Gets the metadata object which represents the foundation service that implements the specified interface.

Parameters:
serviceInterfaceClassName - The primary interface implemented by a foundation service.
Service Primary Service Interface
Authentication com.sas.services.security.AuthenticationServiceInterface
Discovery com.sas.services.discovery.DiscoveryServiceInterface
Event Broker com.sas.services.events.broker.EventBrokerServiceInterface
Information com.sas.services.information.InformationServiceInterface
Session com.sas.services.session.SessionServiceInterface
Stored Process com.sas.services.storedprocess.StoredProcessServiceInterface
User com.sas.services.user.UserServiceInterface
Returns:
The metadata object which represents the foundation service that implements the specified interface or null if the deployment does not contain a service that implements the specified interface.
Throws:
ServiceException - if unable to determine if the service deployment contains a service that implements the specified service interface.
Since:
9.1.3

exportServiceConfiguration

public void exportServiceConfiguration(java.io.File file,
                                       com.sas.metadata.remote.ServiceComponent serviceComponent,
                                       boolean isExportingBaseConfig,
                                       java.util.List appConfigNames)
                                throws ServiceException
Exports the specified configurations for a service to a UTF-8 encoded XML file.

Parameters:
file - Destination file to which an aggregation of the specified service configurations will be written as a UTF-8 encoded file.
serviceComponent - The service component whose specified configuration(s) are to be exported to a service configuration file.
isExportingBaseConfig - true if the base service configuration should be exported. Specify false you only want to export a particular application configuration.
appConfigNames - A list of 0..* application configuration names. Each list element must be of type String representing the name of an application configuration which should be exported. Only specify one name if exporting a configuration for one application and do not include the base configuration.
Throws:
ServiceException - if unable to export the service's configuration.
Since:
9.2

installServiceConfiguration

public com.sas.metadata.remote.Property installServiceConfiguration(java.lang.String configName,
                                                                    java.lang.String configDesc,
                                                                    java.io.File configFile,
                                                                    com.sas.metadata.remote.ServiceComponent serviceComponent)
                                                             throws ServiceException
Adds an application configuration to the foundation service that represented by the specified metadata service component.

Use this method if you know the service component whose configuration is to be updated. One must use this method if the services deployment contains more than one service that implements the service interface to designate the appropriate service.

Parameters:
configName - The name of the application which consumes the configuration that is being installed (e.g. "Information Delivery Portal").
configDesc - The description parameter is not used.
configFile - The file that contains a foundation services configuration which is to be added to the service definition.
serviceComponent - The service component.
Returns:
Property representing the installed service configuration or null if the configuration was not installed.
Throws:
ServiceException - if unable to install the specified service configuration.
Since:
9.2
See Also:
installServiceConfig(String, String, File, String)

installServiceConfigurationUsingPolicy

public com.sas.metadata.remote.Property installServiceConfigurationUsingPolicy(java.lang.String configName,
                                                                               java.io.File configFile,
                                                                               com.sas.metadata.remote.ServiceComponent serviceComponent,
                                                                               MergePolicy mergePolicy)
                                                                        throws ServiceException
Adds an application configuration to the foundation service that represented by the specified metadata service component.

Use this method if you know the service component whose configuration is to be updated. One must use this method if the services deployment contains more than one service that implements the service interface to designate the appropriate service.

Parameters:
configName - The name of the application which consumes the configuration that is being installed (e.g. "Information Delivery Portal").
configFile - The file that contains a foundation services configuration which is to be added to the service definition.
serviceComponent - The service component.
mergePolicy - Policy which specifies how conflicts are handled when installing a configuration.
Returns:
Property representing the installed service configuration or null if the configuration was not installed.
Throws:
ServiceException - if unable to install the specified service configuration.
Since:
9.2
See Also:
installServiceConfig(String, String, File, String)

installServiceConfiguration

public boolean installServiceConfiguration(java.lang.String configName,
                                           java.lang.String configDesc,
                                           java.io.File configFile,
                                           java.lang.String serviceInterfaceClassName)
                                    throws ServiceException
Adds an application configuration to the foundation service that implements the specified interface.

Specified by:
installServiceConfiguration in class AbstractServiceDeployment
Parameters:
configName - The unique name for the application configuration (e.g. "Information Delivery Portal").
configDesc - An optional description for the application configuration.
configFile - The file that contains a foundation services configuration which is to be added to the service definition.
serviceInterfaceClassName - The fully-qualified Java class name for the primary interface implemented by the service whose configuration is to be updated (e.g. "com.sas.services.user.UserServiceInterface").
Returns:
true if the service configuration was installed.
Throws:
ServiceException - if unable to install the configuration into the service.
Since:
9.2

installServiceConfig

public com.sas.metadata.remote.Property installServiceConfig(java.lang.String configName,
                                                             java.lang.String configDesc,
                                                             java.io.File configFile,
                                                             java.lang.String serviceInterfaceClassName)
                                                      throws ServiceException
Adds an application configuration to the foundation service that implements the specified interface.

Parameters:
configName - The unique name for the application configuration (e.g. "Information Delivery Portal").
configDesc - An optional description for the application configuration.
configFile - The file that contains a foundation services configuration which is to be added to the service definition.
serviceInterfaceClassName - The fully-qualified Java class name for the primary interface implemented by the service whose configuration is to be updated (e.g. "com.sas.services.user.UserServiceInterface").
Returns:
Service configuration property or null.
Throws:
ServiceException - if unable to install the specified service configuration.
Since:
9.2

isConfigInstalled

public boolean isConfigInstalled(java.lang.String configName,
                                 java.lang.String serviceInterfaceClassName)
                          throws ServiceException
Determines whether or not the deployment contains a service that implements the specified interface has a configuration for the specified name.

Parameters:
configName - Name of a layered service configuration.
serviceInterfaceClassName - The fully-qualified name of the service's primary interface.
Returns:
true if the named service configuration is installed.
Throws:
ServiceException - if unable to determine if the service has the specified named configuration.
Since:
9.2

isConfigInstalled

public boolean isConfigInstalled(java.lang.String configName,
                                 com.sas.metadata.remote.ServiceComponent serviceComponent)
                          throws ServiceException
Determines whether or not the service has a configuration for the specified name.

Parameters:
configName - Name of the desired configuration.
serviceComponent - The service component to check for the specified configuration.
Returns:
true if the named service configuration is installed.
Throws:
ServiceException - if unable to determine if the service has the specified configuration.
Since:
9.2

mergeServiceConfiguration

public void mergeServiceConfiguration(java.io.File configFile,
                                      com.sas.metadata.remote.ServiceComponent serviceComponent,
                                      com.sas.metadata.remote.Property property)
                               throws ServiceException
Merges a configuration into the service's specified configuration.

Parameters:
configFile - The file that contains a foundation services configuration which is to be added to the service definition.
serviceComponent - The service component.
property - The property representing the service configuration into which the configuration to be read from the file is to be merged.
Throws:
ServiceException - if unable to merge the specified service configuration.
Since:
9.1.3

installServiceConfiguration

public com.sas.metadata.remote.Property installServiceConfiguration(ServiceProfile serviceProfile,
                                                                    com.sas.metadata.remote.ServiceComponent serviceComponent,
                                                                    AbstractServiceComponentConfig newConfig,
                                                                    MergePolicy mergePolicy)
                                                             throws ServiceException
Merges a configuration into the service's specified configuration.

Parameters:
serviceProfile - Service's profile.
serviceComponent - The service component.
newConfig - The service configuration which is to be installed into the service's configuration property.
mergePolicy - Policy which specifies how conflicts are handled when installing a configuration.
Returns:
The Property whose TextStore was updated or null.
Throws:
ServiceException - if unable to merge the specified service configuration.
java.lang.IllegalArgumentException - if an invalid parameter is specified.
Since:
9.2

renameConsumer

public java.util.Set<com.sas.metadata.remote.ServiceComponent> renameConsumer(java.lang.String oldConsumerName,
                                                                              java.lang.String newConsumerName)
                                                                       throws ServiceException
Renames the service configuration consumer.

Parameters:
oldConsumerName - The name of the service configuration consumer which is to be renamed.
newConsumerName - The new name of the service configuration consumer.
Returns:
The SAS Foundation Services which contained a Consumer which was renamed.
Throws:
ServiceException - if unable to rename the service configuration consumer.
Since:
9.2M3

getServiceConfigProperties

public static java.util.List getServiceConfigProperties(com.sas.metadata.remote.ServiceComponent serviceComponent)
                                                 throws ServiceException
Gets the service component's property that represents the service's configuration data.

Parameters:
serviceComponent - Service component whose configuration properties are desired.
Returns:
List of of Property objects representing the service component's service's configuration or an empty list if undefined. The first property in the list corresponds to the service's configuration. Additional properties, if defined, correspond to v913 layered service configurations.
Throws:
ServiceException - if unable to query the service component's properties.

uninstallServiceConfiguration

public void uninstallServiceConfiguration(AbstractServiceComponentConfig serviceConfig,
                                          java.lang.String configName,
                                          java.lang.String serviceInterfaceClassName,
                                          boolean isRemoveUnusedResources)
                                   throws ServiceException
Deletes the specified application configuration from the foundation service that implements the specified interface.

Parameters:
serviceConfig - The service configuration from which the application's configuration should be uninstalled.
configName - The name of the application configuration that is to be deleted (e.g. "Information Delivery Portal").
serviceInterfaceClassName - The fully-qualified Java class name for the primary interface implemented by the service whose configuration is to be updated (e.g. "com.sas.services.user.UserServiceInterface").
isRemoveUnusedResources - true service configuration resources should be removed if they are no longer used by any consumers.
Throws:
ServiceException - if unable to uninstall the specified service configuration.
Since:
9.2

uninstallServiceConfiguration

public void uninstallServiceConfiguration(com.sas.metadata.remote.ServiceComponent serviceComponent,
                                          AbstractServiceComponentConfig serviceConfig,
                                          java.lang.String configName)
                                   throws ServiceException
Deletes the specified application configuration from the foundation service that implements the specified interface.

Use uninstallServiceConfiguration(ServiceComponent, AbstractServiceComponentConfig, String, boolean) if you would like to remove service configuration resources if they are no longer used by any consumers.

Parameters:
serviceComponent - The metadata object that represents the SAS Foundation Service from which a layered service configuration is to be uninstalled.
configName - The name of the application configuration that is to be deleted (e.g. "Information Delivery Portal").
Throws:
ServiceException - if unable to uninstall the specified service configuration.
Since:
9.2
See Also:
#uninstallServiceConfiguration(ServiceComponent, String, boolean)

uninstallServiceConfiguration

public void uninstallServiceConfiguration(com.sas.metadata.remote.ServiceComponent serviceComponent,
                                          AbstractServiceComponentConfig serviceConfig,
                                          java.lang.String consumerName,
                                          boolean isRemoveUnusedResources)
                                   throws ServiceException
Deletes the specified application configuration from the foundation service that implements the specified interface.

The caller is responsible for persisting the updates to the metadata server.

Parameters:
serviceComponent - The metadata object that represents the SAS Foundation Service from which a layered service configuration is to be uninstalled.
consumerName - The name of the consumer whose configuration is to be removed (e.g. "Information Delivery Portal").
isRemoveUnusedResources - true service configuration resources should be removed if they are no longer used by any consumers.
Throws:
ServiceException - if unable to uninstall the specified service configuration.
Since:
9.2

exportServiceConfigurations

public void exportServiceConfigurations(java.io.File exportDirectory)
                                 throws java.lang.IllegalArgumentException,
                                        ServiceException,
                                        java.rmi.RemoteException,
                                        com.sas.metadata.remote.MdException
Exports each consumer's service configuration to a UTF-8 encoded XML file.

Throws:
ServiceException
java.lang.IllegalArgumentException
com.sas.metadata.remote.MdException
java.rmi.RemoteException

exportServiceConfigurations

public void exportServiceConfigurations(java.io.File exportDirectory,
                                        java.io.File propertiesFile)
                                 throws java.lang.IllegalArgumentException,
                                        ServiceException,
                                        java.rmi.RemoteException,
                                        com.sas.metadata.remote.MdException
Exports each consumer's service configuration to a UTF-8 encoded XML file.

Throws:
ServiceException
java.lang.IllegalArgumentException
com.sas.metadata.remote.MdException
java.rmi.RemoteException

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




Copyright © 2009 SAS Institute Inc. All Rights Reserved.