*** This class provides Binary Compatibility only, not Source Compatibility ***
Class AbstractMetadataSource
- All Implemented Interfaces:
MetadataSourceInterface,Serializable
- Direct Known Subclasses:
OMRMetadataSource,URLMetadataSource
A concrete subclass must implement the abstract method
getMetadata() which is used to get the XML UTF-8 encoded metadata
describing an application's foundation service deployment.
An application is represented in a SAS Metadata Repository
as a SoftwareComponent
element. Each application will have 1..* collections of services
using a Tree to contain them. These deployment groups are
used to restrict which collections of services are deployed. When
deploying services one may specify 0..* deployment groups for a particular
application. If no groups are specified then no restriction is applied and
all groups are deployed. If 1..* deployment groups are specified then only
services defined within those groups are eligible for deployment.
- Since:
- 1.0
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs a default instance.AbstractMetadataSource(String softwareComponentName, String serviceGroupName) Constructs an instance with the specified foundation service deployment name.AbstractMetadataSource(String softwareComponentName, Set<String> serviceGroupNames) Constructs an instance used to deploy specified foundation service deployments.protectedAbstractMetadataSource(Set<String> serviceGroupNames) Constructs an instance used to deploy specified foundation service deployments. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanaddRMIBinding(RMIBinding rmiBinding) Adds an RMI binding.final voidaddServiceDeploymentName(String serviceDeploymentGroup) Adds the name of a service deployment group to the set of service deployment groups that are to be deployed.static com.sas.metadata.remote.MdStorecreateMdStore(boolean isRemotelyAccessible, Map<String, String> metaOptions, Environment environment) Creates a metadata object store in a new metadata factory.voiddestroy()Destroys this metadata source by disposing the metadata object store.booleanequals(Object other) Determines whether or not the other object equals this object.final StringGets the name of the application's foundation services deployment.protected StringGets a message describing this metadata source's inability to deploy services.final com.sas.metadata.remote.MdObjectStoreGets the metadata object store.abstract StringGets metadata describing an application's foundation services deployment.PropertiesGets the properties which define this metadata source's configuration.final RMIClientSocketFactoryGets the RMI client socket factory.final RMIServerSocketFactoryGets the RMI server socket factory.final Set<String> Gets the set of service deployment names that are to be deployed.final StringGets the name of the metadataSoftwareComponentthat roots the service deployment metadata hierarchy.protected static final StringgetStringFromInputSource(InputStream inputStream) Gets an XML string representing a foundation services deployment from the specified input stream.inthashCode()Gets a hash code for this service attribute.final booleanisServiceDeploymentDeployable(String applicationServiceDeployment) An application's foundation service deployment is deployable if: TheSoftwareComponentname matches TheSoftwareComponentClassIdentifierdesignates the element as representing an application's foundation service deployment All of the service deployment groups to be deployed are defined as subtree elements of theSoftwareComponentfinal booleanisServiceDeploymentDeployable(String applicationServiceDeployment, com.sas.metadata.remote.Tree serviceGroup) Determines whether or not the specified application service deployment's service deployment group is deployable.final List<RemoteServiceInterface> lookupServices(DiscoveryServiceInterface discoveryService) Attempts to lookup services using previously discovered RMI bindings.final voidremoveServiceDeploymentName(String serviceDeploymentGroup) Removes a service deployment group name from the groups that are to be deployed.final voidsetApplicationServiceDeployment(String softwareComponentName) Sets the name of the metadataSoftwareComponentthat roots an application's service deployment metadata hierarchy.voidsetProperties(Properties properties) Sets the properties which define this metadata source's configuration.final voidsetRMIClientSocketFactory(RMIClientSocketFactory socketFactory) Sets the RMI client socket factory.final voidsetRMIServerSocketFactory(RMIServerSocketFactory socketFactory) Sets the RMI server socket factory.final voidsetServiceDeploymentNames(Set<String> serviceGroupNames) Sets the set of deployment group names forTreeelements.protected final voidsetSoftwareComponentName(String softwareComponentName) Specifies the name of the application containing foundation service deployment metadata.The metadataSoftwareComponentthat serves as the root for the service deployment metadata hierarchy.StringtoString()Gets a string representation of this OMR metadata source.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
AbstractMetadataSource
protected AbstractMetadataSource() throws IllegalArgumentExceptionConstructs a default instance. Instead of using this default constructor useAbstractMetadataSource(applicationDeployment, deploymentGroup)orAbstractMetadataSource(applicationDeployment, deploymentGroups)which specify one or more foundation service deployment names.- Throws:
IllegalArgumentException- if unable to create a metadata object store.
-
AbstractMetadataSource
public AbstractMetadataSource(String softwareComponentName, Set<String> serviceGroupNames) throws InitializationException Constructs an instance used to deploy specified foundation service deployments.- Parameters:
softwareComponentName- The name of the metadataSoftwareComponentthat serves as the root of the service deployment hierarchy.serviceGroupNames-SetofStringnames 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" group, but not in "Stored Process" group). If anullor empty set is specified, then no filter will be applied. The service deployment name corresponds to theNameattribute of a metadataTreethat is a subtree of theSoftwareComponent.- Throws:
InitializationException- if an invalid set of service deployment names is specified.
-
AbstractMetadataSource
Constructs an instance used to deploy specified foundation service deployments.A subclass must initialize the name of the service deployment by calling
setSoftwareComponentName(String).- Parameters:
serviceGroupNames-SetofStringnames 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" group, but not in "Stored Process" group). If anullor empty set is specified, then no filter will be applied. The service deployment name corresponds to theNameattribute of a metadataTreethat is a subtree of theSoftwareComponent.- Throws:
InitializationException- if an invalid set of service deployment names is specified.
-
AbstractMetadataSource
public AbstractMetadataSource(String softwareComponentName, String serviceGroupName) throws InitializationException Constructs an instance with the specified foundation service deployment name. This name corresponds to the metadataSoftwareComponent's name attribute.- Parameters:
softwareComponentName- The name of the metadataSoftwareComponentthat serves as the root of the service deployment hierarchy.serviceGroupName- The name of the foundation service deployment group that is to be deployed. This name corresponds to the metadataTree'sNameattribute.- Throws:
InitializationException- if an invalid service deployment name is specified.
-
-
Method Details
-
createMdStore
public static com.sas.metadata.remote.MdStore createMdStore(boolean isRemotelyAccessible, Map<String, String> metaOptions, Environment environment) throws ServiceExceptionCreates a metadata object store in a new metadata factory.- Parameters:
isRemotelyAccessible-falseif objects created by the metadata factory will only be accessed from within this JVM ortrueif remotely accessible objects are required.metaOptions- Options required to open a connection to the metadata server.environment- Resources environment ornullif a default environment should be used.- Returns:
- Metadata store. The caller is responsible for disposing the metadata object store's factory when it is no longer needed.
- Throws:
ServiceException
-
getProperties
public Properties getProperties()Gets the properties which define this metadata source's configuration.}- Specified by:
getPropertiesin interfaceMetadataSourceInterface- Returns:
- Properties which define this metadata source's configuration.
-
setProperties
public void setProperties(Properties properties) Sets the properties which define this metadata source's configuration.}- Specified by:
setPropertiesin interfaceMetadataSourceInterface- Parameters:
properties- Properties which define this metadata source's configuration.
-
isServiceDeploymentDeployable
public final boolean isServiceDeploymentDeployable(String applicationServiceDeployment) An application's foundation service deployment is deployable if:- The
SoftwareComponentname matches - The
SoftwareComponentClassIdentifierdesignates the element as representing an application's foundation service deployment - All of the service deployment groups to be deployed are
defined as subtree elements of the
SoftwareComponent
- Specified by:
isServiceDeploymentDeployablein interfaceMetadataSourceInterface- Parameters:
applicationServiceDeployment- MetadataSoftwareComponentbeing considered for deployment- Returns:
trueif its OK to deploy the foundation services orfalseif it isn't.- See Also:
- The
-
isServiceDeploymentDeployable
public final boolean isServiceDeploymentDeployable(String applicationServiceDeployment, com.sas.metadata.remote.Tree serviceGroup) Determines whether or not the specified application service deployment's service deployment group is deployable.- Specified by:
isServiceDeploymentDeployablein interfaceMetadataSourceInterface- Parameters:
applicationServiceDeployment- MetadataSoftwareComponentbeing considered for deployment.serviceGroup- Service deployment group defined under the application's service deployment.- Returns:
trueif it is OK to deploy this service deployment group for the specified application service deployment. orfalseif it isn't.- See Also:
-
getSoftwareComponentName
public final String getSoftwareComponentName()Gets the name of the metadataSoftwareComponentthat roots the service deployment metadata hierarchy.- Returns:
- name of the metadata
SoftwareComponentthat roots the service deployment metadata hierarchy ornullif no name is defined.
-
setApplicationServiceDeployment
public final void setApplicationServiceDeployment(String softwareComponentName) Sets the name of the metadataSoftwareComponentthat roots an application's service deployment metadata hierarchy.- Specified by:
setApplicationServiceDeploymentin interfaceMetadataSourceInterface- Parameters:
softwareComponentName- Name of the metadataSoftwareComponentthat roots the service deployment metadata hierarchy ornullif no name is defined.- See Also:
-
getServiceDeploymentNames
public final Set<String> getServiceDeploymentNames()Gets the set of service deployment names that are to be deployed. A service deployment name corresponds to the metadataSoftwareComponentelement'sNameattribute.- Specified by:
getServiceDeploymentNamesin interfaceMetadataSourceInterface- Returns:
- Set of
Stringnames of the service deployments that are to be deployed. Note that this set may not contain any elements, but it is guaranteed to be non-null. - See Also:
-
setServiceDeploymentNames
public final void setServiceDeploymentNames(Set<String> serviceGroupNames) Sets the set of deployment group names forTreeelements. Each element of theSetmust be aStringrepresenting the name of a service group which is to be deployed. An empty set ornullset indicates that services will not be filtered.- Parameters:
serviceGroupNames-SetofStringnames 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" group, but not in "Stored Process" group). If anullor empty set is specified, then no filter will be applied. The service deployment name corresponds to theNameattribute of a metadataTreethat is a subtree of theSoftwareComponent.
-
setSoftwareComponentName
protected final void setSoftwareComponentName(String softwareComponentName) throws InitializationException Specifies the name of the application containing foundation service deployment metadata.The metadataSoftwareComponentthat serves as the root for the service deployment metadata hierarchy.- Parameters:
softwareComponentName- The name of the metadataSoftwareComponentthat serves as the root of the service deployment hierarchy.- Throws:
InitializationException- if an invalid service deployment name is specified.
-
addServiceDeploymentName
public final void addServiceDeploymentName(String serviceDeploymentGroup) throws InitializationException Adds the name of a service deployment group to the set of service deployment groups that are to be deployed.- Parameters:
serviceDeploymentGroup- Name of a service deployment group to be added to the set that is to be deployed.- Throws:
InitializationException- if an invalid service deployment name is specified.
-
removeServiceDeploymentName
public final void removeServiceDeploymentName(String serviceDeploymentGroup) Removes a service deployment group name from the groups that are to be deployed.- Parameters:
serviceDeploymentGroup- Name of a service deployment group that is to be removed from the set of deployable groups.
-
getMetadata
Gets metadata describing an application's foundation services deployment.- Specified by:
getMetadatain interfaceMetadataSourceInterface- Returns:
- XML string describing an application's foundation services deployment.
- Throws:
ServiceException- if unable to retrieve the metadata.- See Also:
-
getApplicationServiceDeployment
public final String getApplicationServiceDeployment()Gets the name of the application's foundation services deployment.- Specified by:
getApplicationServiceDeploymentin interfaceMetadataSourceInterface- Returns:
- Name of the application's foundation services deployment.
- See Also:
-
getStringFromInputSource
protected static final String getStringFromInputSource(InputStream inputStream) throws ServiceException Gets an XML string representing a foundation services deployment from the specified input stream. Note that service deployments are encoded using utf-8.- Parameters:
inputStream- Input stream from which the metadata will be read. Note that the input stream should be encoded using an utf-8 character set.- Returns:
- String acquired from the input stream or
nullif unable to read the string. - Throws:
ServiceException- if unable to obtain a String from the specified input source.
-
getRMIClientSocketFactory
public final RMIClientSocketFactory getRMIClientSocketFactory()Gets the RMI client socket factory.- Returns:
- RMI client socket factory or
nullif the default client socket factory is desired.
-
getRMIServerSocketFactory
public final RMIServerSocketFactory getRMIServerSocketFactory()Gets the RMI server socket factory.- Returns:
- RMI server socket factory or
nullif the default server socket factory is desired.
-
setRMIClientSocketFactory
public final void setRMIClientSocketFactory(RMIClientSocketFactory socketFactory) Sets the RMI client socket factory.- Parameters:
socketFactory- RMI client socket factory ornullif the default client socket factory is desired.
-
setRMIServerSocketFactory
public final void setRMIServerSocketFactory(RMIServerSocketFactory socketFactory) Sets the RMI server socket factory.- Parameters:
socketFactory- RMI server socket factory ornullif the default server socket factory is desired.
-
getMdObjectStore
public final com.sas.metadata.remote.MdObjectStore getMdObjectStore() throws IllegalStateExceptionGets the metadata object store.- Specified by:
getMdObjectStorein interfaceMetadataSourceInterface- Returns:
- Metadata object store.
- Throws:
IllegalStateException- if the metadata source has been destroyed and the metadata object store isnull.
-
destroy
public void destroy()Destroys this metadata source by disposing the metadata object store.- Specified by:
destroyin interfaceMetadataSourceInterface
-
addRMIBinding
Adds an RMI binding.- Parameters:
rmiBinding- RMI binding that describes a remote discovery service.- Returns:
trueif the RMI binding has already been registered or was successfully added to the list of bindings.
-
lookupServices
public final List<RemoteServiceInterface> lookupServices(DiscoveryServiceInterface discoveryService) Attempts to lookup services using previously discovered RMI bindings. Rediscovered services will be registered with the specified discovery service.- Parameters:
discoveryService-- Returns:
- List of
services
-
getDeployFailureMessage
protected String getDeployFailureMessage()Gets a message describing this metadata source's inability to deploy services. A subclass should override this method if a more detailed message can be provided.- Returns:
- Message describing a failure to deploy services.
-
toString
public String toString()Gets a string representation of this OMR metadata source.- Overrides:
toStringin classObject- Returns:
- String representation of this instance.
-
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:
hashCodein classObject- Returns:
- Hash code.
-
equals
public boolean equals(Object other) Determines whether or not the other object equals this object.- Overrides:
equalsin classObject- Parameters:
other- Other object.- Returns:
trueif the objects are equivalent.
-