|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.services.AbstractServiceComponentConfig
public abstract class AbstractServiceComponentConfig
Abstract implementation of a foundation service component's configuration.
A concrete subclass must implement the following abstract methods:
getServiceFactoryClassName()
to return the fully-qualified
name of the service factory's classgetConfig(Document document)
to obtain a
service configuration from the specified XML document.appendDOM(Document document, AbstractServiceComponentConfig serviceConfig)
to create an XML representation of the service configuration.mergeConfig(ServiceComponent serviceComponent, Document document)
to provide an implementation that can update the service component's configuration
by merging configuration data that is additive in nature (i.e. 0..* associations)mergeConfiguration(AbstractServiceComponentConfig currentConfig, AbstractServiceComponentConfig newConfig)
validateServiceConfigurationCustom(Document document)
to determine whether the specified service configuration is valid
Field Summary | |
---|---|
static java.lang.String |
ENCODING
Service configurations are encoded using UTF-8. |
static java.lang.String |
LOOKUPKEY_PROPERTYNAME_VIEWCLASS
The name of a property used to denote the UI view class to be used to render the service's configuration data. |
static java.lang.String |
PROPERTY_NAME_INIT_DATA
The PropertyName of a Property used to represent the service's configuration. |
static java.lang.String |
PROPERTY_NAME_INITIALIZATIONDATA
The PropertyName of a Property used to represent a service's configuration. |
static java.lang.String |
PROPERTYROLE_APPCONFIG
Constant "Application Configuration" which is used in a service configuration's Property's PropertyRole to indicate that the v913 application configuration has been merged into the service's configuration. |
static java.lang.String |
PROPERTYROLE_INITIALIZATION
Value of a metadata StoredText 's Role
attribute that designates that the text string is used for
initialization purposes. |
static java.lang.String |
XML_ELEMENT_ATTRIBUTE_VERSION
XML attribute name designating the version of the configuration. |
Constructor Summary | |
---|---|
protected |
AbstractServiceComponentConfig(java.io.InputStream configInputStream,
boolean isServiceConfigurationUpdateable)
Constructs an instance by reading the service configuration from the specified input stream. |
protected |
AbstractServiceComponentConfig(java.lang.String xmlDocument)
Constructs a default instance. |
protected |
AbstractServiceComponentConfig(java.lang.String xmlDocument,
boolean isServiceConfigurationUpdateable)
Constructs an instance specifying whether a service manufactured by this factory has a configuration which may be updated in an additive manner. |
Method Summary | |||
---|---|---|---|
Consumer |
addConsumer(Consumer consumer,
boolean isConsumer)
Adds the consumer to the usage model specifying its use of defined service configuration resources. |
||
protected void |
addResource(ConsumedResourceInterface consumedResource)
Adds a resource which can be used by consumers. |
||
protected void |
addResourceAdapter(ConsumedResourceAdapter consumedResource)
Adds a resource which can be used by consumers. |
||
protected abstract org.w3c.dom.DocumentFragment |
appendDOM(org.w3c.dom.Document document)
Update the XML document by appending fragments to represent the service's configuration. |
||
protected abstract org.w3c.dom.DocumentFragment |
appendDOM(org.w3c.dom.Document document,
AbstractServiceComponentConfig serviceConfig)
Constructs a document object model representing the configuration data for a foundation service. |
||
java.lang.Object |
clone()
Clones this configuration. |
||
static java.lang.String |
convertDocumentToString(org.w3c.dom.Document document)
Creates a configuration for the specified service component. |
||
protected AbstractServiceComponentConfig |
createConfiguration(org.w3c.dom.Document document)
Creates a service configuration initialized with the specified XML document. |
||
org.w3c.dom.Document |
createDocument(com.sas.metadata.remote.ServiceComponent serviceComponent)
Creates a configuration for the specified service component. |
||
static java.lang.String |
getBaseConfigName()
Gets the localized name for the service's base configuration. |
||
protected abstract AbstractServiceComponentConfig |
getConfig(org.w3c.dom.Document serviceConfigDocument)
Gets an object representing the service's configuration data obtained from the specified XML document. |
||
java.lang.String |
getConfigName()
Gets the name of the configuration. |
||
static java.lang.String |
getConfigName(com.sas.metadata.remote.Property property)
Gets the name of the configuration from the Name attribute
of the configuration property. |
||
java.lang.String |
getConfirmDeleteUnusedResourceMsg(ConsumedResourceInterface consumedResource)
Gets a localized message which can be used in a confirmation dialog that is presented to notify the user the specified unused resource will be deleted. |
||
java.lang.String |
getConfirmDeleteUnusedResourcesMsg()
Gets a localized message which can be used in a confirmation dialog that is presented to notify the user that unused resources will be deleted. |
||
ConsumedResourceAdapter |
getConsumedResourceAdapter(java.lang.String resourceID)
Gets a consumed resource adapter for the specified resource ID. |
||
protected java.util.Set |
getConsumersForResource(java.lang.String resourceID)
Gets the set of consumer |
com.sas.services.deployment.ConsumerUsage |
getConsumerUsage()
Gets the data describing this configuration's consumers and which resources they consume. |
MergePolicy |
getDefaultMergePolicy()
Gets the default policy used to merge service configurations. |
||
org.w3c.dom.Document |
getDocument()
Creates an XML document representation of foundation service component's configuration that provides the document Element. |
||
static java.util.Properties |
getOutputFormatProperties()
Gets |
protected int |
getPrimeNumber()
Gets a prime number that can be used to compute a hash code. |
java.util.Set |
getResourcesWhichUseResource(java.util.Set consumedResources)
Gets the set of resources which use the specified resource. |
||
protected java.lang.String[] |
getServiceClassIdentifiers()
Gets an the service's class identifiers that are valid for this configuration. |
||
static com.sas.metadata.remote.TextStore |
getServiceComponentConfigTextStore(com.sas.metadata.remote.ServiceComponent serviceComponent)
Gets the service component's configuration. |
||
java.lang.String |
getServiceComponentConfiguration(com.sas.metadata.remote.ServiceComponent serviceComponent)
Gets the service component's configuration. |
||
static java.lang.String |
getServiceComponentConfigurationFromTextStore(com.sas.metadata.remote.ServiceComponent serviceComponent)
Gets the service component's configuration from the service's text store. |
||
static com.sas.metadata.remote.Property |
getServiceConfigProperty(com.sas.metadata.remote.ServiceComponent serviceComponent)
Gets the service component's property that represents the service's configuration data. |
||
protected abstract java.lang.String |
getServiceFactoryClassName()
Gets the service factory's fully-qualified Java class name. |
||
protected static org.w3c.dom.Document |
getTextStoreServiceConfig(com.sas.metadata.remote.ServiceComponent serviceComponent)
Gets an XML document representation of the service's configuration. |
||
java.util.Set |
getUnusedResources(java.util.Set removedConsumerNames)
Gets the set of ConsumedResourceInterface objects representing the
resources which will be unused if the specified consumers are removed. |
||
com.sas.util.UsageVersion |
getUsageVersion()
Gets the usage version. |
||
com.sas.util.UsageVersion |
getUsageVersionCurrent()
Gets the current usage version supported by this configuration. |
||
com.sas.util.UsageVersion |
getUsageVersionOldest()
Gets the oldest usage version supported by this configuration. |
||
static boolean |
isBaseConfig(com.sas.metadata.remote.Property property)
Determines if the specified property represents a service's base configuration. |
||
static boolean |
isBaseConfiguration(com.sas.metadata.remote.Property property)
Determines if the specified property represents a service's base configuration. |
||
boolean |
isConfigurationUpdateable()
Determines whether a foundation services configuration may be updated in an additive manner. |
||
protected boolean |
isOKToRemoveResource(java.lang.String resourceID)
Determines if the resource is used by any consumers. |
||
void |
mergeConfig(com.sas.metadata.remote.ServiceComponent serviceComponent,
org.w3c.dom.Document serviceConfiguration)
Merges the service's configuration by adding new service configuration to the preexisting configuration. |
||
void |
mergeConfigFromDocument(com.sas.metadata.remote.ServiceComponent serviceComponent,
org.w3c.dom.Document serviceConfiguration)
Merges the service's configuration by adding new service configuration to the preexisting configuration. |
||
void |
mergeConfigFromFile(com.sas.metadata.remote.ServiceComponent serviceComponent,
java.io.File file)
Updates the service's configuration by adding new service configuration read from the specified file to the service component's preexisting configuration. |
||
void |
mergeConfiguration(AbstractServiceComponentConfig newConfig)
Merges the configuration into this configuration. |
||
protected abstract void |
mergeConfiguration(AbstractServiceComponentConfig currentConfig,
AbstractServiceComponentConfig newConfig)
Merges the new user service configuration into the current configuration. |
||
protected abstract void |
mergeConfiguration(AbstractServiceComponentConfig currentConfig,
AbstractServiceComponentConfig newConfig,
MergePolicy mergePolicy)
Merges the new user service configuration into the current configuration. |
||
void |
mergeConfiguration(AbstractServiceComponentConfig newConfig,
MergePolicy mergePolicy)
Merges the configuration into this configuration. |
||
void |
parseConsumerUsage(org.w3c.dom.Element element)
Parses the "ConsumerUsage" element. |
||
org.w3c.dom.Document |
readServiceConfigFromFile(java.io.File file)
Read the service's configuration from the specified file. |
||
protected ConsumedResourceInterface |
removeConsumedResource(java.lang.String resourceID)
Removes the resource from the consumer usage model. |
||
Consumer |
removeConsumer(Consumer consumer,
boolean isRemoveResourceIfUnused)
Removes the consumer from the usage model. |
||
void |
removeConsumer(com.sas.metadata.remote.ServiceComponent serviceComponent)
Removes the consumer from the usage model. |
||
ConsumedResourceInterface |
removeResource(java.lang.String resourceID,
java.util.Set removedConsumedResourceSet)
Removes the resource which can be used by consumers. |
||
protected ConsumedResourceInterface |
removeResourceAdapter(ConsumedResourceAdapter consumedResource,
java.util.Set removedConsumedResources)
Adds a resource which can be used by consumers. |
||
void |
setConfig(com.sas.metadata.remote.Property property)
Sets the configuration using the property's stored text configuration which contains an XML document. |
||
void |
setConfigName(com.sas.metadata.remote.Property property)
Sets the name of the service configuration. |
||
void |
setConfigName(java.lang.String configName)
Sets the name of the configuration. |
||
void |
setConsumerUsage(com.sas.services.deployment.ConsumerUsage consumerUsage)
Sets the data describing this configuration's consumers and which resources they consume. |
||
void |
setIsConsumer(Consumer consumer,
boolean isConsumer)
Specifies that the consumer uses all of the the service configuration's resources. |
||
protected static void |
setTextStoreServiceConfig(com.sas.metadata.remote.ServiceComponent serviceComponent,
org.w3c.dom.Document serviceConfigDocument)
Updates the service component's configuration text store with the specified service configuration. |
||
void |
setUsageVersion(com.sas.util.UsageVersion usageVersion)
Sets the version. |
||
protected void |
setUsageVersionCompatibility(com.sas.util.UsageVersion usageVersionOldest,
com.sas.util.UsageVersion usageVersionCurrent)
Sets the oldest version. |
||
org.w3c.dom.Document |
toDocument()
Creates an XML document representation of this service configuration. |
||
java.lang.String |
toXMLString()
Creates an XML string representation of this service's configuration. |
||
protected void |
validateServiceComponent(com.sas.metadata.remote.ServiceComponent serviceComponent)
Determines whether the service component is valid. |
||
protected void |
validateServiceConfiguration(org.w3c.dom.Document document)
Determines whether the service configuration is valid for this service component. |
||
protected abstract void |
validateServiceConfigurationCustom(org.w3c.dom.Document document)
Determines whether the service configuration is valid for this service component. |
||
void |
writeServiceConfigToFile(java.io.File file)
Write this service's configuration to the specified file. |
||
void |
writeServiceConfigToFile(java.io.File file,
com.sas.metadata.remote.ServiceComponent serviceComponent)
Write the service's configuration to the specified file. |
Field Detail |
---|
public static final java.lang.String ENCODING
public static final java.lang.String PROPERTY_NAME_INIT_DATA
public static final java.lang.String PROPERTY_NAME_INITIALIZATIONDATA
public static final java.lang.String PROPERTYROLE_APPCONFIG
public static final java.lang.String LOOKUPKEY_PROPERTYNAME_VIEWCLASS
public static final java.lang.String PROPERTYROLE_INITIALIZATION
StoredText
's Role
attribute that designates that the text string is used for
initialization purposes. This value is "initialization"
public static final java.lang.String XML_ELEMENT_ATTRIBUTE_VERSION
Constructor Detail |
---|
protected AbstractServiceComponentConfig(java.io.InputStream configInputStream, boolean isServiceConfigurationUpdateable) throws java.lang.IllegalArgumentException
Use AbstractServiceComponentConfig(String xmlDocument, boolean isServiceConfigurationUpdateable)
to construct an instance specifying whether the
service's configuration may be updated in an additive manner.
configInputStream
- An input stream to a UTF-8 encoded XML document used to represent the
service component's configuration.isServiceConfigurationUpdateable
- true
if the foundation service's configuration
may be updated by appending new configuration data which does not
conflict with another configuration.
java.lang.IllegalArgumentException
- if a null
XML document
string is specified.protected AbstractServiceComponentConfig(java.lang.String xmlDocument)
Use this constructor if the service manufactured by the service factory does not permit is configuration to be updated in an additive manner.
Use AbstractServiceComponentConfig(String xmlDocument, boolean isServiceConfigurationUpdateable)
to construct an instance specifying whether the
service's configuration may be updated in an additive manner.
xmlDocument
- The XML document used to represent the service component's configuration.
java.lang.IllegalArgumentException
- if a null
XML document
string is specified.protected AbstractServiceComponentConfig(java.lang.String xmlDocument, boolean isServiceConfigurationUpdateable)
Use AbstractServiceComponentConfig(String xmlDocument)
to construct an instance of a factory which manufactures
a service whose configuration may not be updated in an additive manner.
xmlDocument
- The XML document used to represent the service component's configuration.isServiceConfigurationUpdateable
- true
if the foundation service's configuration
may be updated by appending new configuration data which does not
conflict with the another configuration.
java.lang.IllegalArgumentException
- if a null
XML document
string is specified.Method Detail |
---|
public java.lang.String getConfigName()
getConfigName
in interface ServiceComponentConfigInterface
public final void setConfigName(java.lang.String configName)
setConfigName
in interface ServiceComponentConfigInterface
configName
- The name of this configuration.public static java.lang.String getConfigName(com.sas.metadata.remote.Property property) throws ServiceException
Name
attribute
of the configuration property.
property
- Configuration property.
ServiceException
- if a metadata exception occurs.public void setConfigName(com.sas.metadata.remote.Property property) throws ServiceException
property
- Service configuration property.
ServiceException
- if unable to determine if the property represents
the service's base configuration.public static final java.lang.String getBaseConfigName()
public static boolean isBaseConfig(com.sas.metadata.remote.Property property) throws ServiceException
property
- Configuration property.
true
if the property represents the base service configuration
or false
if it represents a layered application configuration.
ServiceException
- if unable to determine if the property represents the
base configuration for a service.public static boolean isBaseConfiguration(com.sas.metadata.remote.Property property) throws ServiceException
property
- Configuration property.
true
if the property represents the base service configuration
or false
if it represents a layered application configuration.
ServiceException
- if unable to determine if the property represents the
base configuration for a service.public void setConfig(com.sas.metadata.remote.Property property) throws ServiceException
property
- Service configuration property.
ServiceException
- if unable to set the configuration.protected AbstractServiceComponentConfig createConfiguration(org.w3c.dom.Document document) throws ServiceException
document
- XML describing the service's configuration.
null
if a configuration is not defined.
ServiceException
- if unable to create a configuration.public static final com.sas.metadata.remote.Property getServiceConfigProperty(com.sas.metadata.remote.ServiceComponent serviceComponent) throws ServiceException
serviceComponent
- Service component whose configuration data property is desired.
null
if a property is not defined.
ServiceException
- if unable to query the service component's properties.public final boolean isConfigurationUpdateable()
isConfigurationUpdateable
in interface ServiceComponentConfigInterface
true
if the foundation service's configuration
may be updated by appending new configuration data which does not
conflict with the preexisting configuration.protected final void validateServiceComponent(com.sas.metadata.remote.ServiceComponent serviceComponent) throws ServiceConfigurationException, java.lang.IllegalArgumentException
serviceComponent
- The service component whose configuration data is to be updated.
ServiceConfigurationException
- if an invalid service component is specified.
java.lang.IllegalArgumentException
- if a null
service component
is specified.protected final void validateServiceConfiguration(org.w3c.dom.Document document) throws ServiceException, java.lang.IllegalArgumentException
document
- XML document representing a service's configuration.
ServiceException
- if an invalid configuration is specified.
java.lang.IllegalArgumentException
- if a null
service configuration
is specified.protected java.lang.String[] getServiceClassIdentifiers()
RemoteServiceInterface.CLASS_IDENTIFIER
is employed.
public final void mergeConfigFromDocument(com.sas.metadata.remote.ServiceComponent serviceComponent, org.w3c.dom.Document serviceConfiguration) throws ServiceException
A subclass should override this method if it allows configuration data to be merged into a preexisting configuration.
serviceComponent
- The service whose configuration is to be updated.serviceConfiguration
- The service configuration to be added to the service's
current configuration. Note that only configuration data
that is additive in nature can be appended. Configuration
data that is non-additive will be ignored.
ServiceException
- if unable to update the service's configuration.
java.lang.IllegalArgumentException
- if a null
service component
or service configuration is specified.public void mergeConfiguration(AbstractServiceComponentConfig newConfig) throws ServiceConfigurationException, java.lang.IllegalArgumentException
newConfig
- The configuration that is to be merged into this configuration.
ServiceConfigurationException
- if unable to merge the configuration.
java.lang.IllegalArgumentException
- if an invalid parameter is specified.public void mergeConfiguration(AbstractServiceComponentConfig newConfig, MergePolicy mergePolicy) throws ServiceConfigurationException, java.lang.IllegalArgumentException
newConfig
- The configuration that is to be merged into this configuration.mergePolicy
- Policy which specifies how conflicts will be handled.
ServiceConfigurationException
- if unable to merge the configuration.
java.lang.IllegalArgumentException
- if an invalid parameter is specified.protected abstract void mergeConfiguration(AbstractServiceComponentConfig currentConfig, AbstractServiceComponentConfig newConfig) throws ServiceConfigurationException, java.lang.IllegalArgumentException
currentConfig
- The current configuration into which the new configuration is to be merged.newConfig
- The new configuration which is to be merged into the current configuration.
ServiceConfigurationException
- if unable to merge the service configuration.
java.lang.IllegalArgumentException
- if a null
current or new configuration
is specified.protected abstract void mergeConfiguration(AbstractServiceComponentConfig currentConfig, AbstractServiceComponentConfig newConfig, MergePolicy mergePolicy) throws ServiceConfigurationException, java.lang.IllegalArgumentException
currentConfig
- The current configuration into which the new configuration is to be merged.newConfig
- The new configuration which is to be merged into the current configuration.mergePolicy
- Policy which specifies how conflicts will be handled.
ServiceConfigurationException
- if unable to merge the service configuration.
java.lang.IllegalArgumentException
- if a null
current or new configuration
is specified.protected abstract org.w3c.dom.DocumentFragment appendDOM(org.w3c.dom.Document document, AbstractServiceComponentConfig serviceConfig) throws ServiceConfigurationException, java.lang.IllegalArgumentException
document
- XML document to which the service's configuration is to be appended.serviceConfig
- Service configuration which is to be converted to an XML document.
null
since no child document fragments are to be
added to the document.
ServiceConfigurationException
- if unable to create an XML representation
of the service's configuration.
java.lang.IllegalArgumentException
- if a null
document or
service configuration is specified.protected abstract void validateServiceConfigurationCustom(org.w3c.dom.Document document) throws ServiceException
document
- XML document that represents a service's configuration.
ServiceException
- if an invalid configuration is specified.public org.w3c.dom.Document getDocument() throws ServiceException
getDocument
in interface ServiceComponentConfigInterface
ServiceException
- if unable to create a document.public static final java.lang.String convertDocumentToString(org.w3c.dom.Document document) throws ServiceException
document
- XML document representation for a service's configuration.
null
if a document is not available.
ServiceException
- if unable to create an XML document representation of
the service configuration.public static final java.util.Properties getOutputFormatProperties()
OutputKeys
properties.
public org.w3c.dom.Document createDocument(com.sas.metadata.remote.ServiceComponent serviceComponent) throws ServiceException
createDocument
in interface ServiceComponentConfigInterface
serviceComponent
- Service component's which will be queried for an XML configuration
stored in an configuration property text store.
null
if a document is not available.
ServiceException
- if unable to create an XML document representation of
the service configuration.protected abstract java.lang.String getServiceFactoryClassName()
protected abstract AbstractServiceComponentConfig getConfig(org.w3c.dom.Document serviceConfigDocument) throws ServiceConfigurationException, java.lang.IllegalArgumentException
serviceConfigDocument
- Service configuration represented as an XML document.
ServiceConfigurationException
- if unable to obtain a configuration
from the specified XML document.
java.lang.IllegalArgumentException
- if a null
document is specified.public void mergeConfig(com.sas.metadata.remote.ServiceComponent serviceComponent, org.w3c.dom.Document serviceConfiguration) throws ServiceException
serviceComponent
- The service whose configuration is to be merged with the
specified configuration.serviceConfiguration
- The service configuration to be added to the service's
current configuration. Note that only configuration data
that is additive in nature can be appended. Configuration
data that is non-additive will be ignored.
ServiceException
- if unable to update the service's configuration.
java.lang.IllegalArgumentException
- if a null
service component
or service configuration is specified.public void mergeConfigFromFile(com.sas.metadata.remote.ServiceComponent serviceComponent, java.io.File file) throws ServiceException
mergeConfigFromFile
in interface ServiceComponentConfigInterface
serviceComponent
- The service whose configuration is to be updated.file
- File containing the service configuration which is
to be added to the service component's current configuration.
Note that only configuration data
that is additive in nature can be appended. Configuration
data that is non-additive will be ignored.
ServiceException
- if unable to update the service's configuration.
java.lang.IllegalArgumentException
- if a null
service component
or file is specified.public org.w3c.dom.Document readServiceConfigFromFile(java.io.File file) throws ServiceException
file
- File to which the service's configuration is to be written
using UTF-8 encoding.
ServiceException
- if an exception was encountered persisting the
service's configuration to a file.
java.lang.IllegalArgumentException
- if a null
file is specified.public void writeServiceConfigToFile(java.io.File file) throws ServiceException
file
- File to which the service's configuration is to be written
using UTF-8 encoding.
ServiceException
- if an exception was encountered persisting the
service's configuration to a file.
java.lang.IllegalArgumentException
- if a null
file is specified.public void writeServiceConfigToFile(java.io.File file, com.sas.metadata.remote.ServiceComponent serviceComponent) throws ServiceException
writeServiceConfigToFile
in interface ServiceComponentConfigInterface
file
- File to which the service's configuration is to be written
using UTF-8 encoding.serviceComponent
- Service component whose configuration is to be written to the
specified file.
ServiceException
- if an exception was encountered persisting the
service's configuration to a file.
java.lang.IllegalArgumentException
- if a null
service component
or file is specified.public java.lang.String getServiceComponentConfiguration(com.sas.metadata.remote.ServiceComponent serviceComponent) throws ServiceException
This implementation locates the service component's
property named "INIT_DATA"
and then obtains the property's stored text configuration.
If a service persists its configuration data in another manner, then this method should be overridden to provide an appropriate mechanism to obtain the service's configuration.
serviceComponent
- Service whose configuration is to be obtained.
ServiceException
- if unable to obtain the service's configuration.public static final java.lang.String getServiceComponentConfigurationFromTextStore(com.sas.metadata.remote.ServiceComponent serviceComponent) throws ServiceException
This implementation locates the service component's
property named PROPERTY_NAME_INIT_DATA
, verifies
that the property's text role is PROPERTYROLE_INITIALIZATION
,
and then obtains the property's stored text configuration.
serviceComponent
- Service whose configuration is to be obtained.
ServiceException
- if unable to obtain the service's configuration.public static final com.sas.metadata.remote.TextStore getServiceComponentConfigTextStore(com.sas.metadata.remote.ServiceComponent serviceComponent) throws ServiceException
This implementation locates the service component's
property named PROPERTY_NAME_INIT_DATA
, verifies
that the property's text role is PROPERTYROLE_INITIALIZATION
,
and then obtains the property's stored text configuration.
If a service persists its configuration data in another manner, then this method should be overridden to provide an appropriate mechanism to obtain the service's configuration.
serviceComponent
- Service whose configuration is to be obtained.
ServiceException
- if unable to obtain the service's configuration.public ConsumedResourceAdapter getConsumedResourceAdapter(java.lang.String resourceID)
resourceID
- ID of the consumed resource whose adapter is to be returned.
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if cloning is not supported.protected static org.w3c.dom.Document getTextStoreServiceConfig(com.sas.metadata.remote.ServiceComponent serviceComponent) throws ServiceException
PROPERTY_NAME_INIT_DATA
.
A subclass should override this method if it does not persist its
configuration using the PROPERTY_NAME_INIT_DATA
property of
the service component.
serviceComponent
- The service component from which an XML document representation of
its configuration is to be obtained.
ServiceException
- if unable to obtain an XML document representation of
the service's configuration.protected static final void setTextStoreServiceConfig(com.sas.metadata.remote.ServiceComponent serviceComponent, org.w3c.dom.Document serviceConfigDocument) throws ServiceException
serviceComponent
- The service whose text store is to be updated with the
specified service configuration.serviceConfigDocument
- Service configuration to be assigned to the service component's
text store.
ServiceException
- if unable to assign the service configuration.public com.sas.util.UsageVersion getUsageVersion()
public com.sas.util.UsageVersion getUsageVersionCurrent()
public com.sas.util.UsageVersion getUsageVersionOldest()
public void setUsageVersion(com.sas.util.UsageVersion usageVersion) throws java.lang.IllegalArgumentException
usageVersion
- Configuration's version.
java.lang.IllegalArgumentException
- if a null
or incompatible usage version is specified.protected final void setUsageVersionCompatibility(com.sas.util.UsageVersion usageVersionOldest, com.sas.util.UsageVersion usageVersionCurrent) throws java.lang.IllegalArgumentException
usageVersionOldest
- Configuration's oldest supported version.usageVersionCurrent
- Configuration's currently supported version.
java.lang.IllegalArgumentException
- if a null
or incompatible
usage version is specified.public java.lang.String getConfirmDeleteUnusedResourcesMsg()
A sub-class should override this method if it wants to use a different message.
public java.lang.String getConfirmDeleteUnusedResourceMsg(ConsumedResourceInterface consumedResource)
A sub-class should override this method if it wants to use a different message.
consumedResource
- The consumed resource which is being removed.
protected int getPrimeNumber()
public org.w3c.dom.Document toDocument() throws ServiceException
ServiceException
- if unable to create an XML document
representation of this service configuration.public java.lang.String toXMLString() throws ServiceException
null
if there is no XML document representation of the
configuration.
ServiceException
- if unable to create an XML string.protected abstract org.w3c.dom.DocumentFragment appendDOM(org.w3c.dom.Document document) throws ServiceException
document
- XML document to which document fragments are to be appended.
null
if no fragment
was appended.
ServiceException
- if unable to construct the XML document.public void parseConsumerUsage(org.w3c.dom.Element element)
element
- "ConsumerUsage" XML element.public com.sas.services.deployment.ConsumerUsage getConsumerUsage()
public void setConsumerUsage(com.sas.services.deployment.ConsumerUsage consumerUsage)
consumerUsage
- Consumer usage.public Consumer addConsumer(Consumer consumer, boolean isConsumer)
A sub-class can override this method if it needs to implement custom logic to specify that only some of the service configuration's resources are used by the consumer.
consumer
- The consumer to be added to the usage model.isConsumer
- true
if the consumer uses all of the service configuration's resources
false
if it uses none.
public Consumer removeConsumer(Consumer consumer, boolean isRemoveResourceIfUnused) throws ServiceException
consumer
- The Consumer whose configuration is to be removed.isRemoveResourceIfUnused
- true
if the service configuration's resources should
be removed if they are no longer used by any consumers.
null
.
ServiceException
- if an error occurs while attempting to remove the consumer.public void removeConsumer(com.sas.metadata.remote.ServiceComponent serviceComponent) throws ServiceException
serviceComponent
- Remove current consumer from this serviceComponent.
ServiceException
- if an error occurs while attempting to remove the consumer.public java.util.Set getUnusedResources(java.util.Set removedConsumerNames)
ConsumedResourceInterface
objects representing the
resources which will be unused if the specified consumers are removed.
A service configuration which has resources which depend upon other resources should implement this method to ensure its integrity by only returning the set of resources which are not used by any consumer or resource.
removedConsumerNames
- Set of String
removed consumer names.
ConsumedResourceInterface
representing resources which
will be unused if the specified consumers are removed. An empty set
will be returned otherwise.protected boolean isOKToRemoveResource(java.lang.String resourceID)
A sub-class can override this method if it needs to control whether a resource can be removed based on its use by other resources.
resourceID
- The ID of the resource which will be removed from the model
if this service configuration says that it is not used.
true
indicating that it is OK to remove this resource.
A sub-class can override this method if it needs to
control whether a resource can be removed based on its
use by other resources.protected final java.util.Set getConsumersForResource(java.lang.String resourceID)
names
that use the specified resource.
resourceID
- Resource's ID.
String
names of consumers that use the specified resource.
An empty set will be returned if the resource is not used by any consumers.public void setIsConsumer(Consumer consumer, boolean isConsumer)
A sub-class can override this method if it needs to implement custom logic to specify that only some of the service configuration's resources are used by the consumer.
consumer
- The consumer.isConsumer
- true
if the consumer uses all of the service configuration's resources or
false
otherwise.protected void addResourceAdapter(ConsumedResourceAdapter consumedResource)
consumedResource
- protected ConsumedResourceInterface removeResourceAdapter(ConsumedResourceAdapter consumedResource, java.util.Set removedConsumedResources) throws ServiceException
consumedResource
- Consumed resource which is to be removed.removedConsumedResources
- Set of consumed resources which have been removed.
ServiceException
- if unable to remove the resource adapter.protected void addResource(ConsumedResourceInterface consumedResource)
consumedResource
- public ConsumedResourceInterface removeResource(java.lang.String resourceID, java.util.Set removedConsumedResourceSet) throws ServiceException
A sub-class must implement this method to provide logic to remove the resource from its configuration and then call this method to remove the resource from the consumer usage model.
resourceID
- The unique ID of the resource which is to be removed from
the consumer usage model.removedConsumedResourceSet
- Set of ConsumedResourceInterface
objects which have been
removed.
ConsumedResourceInterface
object or
null
if the resource was not defined.
ServiceException
- if unable to remove a resource.protected ConsumedResourceInterface removeConsumedResource(java.lang.String resourceID)
A sub-class must implement this method to provide logic to remove the resource from its configuration and then call this method to remove the resource from the consumer usage model.
resourceID
- The unique ID of the resource which is to be removed from
the consumer usage model.
ConsumedResourceInterface
object or
null
if the resource was not defined.public java.util.Set getResourcesWhichUseResource(java.util.Set consumedResources)
A sub-class should override this method if any of the service configuration's resources depend on each other.
consumedResources
- Set of ConsumedResourceInterface
for which we
need to identify the resources which use it.
ConsumedResourceInterface
or an empty set
if no resource depends on the specified resources.public MergePolicy getDefaultMergePolicy()
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |