*** This class provides Binary Compatibility only, not Source Compatibility ***
Class ServiceDeploymentExporter
- All Implemented Interfaces:
Runnable
The following example shows how to synchronously export a SAS Foundation Services deployment from a SAS Metadata Repository and then check the exporter to determine if an exception has occurred.
The following example shows how to asynchronously export a SAS Foundation Services deployment from a SAS Metadata Repository and by registering an observer which will be notified if an exception has occurred.
- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionServiceDeploymentExporter(com.sas.metadata.remote.SoftwareComponent serviceDeployment, File exportDestinationFile) Constructs an instance of a runnable service deployment exporter specifying the SAS Foundation Services deployment which is to be exported and the output file to which the metadata will be written.ServiceDeploymentExporter(com.sas.metadata.remote.SoftwareComponent serviceDeployment, File exportDestinationFile, boolean isOKToOverwriteFile) Constructs an instance of a runnable service deployment exporter specifying the SAS Foundation Services deployment which is to be exported, the output file to which the metadata will be written and whether it is OK to overwrite the output file if it already exists. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddObserver(Observer observer) Adds an observer that desires to be notified when the export operation has concluded, so that one can determine whether aServiceExceptionhas occurred.voiddeleteObserver(Observer observer) Removes an observer that no longer desires to be notified when the export operation has concluded.static voidexportDeployment(String[] args) Method for an application which is used to export metadata describing a SAS Foundation Service deployment from a SAS Metadata Repository to a UTF-8 encoded XML file.static voidexportServiceDeployment(com.sas.metadata.remote.SoftwareComponent softwareComponent, String fileName, boolean isOverwriteFile) Exports a SAS Foundation Services deployment from the metadata server to a UTF-8 encoded XML file.Gets the service exception, if any, that occurred when exporting the foundation service deployment.static voidmain(String[] args) static com.sas.metadata.remote.MdObjectStorenewStoreWithCopyOfServiceDeployment(com.sas.metadata.remote.SoftwareComponent softwareComponent) Gets a metadata object store that has been populated with a copy of the foundation service deployment configuration metadata.voidrun()Runs the SAS Foundation Services deployment exporter to write the configuration to the specified file using UTF-8 encoding.voidsetExportDestinationFile(File exportDestinationFile) Sets the file to which the SAS Foundation Services deployment should be exported.voidsetIsBeautifyingXML(boolean isBeautifyingXML) Specifies whether the XML should be beautified to make it more legible.Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yieldMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
ServiceDeploymentExporter
public ServiceDeploymentExporter(com.sas.metadata.remote.SoftwareComponent serviceDeployment, File exportDestinationFile) throws IllegalArgumentException Constructs an instance of a runnable service deployment exporter specifying the SAS Foundation Services deployment which is to be exported and the output file to which the metadata will be written. The specified metadata service deployment will be exported to the specified URL destination when this exporter is run.If a file already exists, then it will be overwritten. Use
ServiceDeploymentExporter(SoftwareComponent, File, boolean)if an exception should be thrown if the file already exists.Use
ServiceDeploymentExporter(SoftwareComponent, File, boolean)if the output file should not be overwritten if it already exists.- Parameters:
serviceDeployment- The SAS Foundation Services deployment whose metadata is to be exported to the UTF-8 encoded XML file.exportDestinationFile- Output file to which the SAS Foundation Services deployment metadata is to be exported using UTF-8 encoding.- Throws:
IllegalArgumentException- if unable to export the SAS Foundation Services deployment using the specified parameters.- Since:
- 9.2
- See Also:
-
ServiceDeploymentExporter
public ServiceDeploymentExporter(com.sas.metadata.remote.SoftwareComponent serviceDeployment, File exportDestinationFile, boolean isOKToOverwriteFile) throws IllegalArgumentException Constructs an instance of a runnable service deployment exporter specifying the SAS Foundation Services deployment which is to be exported, the output file to which the metadata will be written and whether it is OK to overwrite the output file if it already exists. Metadata describing the SAS Foundation Services deployment will be exported to the specified output file using UTF-8 encoding when this exporter is run.- Parameters:
serviceDeployment- The SAS Foundation Services deployment whose metadata is to be exported to the UTF-8 encoded XML file.exportDestinationFile- Output file to which the SAS Foundation Services deployment metadata is to be exported using UTF-8 encoding.isOKToOverwriteFile-trueif it is OK to overwrite the file orfalseif an exception should be thrown if the file already exists.- Throws:
IllegalArgumentException- if unable to export the service deployment using the specified parameters.- Since:
- 9.2
- See Also:
-
-
Method Details
-
setIsBeautifyingXML
public void setIsBeautifyingXML(boolean isBeautifyingXML) Specifies whether the XML should be beautified to make it more legible.- Parameters:
isBeautifyingXML-trueif the exported XML should be formatted to increase its legibility orfalseif it shouldn't.- Since:
- 9.2
-
run
public void run()Runs the SAS Foundation Services deployment exporter to write the configuration to the specified file using UTF-8 encoding.If this method is invoked synchronously one may determine if the export was successful by checking to see if a ServiceException occurred using
getServiceException().If this method is invoked asynchronously one may determine if the export was successful by registering an observer using
addObserver(Observer)and checking to see if a ServiceException occurs.- Specified by:
runin interfaceRunnable- Overrides:
runin classThread- Since:
- 9.2
- See Also:
-
newStoreWithCopyOfServiceDeployment
public static com.sas.metadata.remote.MdObjectStore newStoreWithCopyOfServiceDeployment(com.sas.metadata.remote.SoftwareComponent softwareComponent) throws IllegalArgumentException, ServiceException Gets a metadata object store that has been populated with a copy of the foundation service deployment configuration metadata.- Parameters:
softwareComponent- MetadataSoftwareComponentrepresenting a services deployment configuration.- Returns:
- SoftwareComponent that is a duplicate of the
original except that its in a new metadata store
and all of the IDs and ObjRefs are temporary.
Note that the caller is responsible for
disposing the object store associated with this
duplicated SoftwareComponent. A
nullis returned if unable to obtain a duplicate. - Throws:
IllegalArgumentException- if anullservice component is specified.ServiceException- if unable to create a new object store with containing a copy of the service deployment.- Since:
- 9.2
-
setExportDestinationFile
public void setExportDestinationFile(File exportDestinationFile) throws IllegalArgumentException Sets the file to which the SAS Foundation Services deployment should be exported.- Parameters:
exportDestinationFile- File to which the SAS Foundation Services deployment is to be exported using UTF-8 encoding.- Throws:
IllegalArgumentException- if an invalid file is specified.- Since:
- 9.2
-
getServiceException
Gets the service exception, if any, that occurred when exporting the foundation service deployment.- Returns:
- ServiceException or
nullif the export succeeded. - Since:
- 9.2
-
addObserver
public void addObserver(Observer observer) Adds an observer that desires to be notified when the export operation has concluded, so that one can determine whether aServiceExceptionhas occurred.- Parameters:
observer- Observer to be added.- Since:
- 1.0
-
deleteObserver
public void deleteObserver(Observer observer) Removes an observer that no longer desires to be notified when the export operation has concluded.- Parameters:
observer- Observer to be removed.- Since:
- 1.0
-
main
public static void main(String[] args) -
exportDeployment
Method for an application which is used to export metadata describing a SAS Foundation Service deployment from a SAS Metadata Repository to a UTF-8 encoded XML file. Command line options used to run this application are summarized below.SAS Foundation Service Deployment
When exporting metadata describing a SAS Foundation Services deployment, one must identify the service deployment by specifying its name and the name of the file to which the metadata is to be written.The services deployment file can be exported by the Foundation Services Manager plug-in to the SAS Management Console.
SAS Foundation Service Command Line Options SAS Foundation Services Option Description -serviceDeploymentNameName of the SAS Foundation Services deployment (SoftwareComponent.Name) whose metadata is to be exported from the SAS Metadata Server to a file -serviceDeploymentFileName of the file to which the SAS Foundation Services deployment metadata is to be written. A UTF-8 encoded XML file will be created. Metadata Server
One must specify the SAS Metadata Server and the desired connection approach.
- Parameters:
args- Command line arguments specifying how to connect to the metadata server, whether a login credential or SSPI is used, the configuration directory for the services deployment and the name of the application whose service configurations are to be installed or uninstalled.- -metaserver <server>
- -metaport <port>
- -metarepository <repository>
- -serviceDeploymentName <serviceDeploymentName>
- -serviceDeploymentFile <serviceDeploymentFile>
- Connection
- using a Login Credential
- -metauser <userID>
- -metapass <password> or -password_on_stdin true (and specify -metapass via stdin)
- using SSPI
- -secpackagelist <secpackagelist>
- -metaspn <spn> (optional)
- using a Login Credential
One may optionally specify whether an option prompt is presented by specifying the command line option
-isPrompting <true|false>- Throws:
ServiceException- if unable to export the deployment.- Since:
- 9.2
-
exportServiceDeployment
public static void exportServiceDeployment(com.sas.metadata.remote.SoftwareComponent softwareComponent, String fileName, boolean isOverwriteFile) throws ServiceException Exports a SAS Foundation Services deployment from the metadata server to a UTF-8 encoded XML file.- Parameters:
softwareComponent- The metadata object that represents the SAS Foundation Services deployment which is to be exported from the SAS Metadata Server.fileName- The name of the SAS Foundation Services deployment file to which the SAS Foundation Services deployment metadata is to be exported from the SAS Metadata Server.isOverwriteFile-trueif it is OK to overwrite the export file if it already exists orfalseif an exception should be thrown if the file exists.- Throws:
ServiceException- if an exception is encountered.- Since:
- 9.2
-