*** This class provides Binary Compatibility only, not Source Compatibility ***
Package com.sas.services
Class ServiceProfile
java.lang.Object
com.sas.services.ServiceProfile
- All Implemented Interfaces:
ExportServiceConfigInterface,MergeServiceConfigInterface
@SASScope("ALL")
@BinaryCompatibilityOnly
public class ServiceProfile
extends Object
implements ExportServiceConfigInterface, MergeServiceConfigInterface
Profile describing a foundation service's capabilities.
- Since:
- 9.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intService supports exporting its configuration to an XML file.static final intService supports installing a configuration which may be layered upon existing configuration(s).static final intService supports merging a configuration read from an XML file into its existing configuration. -
Constructor Summary
ConstructorsConstructorDescriptionServiceProfile(ServiceComponentConfigInterface serviceComponentConfiguration, int supportedActions, String[] dependentServiceInterfaces, String serviceInterfaceClass, String serviceImplementationClass, String configUserInterfaceClassName, boolean isSingletonService) Constructs a profile that describes a foundation service. -
Method Summary
Modifier and TypeMethodDescriptioncreateConfig(String configName, Document document) Creates a service configuration by parsing the specified XML document.final DocumentcreateDocument(com.sas.metadata.remote.ServiceComponent serviceComponent) Creates an XML document representation of the service's configuration.createServiceComponentConfig(String configName, Document document) Creates a service component configuration initialized using the text store associated with the specified XML.createServiceConfig(ServiceConfigDocument serviceConfigDocument) Creates a service component configuration initialized using the text store associated with the specified property.createServiceConfigForProperty(com.sas.metadata.remote.Property property) Creates a service component configuration initialized using the text store associated with the specified property.com.sas.metadata.remote.PropertycreateServiceConfigProperty(com.sas.metadata.remote.ServiceComponent serviceComponent, String configName, String configDesc, Document configDocument) Creates a new property for the specified service initializing it with a default configuration.com.sas.metadata.remote.PropertycreateServiceConfigProperty(com.sas.metadata.remote.ServiceComponent serviceComponent, String configName, String configDesc, Document configDocument, boolean isApplicationConfig) Creates a new property for the specified service initializing it with a default configuration.voidexportServiceConfig(File file, ServiceAggregateConfig serviceAggregateConfig, boolean isExportingBaseConfig, List<String> consumerNames) Exports the service configuration to a UTF-8 encoded XML file.StringgetBeanIdForService(com.sas.metadata.remote.CMetadata cMetadata) Gets the ID for the service that is to be represented as a bean.StringGets the fully-qualified class name of the user interface which provides a view for this configuration.protected StringGets the name of the service.getDefaultServiceConfig(String configName) Gets the default configuration for the service.StringGets the default filename for an XML file that contains this service's configuration.final String[]Gets an array of strings representing the Java interfaces of service(s) for the services required by this service.Gets the service component's configuration that governs the configuration metadata that may be used to initialize or re-configure the service component.static ServiceConfigDocumentgetServiceConfigDocument(com.sas.metadata.remote.Property property) Creates a value object that relates the name of a configuration to an XML document that represents a service configuration.Gets a utility which can be used to export a foundation service's configuration to a UTF-8 encoded XML file.Gets a utility which can be used to merge a foundation service's configuration read from UTF-8 encoded XML file into a preexisting configuration.StringGets a localized description of the service.StringGets a localized name for the service.StringGets the implementation class for the service created by this factory.StringThe fully-qualified Java class name of the primary interface implemented by a service created by this factory.booleanDetermines whether the service supports configuration data.booleanhasServiceConfig(com.sas.metadata.remote.ServiceComponent serviceComponent) Determines whether the service contains configuration data.booleanDetermines whether or not this service is deprecated.booleanDetermines whether or not this service is a singleton.voidmergeServiceConfig(File file, ServiceDeployment serviceDeployment, com.sas.metadata.remote.ServiceComponent serviceComponent, com.sas.metadata.remote.Property applicationConfigProperty) Merges the service configuration from a UTF-8 encoded XML file into a foundation service's configuration.final voidsetConfigUserInterfaceClassName(String configUserInterfaceClassName) Sets the fully-qualified class name of the user interface which provides a view for this configuration.voidsetDeprecated(boolean isDeprecated) Set whether or not this service is deprecated.final voidsetServiceComponentConfiguration(ServiceComponentConfigInterface serviceComponentConfiguration) Specifies the service component's configuration that governs the configuration metadata that may be used to initialize or re-configure the service component.final voidsetServiceImplementationClass(String serviceImplemenationClass) Sets the implementation class for the service created by this factory.final voidsetServiceInterfaceClass(String serviceInterface) Sets the implementation class for the service created by this factory.final booleansupportsAction(int desiredActions) Determines whether the service provides support for the specified action.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
ACTION_EXPORT
public static final int ACTION_EXPORTService supports exporting its configuration to an XML file.- See Also:
-
ACTION_MERGE
public static final int ACTION_MERGEService supports merging a configuration read from an XML file into its existing configuration.- See Also:
-
ACTION_INSTALL
public static final int ACTION_INSTALLService supports installing a configuration which may be layered upon existing configuration(s).- See Also:
-
-
Constructor Details
-
ServiceProfile
public ServiceProfile(ServiceComponentConfigInterface serviceComponentConfiguration, int supportedActions, String[] dependentServiceInterfaces, String serviceInterfaceClass, String serviceImplementationClass, String configUserInterfaceClassName, boolean isSingletonService) throws IllegalArgumentException Constructs a profile that describes a foundation service.- Parameters:
serviceComponentConfiguration- The service component's configuration.supportedActions- The actions that this service supports. Specify the logical OR of any of the following actions.dependentServiceInterfaces- The fully-qualified names of the Java interfaces that a service manufactured by this factory depends upon. Specifynullif there are no dependencies.serviceInterfaceClass- Fully-qualified name of the primary interface implemented by a service created by this factory.serviceImplementationClass- Fully-qualified name of the implementation class for the service created by this factory.configUserInterfaceClassName- Fully-qualified class name of the user interface which is used to view/edit this configuration. This class will extendcom.sas.console.plugins.services.AbstractBIPServiceInitDataView.isSingletonService-trueif the service is a singleton.- Throws:
IllegalArgumentException- if an invalid parameter value is specified.
-
-
Method Details
-
hasServiceConfig
public boolean hasServiceConfig()Determines whether the service supports configuration data.- Returns:
trueif the service supports configuration data.
-
hasServiceConfig
public boolean hasServiceConfig(com.sas.metadata.remote.ServiceComponent serviceComponent) throws com.sas.metadata.remote.MdException, RemoteException Determines whether the service contains configuration data. This can be indicated by an empty XML configuration data String or by that String containingmode="deprecated".- Parameters:
serviceComponent- of service in question- Returns:
trueif the service contains configuration data.- Throws:
com.sas.metadata.remote.MdExceptionRemoteException
-
getServiceInterfaceClass
public String getServiceInterfaceClass()The fully-qualified Java class name of the primary interface implemented by a service created by this factory.- Returns:
- The fully-qualified Java class name of the primary interface implemented by this service.
-
setServiceInterfaceClass
public final void setServiceInterfaceClass(String serviceInterface) Sets the implementation class for the service created by this factory.- Parameters:
serviceInterface- The fully-qualified Java class name of the primary interface implemented by a service created by this factory.
-
getServiceImplementationClass
public String getServiceImplementationClass()Gets the implementation class for the service created by this factory.- Returns:
- The fully-qualified Java name of implementation class for a service created by this factory.
-
setServiceImplementationClass
public final void setServiceImplementationClass(String serviceImplemenationClass) Sets the implementation class for the service created by this factory.- Parameters:
serviceImplemenationClass- The fully-qualified Java name of implementation class for a service created by this factory.
-
supportsAction
public final boolean supportsAction(int desiredActions) Determines whether the service provides support for the specified action.- Parameters:
desiredActions- Specify the logical OR of any of the following actions.- Returns:
trueif the service supports the specified capability.
-
getDependentServiceInterfaces
public final String[] getDependentServiceInterfaces()Gets an array of strings representing the Java interfaces of service(s) for the services required by this service.- Returns:
- Array of 0..* Java interfaces implemented by services that must be available at the time the service factory is asked to get a service. For example, if the User Service depends upon the Authentication Service, then the User Service would return "com.sas.services.security.AuthenticationServiceInterface". If there are no dependencies upon any other services then a zero length array will be returned.
-
setServiceComponentConfiguration
public final void setServiceComponentConfiguration(ServiceComponentConfigInterface serviceComponentConfiguration) Specifies the service component's configuration that governs the configuration metadata that may be used to initialize or re-configure the service component.- Parameters:
serviceComponentConfiguration- The service component's configuration ornullif the service is not configurable.
-
getServiceComponentConfiguration
Gets the service component's configuration that governs the configuration metadata that may be used to initialize or re-configure the service component.- Returns:
- The service component's configuration or
nullif the service is not configurable.
-
createServiceComponentConfig
public AbstractServiceComponentConfig createServiceComponentConfig(String configName, Document document) throws ServiceException Creates a service component configuration initialized using the text store associated with the specified XML.A subclass should override this method if it supports initialization of a service configuration using an XML document.
- Parameters:
configName- Service configuration's name. This corresponds to theNameattribute of the property that represents a service's configuration.document- XML representation of the service's configuration.- Returns:
- Service configuration or
nullif the service does not have a configuration. - Throws:
ServiceException- if unable to create a service configuration.
-
getServiceConfigDocument
public static ServiceConfigDocument getServiceConfigDocument(com.sas.metadata.remote.Property property) throws ServiceException Creates a value object that relates the name of a configuration to an XML document that represents a service configuration.- Parameters:
property- Configuration property which associated to a TextStore that contains an XML representation of the service's configuration.- Returns:
- Service configuration document.
- Throws:
ServiceException- if unable to determine a service configuration for the specified property.
-
createServiceConfigForProperty
public AbstractServiceComponentConfig createServiceConfigForProperty(com.sas.metadata.remote.Property property) throws ServiceException Creates a service component configuration initialized using the text store associated with the specified property.- Parameters:
property- Configuration property which associated to a TextStore that contains an XML representation of the service's configuration.- Returns:
- Service's configuration.
- Throws:
ServiceException- if unable to create a service configuration.- See Also:
-
createServiceConfig
public AbstractServiceComponentConfig createServiceConfig(ServiceConfigDocument serviceConfigDocument) throws ServiceException Creates a service component configuration initialized using the text store associated with the specified property.- Parameters:
serviceConfigDocument- Service configuration XML document.- Returns:
- Service's configuration.
- Throws:
ServiceException- if unable to create a service configuration.- See Also:
-
createServiceConfigProperty
public com.sas.metadata.remote.Property createServiceConfigProperty(com.sas.metadata.remote.ServiceComponent serviceComponent, String configName, String configDesc, Document configDocument, boolean isApplicationConfig) throws ServiceException Creates a new property for the specified service initializing it with a default configuration.- Parameters:
serviceComponent- The service for which a new configuration property is desired.configName- The name of the application configuration to be added to the service component.configDesc- An optional description for the application configuration.configDocument- An optional parameter which may be used to specify the XML document that represents the service configuration. If anulldocument is specified, then a default configuration will be used.isApplicationConfig-trueif the property represents a service configuration for an application.- Returns:
- Property associated with a TextStore that has been initialized with a default configuration.
- Throws:
ServiceException- if unable to create a configuration property.- See Also:
-
createServiceConfigProperty
public com.sas.metadata.remote.Property createServiceConfigProperty(com.sas.metadata.remote.ServiceComponent serviceComponent, String configName, String configDesc, Document configDocument) throws ServiceException Creates a new property for the specified service initializing it with a default configuration.- Parameters:
serviceComponent- The service for which a new configuration property is desired.configName- The name of the application configuration to be added to the service component.configDesc- An optional description for the application configuration.configDocument- An optional parameter which may be used to specify the XML document that represents the service configuration. If anulldocument is specified, then a default configuration will be used.- Returns:
- Property associated with a TextStore that has been initialized with a default configuration.
- Throws:
ServiceException- if unable to create a configuration property.- See Also:
-
getDefaultServiceConfig
public AbstractServiceComponentConfig getDefaultServiceConfig(String configName) throws ServiceException Gets the default configuration for the service.A sub-class must override this method if it has a default configuration for its service.
- Parameters:
configName- Service configuration's name.- Returns:
- Service's default configuration.
- Throws:
ServiceException- if unable to create a default configuration.
-
getDefaultServiceConfigFilename
public String getDefaultServiceConfigFilename()Gets the default filename for an XML file that contains this service's configuration. The filename will be formatted using the value obtained from thegetDefaultFilename()method which a subclass should override if it represents a service which is configurable.- Returns:
- Default name for a file that contains an XML representation of the service's configuration.
- See Also:
-
getDefaultFilename
protected String getDefaultFilename()Gets the name of the service. A subclass which represents a configurable service should override this method to specify the name of its service.- Returns:
- Service's name suitable for use in a filename.
- See Also:
-
createConfig
public AbstractServiceComponentConfig createConfig(String configName, Document document) throws ServiceException Creates a service configuration by parsing the specified XML document.- Parameters:
configName- Service configuration's name.document- XML document that represents a service's configuration.- Returns:
- Service configuration initialized from the XML document.
- Throws:
ServiceException- if unable to create a service configuration from the specified XML document.
-
createDocument
public final Document createDocument(com.sas.metadata.remote.ServiceComponent serviceComponent) throws ServiceException Creates an XML document representation of the service's configuration.- Parameters:
serviceComponent- Service whose configuration document is desired.- Returns:
- XML document or
nullif a configuration cannot be obtained. - Throws:
ServiceException- if an error occurred.
-
getConfigUserInterfaceClassName
public String getConfigUserInterfaceClassName()Gets the fully-qualified class name of the user interface which provides a view for this configuration.- Returns:
- Fully-qualified class name of the user interface which is
used to view/edit this configuration. This class will extend
com.sas.console.plugins.services.AbstractBIPServiceInitDataViewornullif a view class is not defined.
-
setConfigUserInterfaceClassName
public final void setConfigUserInterfaceClassName(String configUserInterfaceClassName) Sets the fully-qualified class name of the user interface which provides a view for this configuration.- Parameters:
configUserInterfaceClassName- Fully-qualified class name of the user interface which is used to view/edit this configuration. This class will extendcom.sas.console.plugins.services.AbstractBIPServiceInitDataView.
-
getServiceConfigExporter
Gets a utility which can be used to export a foundation service's configuration to a UTF-8 encoded XML file.- Returns:
- Service configuration exporter.
-
getServiceConfigMerger
Gets a utility which can be used to merge a foundation service's configuration read from UTF-8 encoded XML file into a preexisting configuration.- Returns:
- Service configuration exporter.
-
exportServiceConfig
public void exportServiceConfig(File file, ServiceAggregateConfig serviceAggregateConfig, boolean isExportingBaseConfig, List<String> consumerNames) throws ServiceException Exports the service configuration to a UTF-8 encoded XML file. A subclass should override this method if it requires custom logic to export its service configuration.- Specified by:
exportServiceConfigin interfaceExportServiceConfigInterface- Parameters:
file- The destination file to which a UTF-8 encoded representation of the service configuration will be written as XML.serviceAggregateConfig- The service configuration that is to be written.isExportingBaseConfig-trueif the servie's base configuration is being exported orfalseif it isn't.consumerNames- Collection ofStringelements representing the names of the service's layered application configurations which are being exported.- Throws:
ServiceException- if unable to export the service's configuration to a file.
-
mergeServiceConfig
public void mergeServiceConfig(File file, ServiceDeployment serviceDeployment, com.sas.metadata.remote.ServiceComponent serviceComponent, com.sas.metadata.remote.Property applicationConfigProperty) throws ServiceException Merges the service configuration from a UTF-8 encoded XML file into a foundation service's configuration.- Specified by:
mergeServiceConfigin interfaceMergeServiceConfigInterface- Parameters:
file- The destination file to which a UTF-8 encoded representation of the service configuration will be written as XML.serviceDeployment- Service deployment.serviceComponent- The service component whose configuration is to be updated.applicationConfigProperty- The service configuration property into which the configuration is to be merged.- Throws:
ServiceException- if unable to export the service's configuration to a file.
-
getServiceDisplayName
public String getServiceDisplayName()Gets a localized name for the service.A subclass should override this method to specify a non-default name.
- Returns:
- Localized name for the service.
-
getServiceDisplayDescription
public String getServiceDisplayDescription()Gets a localized description of the service.A subclass should override this method to specify a non-default name.
- Returns:
- Localized description of the service.
-
getBeanIdForService
public String getBeanIdForService(com.sas.metadata.remote.CMetadata cMetadata) throws com.sas.metadata.remote.MdException Gets the ID for the service that is to be represented as a bean.- Parameters:
cMetadata- Metadata representing a service.- Returns:
- Id of the bean that represents a service.
- Throws:
com.sas.metadata.remote.MdException- if unable to obtain the ID for the service.
-
isSingletonService
public boolean isSingletonService()Determines whether or not this service is a singleton.- Returns:
trueif the service is a singleton.
-
isDeprecated
public boolean isDeprecated()Determines whether or not this service is deprecated.- Returns:
trueif the service is deprecated.
-
setDeprecated
public void setDeprecated(boolean isDeprecated) Set whether or not this service is deprecated.- Parameters:
isDeprecated-trueif the service is deprecated.
-