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

com.sas.services.deployment
Class AbstractMetadataSource

java.lang.Object
  |
  +--com.sas.services.deployment.AbstractMetadataSource
All Implemented Interfaces:
MetadataSourceInterface,
Direct Known Subclasses:
OMRMetadataSource, URLMetadataSource

public abstract class AbstractMetadataSource
extends Object
implements MetadataSourceInterface

An abstract class representing a source of metadata such as an SAS Metadata Repository or a URL accessible file containing metadata exported from a SAS Metadata Repository via the Foundation Services Manager console plug-in. An abstract method getMetadata() is used to return the XML formatted 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:
OMRMetadataSource, URLMetadataSource, Serialized Form

Constructor Summary
protected AbstractMetadataSource()
          Constructs a default instance.
  AbstractMetadataSource(String softwareComponentName, Set serviceDeploymentNames)
          Constructs an instance used to deploy specified foundation service deployments.
  AbstractMetadataSource(String softwareComponentName, String serviceDeploymentName)
          Constructs an instance with the specified foundation service deployment name.
 
Method Summary
 void addServiceDeploymentName(String serviceDeploymentGroup)
          Adds the name of a service deployment group to the set of service deployment groups that are to be deployed.
 void destroy()
          Destroys this metadata source disposing its metadata object store.
 boolean equals(Object other)
          Determines whether or not the other object equals this object.
 String getApplicationServiceDeployment()
          Gets the name of the application's foundation services deployment.
protected  String getDeployFailureMessage()
          Gets a message describing this metadata source's inability to deploy services.
 MdObjectStore getMdObjectStore()
          Gets the metadata object store.
 MdObjectStore getMdObjectStore(boolean isOKToCreate)
          Gets the metadata object store.
abstract  String getMetadata()
          Gets metadata describing an application's foundation services deployment.
 RMIClientSocketFactory getRMIClientSocketFactory()
          Gets the RMI client socket factory.
 RMIServerSocketFactory getRMIServerSocketFactory()
          Gets the RMI server socket factory.
 Set getServiceDeploymentNames()
          Gets the set of service deployment names that are to be deployed.
 String getSoftwareComponentName()
          Gets the name of the metadata SoftwareComponent that roots the service deployment metadata hierarchy.
protected static String getStringFromInputSource(InputStream inputStream)
          Gets an XML string representing a foundation services deployment from the specified input stream.
 int hashCode()
          Gets a hash code for this service attribute.
 boolean isOKToDestroy()
          Determines whether or not it is OK to destroy this source once it has been used to query the service deployment metadata.
 boolean isServiceDeploymentDeployable(String applicationServiceDeployment)
          An application's foundation service deployment is deployable if: The SoftwareComponent name matches The SoftwareComponent ClassIdentifier designates 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
 boolean isServiceDeploymentDeployable(String applicationServiceDeployment, Tree serviceDeploymentGroup)
          Determines whether or not the specified application service deployment's service deployment group is deployable.
 void removeServiceDeploymentName(String serviceDeploymentGroup)
          Removes a service deployment group name from the groups that are to be deployed.
 void setApplicationServiceDeployment(String softwareComponentName)
          Sets the name of the metadata SoftwareComponent that roots an application's service deployment metadata hierarchy.
 void setIsOKToClose(boolean isCloseConnection)
          Specifies whether or not it is OK for the service loader to close this connection once it no longer needs it.
 void setRMIClientSocketFactory(RMIClientSocketFactory socketFactory)
          Sets the RMI client socket factory.
 void setRMIServerSocketFactory(RMIServerSocketFactory socketFactory)
          Sets the RMI server socket factory.
 void setServiceDeploymentNames(Set serviceDeploymentGroups)
          Sets the set of deployment group names for Tree elements.
 String toString()
          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 Detail

AbstractMetadataSource

protected AbstractMetadataSource()
Constructs a default instance. Instead of using this default constructor use AbstractMetadataSource(applicationDeployment, deploymentGroup) or AbstractMetadataSource(applicationDeployment, deploymentGroups) which specify one or more foundation service deployment names.

AbstractMetadataSource

public AbstractMetadataSource(String softwareComponentName,
                              Set serviceDeploymentNames)
                       throws InitializationException
Constructs an instance used to deploy specified foundation service deployments.
Parameters:
softwareComponentName - The name of the metadata SoftwareComponent that serves as the root of the service deployment hierarchy.
serviceDeploymentNames - Set of String elements representing the names of service deployments that are to be deployed. A foundation service deployment's name is represented using the Name attribute of a metadata SoftwareComponent.
Throws:
InitializationException - if an invalid set of service deployment names is specified.

AbstractMetadataSource

public AbstractMetadataSource(String softwareComponentName,
                              String serviceDeploymentName)
                       throws InitializationException
Constructs an instance with the specified foundation service deployment name. This name corresponds to the metadata SoftwareComponent's name attribute.
Parameters:
softwareComponentName - The name of the metadata SoftwareComponent that serves as the root of the service deployment hierarchy.
serviceDeploymentName - The name of the foundation service deployment that is to be deployed. This name corresponds to the metadata SoftwareComponent's Name attribute.
Throws:
InitializationException - if an invalid service deployment name is specified.
Method Detail

isServiceDeploymentDeployable

public final boolean isServiceDeploymentDeployable(String applicationServiceDeployment)
An application's foundation service deployment is deployable if:
Specified by:
isServiceDeploymentDeployable in interface MetadataSourceInterface
Parameters:
applicationServiceDeployment - Metadata SoftwareComponent being considered for deployment
Returns:
true if its OK to deploy the foundation services or false if it isn't.
See Also:
MetadataSourceInterface.isServiceDeploymentDeployable(String)

isServiceDeploymentDeployable

public final boolean isServiceDeploymentDeployable(String applicationServiceDeployment,
                                                   Tree serviceDeploymentGroup)
Determines whether or not the specified application service deployment's service deployment group is deployable.
Specified by:
isServiceDeploymentDeployable in interface MetadataSourceInterface
Parameters:
applicationServiceDeployment - Metadata SoftwareComponent being considered for deployment.
serviceDeploymentGroup - Service deployment group defined under the application's service deployment.
Returns:
true if it is OK to deploy this service deployment group for the specified application service deployment. or false if it isn't.
See Also:
MetadataSourceInterface.isServiceDeploymentDeployable(String, Tree)

getSoftwareComponentName

public final String getSoftwareComponentName()
Gets the name of the metadata SoftwareComponent that roots the service deployment metadata hierarchy.
Returns:
name of the metadata SoftwareComponent that roots the service deployment metadata hierarchy or null if no name is defined.

setApplicationServiceDeployment

public final void setApplicationServiceDeployment(String softwareComponentName)
Sets the name of the metadata SoftwareComponent that roots an application's service deployment metadata hierarchy.
Specified by:
setApplicationServiceDeployment in interface MetadataSourceInterface
Parameters:
softwareComponentName - Name of the metadata SoftwareComponent that roots the service deployment metadata hierarchy or null if no name is defined.
See Also:
MetadataSourceInterface.setApplicationServiceDeployment(String)

getServiceDeploymentNames

public final Set getServiceDeploymentNames()
Gets the set of service deployment names that are to be deployed. A service deployment name corresponds to the metadata SoftwareComponent element's Name attribute.
Specified by:
getServiceDeploymentNames in interface MetadataSourceInterface
Returns:
Set of String names 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:
MetadataSourceInterface.getServiceDeploymentNames()

setServiceDeploymentNames

public final void setServiceDeploymentNames(Set serviceDeploymentGroups)
Sets the set of deployment group names for Tree elements. Each element of the Set must be a String.
Parameters:
serviceDeploymentGroups - Set of String elements representing the names of the service deployment groups that are to be deployed. The service deployment group name corresponds to the Name attribute of a metadata Tree element that is a subtree under the SoftwareComponent element representing the application.

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 gruop that is to be removed from the set of deployable groups.

getMetadata

public abstract String getMetadata()
                            throws ServiceException
Gets metadata describing an application's foundation services deployment.
Specified by:
getMetadata in interface MetadataSourceInterface
Returns:
XML string describing an application's foundation services deployment.
Throws:
ServiceException - if unable to retrieve the metadata.
See Also:
MetadataSourceInterface.getMetadata()

getApplicationServiceDeployment

public final String getApplicationServiceDeployment()
Gets the name of the application's foundation services deployment.
Specified by:
getApplicationServiceDeployment in interface MetadataSourceInterface
Returns:
Name of the application's foundation services deployment.
See Also:
MetadataSourceInterface.getApplicationServiceDeployment()

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 null if 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 null if the default client socket factory is desired.

getRMIServerSocketFactory

public final RMIServerSocketFactory getRMIServerSocketFactory()
Gets the RMI server socket factory.
Returns:
RMI server socket factory or null if 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 or null if 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 or null if the default server socket factory is desired.

getMdObjectStore

public MdObjectStore getMdObjectStore()
Gets the metadata object store.
Returns:
Metadata object store.

getMdObjectStore

public MdObjectStore getMdObjectStore(boolean isOKToCreate)
Gets the metadata object store.
Specified by:
getMdObjectStore in interface MetadataSourceInterface
Parameters:
isOKToCreate - true if it is OK to create a new metadata object store if one is not currently defined or false if an object store should not be created.
Returns:
Metadata object store or null if an object store is not defined.
See Also:
MetadataSourceInterface.getMdObjectStore(boolean)

destroy

public void destroy()
Destroys this metadata source disposing its metadata object store.
Specified by:
destroy in interface MetadataSourceInterface
See Also:
MetadataSourceInterface.destroy()

setIsOKToClose

public final void setIsOKToClose(boolean isCloseConnection)
Specifies whether or not it is OK for the service loader to close this connection once it no longer needs it.
Specified by:
setIsOKToClose in interface MetadataSourceInterface
Parameters:
isCloseConnection - true if it is OK for the service loader to close and dispose of this connection once it no longer needs it or false if this connection is to be closed somewhere else when its no longer needed.
See Also:
MetadataSourceInterface.setIsOKToClose(boolean)

isOKToDestroy

public final boolean isOKToDestroy()
Determines whether or not it is OK to destroy this source once it has been used to query the service deployment metadata.
Specified by:
isOKToDestroy in interface MetadataSourceInterface
Returns:
true if it is OK to close and dispose of this connection once it no longer needs it or false if this connection is to be closed somewhere else when its no longer needed.
See Also:
MetadataSourceInterface.isOKToDestroy()

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:
toString in class Object
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:
hashCode in class Object
Returns:
Hash code.

equals

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

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




Copyright © 2006 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 10 Feb 2006 17:28:53