All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Foundation |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

## com.sas.services.deployment
Class ServiceDeploymentExporter

    com.sas.services.deployment.ServiceDeploymentExporter

All Implemented Interfaces:
  java.lang.Runnable

    public final class ServiceDeploymentExporter

Exports a SAS Foundation Services deployment configuration from a SAS Metadata Repository to a UTF-8 encoded XML file.

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.

Usage Example: Export SAS Foundation Services Deployment Synchronously
     import java.io.File;
     import com.sas.metadata.remote.SoftwareComponent;
     import com.sas.services.ServiceException;

     void exportServiceDeploymentSynchronously (
        SoftwareComponent softwareComponent,
        File exportFile,
        boolean isBeautifyingXML)
        throws ServiceException {

        ServiceDeploymentExporter exporter = new ServiceDeploymentExporter(
           softwareComponent,
           exportFile,
           isBeautifyingXML);

        // run the export synchronously,
        // then check for an exception
        exporter.run();

        ServiceException exception = exporter.getException();
        if (exception != null) {
           // handle failure
        }
     }

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.

Usage Example: Export SAS Foundation Services Deployment Asynchronously
     import java.io.File;
     import java.util.Observable;
     import java.util.Observer;

     import com.sas.metadata.remote.SoftwareComponent;
     import com.sas.services.ServiceException;

     void exportServiceDeploymentAsynchronously (
        SoftwareComponent softwareComponent,
        File exportFile,
        boolean isBeautifyingXML) {

        ServiceDeploymentExporter exporter = new ServiceDeploymentExporter(
           softwareComponent,
           exportFile,
           isBeautifyingXML);

        // specify an observer which will need to check the object
        // to determine if a ServiceException has occurred

        Observer observer = new Observer() {

           public void notify(
              Observable observable,
              Object     object) {

              if (object != null) {
                 ServiceException svcEx = (ServiceException) e;
                 // handle export failure
              }

           }

        };

        exporter.addObserver(observer);
        exporter.start();

     }

Since:
  1.0

Constructor Summary
`ServiceDeploymentExporter(com.sas.metadata.remote.SoftwareComponent serviceDeployment, java.io.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, java.io.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
`void` | `addObserver(java.util.Observer observer)` Adds an observer that desires to be notified when the export operation has concluded, so that one can determine whether a `ServiceException` has occurred.
`void` | `deleteObserver(java.util.Observer observer)` Removes an observer that no longer desires to be notified when the export operation has concluded.
`static void` | `exportDeployment(java.lang.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 void` | `exportServiceDeployment(com.sas.metadata.remote.SoftwareComponent softwareComponent, java.lang.String fileName, boolean isOverwriteFile)` Exports a SAS Foundation Services deployment from the metadata server to a UTF-8 encoded XML file.
`ServiceException` | `getServiceException()` Gets the service exception, if any, that occurred when exporting the foundation service deployment.
`static void` | `main(java.lang.String[] args)` Main 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 com.sas.metadata.remote.MdObjectStore` | `newStoreWithCopyOfServiceDeployment(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.
`void` | `run()` Runs the SAS Foundation Services deployment exporter to write the configuration to the specified file using UTF-8 encoding.
`void` | `setExportDestinationFile(java.io.File exportDestinationFile)` Sets the file to which the SAS Foundation Services deployment should be exported.
`void` | `setIsBeautifyingXML(boolean isBeautifyingXML)` Specifies whether the XML should be beautified to make it more legible.

Constructor Detail

### ServiceDeploymentExporter

    public ServiceDeploymentExporter(com.sas.metadata.remote.SoftwareComponent serviceDeployment,
                                     java.io.File exportDestinationFile)
                              throws java.lang.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:
    `java.lang.IllegalArgumentException` - if unable to export the SAS Foundation Services deployment using the specified parameters.
  Since:
    9.2
  See Also:
    `ServiceDeploymentExporter(SoftwareComponent, File, boolean)`

### ServiceDeploymentExporter

    public ServiceDeploymentExporter(com.sas.metadata.remote.SoftwareComponent serviceDeployment,
                                     java.io.File exportDestinationFile,
                                     boolean isOKToOverwriteFile)
                              throws java.lang.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` - `true` if it is OK to overwrite the file or `false` if an exception should be thrown if the file already exists.
  Throws:
    `java.lang.IllegalArgumentException` - if unable to export the service deployment using the specified parameters.
  Since:
    9.2
  See Also:
    `ServiceDeploymentExporter(SoftwareComponent, File)`

Method Detail

### setIsBeautifyingXML

    public void setIsBeautifyingXML(boolean isBeautifyingXML)

  Specifies whether the XML should be beautified to make it more legible.

  Parameters:
    `isBeautifyingXML` - `true` if the exported XML should be formatted to increase its legibility or `false` if 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:
    `run` in interface `java.lang.Runnable`
  Overrides:
    `run` in class `java.lang.Thread`
  Since:
    9.2
  See Also:
    `Runnable.run()`

### newStoreWithCopyOfServiceDeployment

    public static com.sas.metadata.remote.MdObjectStore newStoreWithCopyOfServiceDeployment(com.sas.metadata.remote.SoftwareComponent softwareComponent)
                                                                                     throws java.lang.IllegalArgumentException,
                                                                                            ServiceException

  Gets a metadata object store that has been populated with a copy of the foundation service deployment configuration metadata.

  Parameters:
    `softwareComponent` - Metadata `SoftwareComponent` representing 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 `null` is returned if unable to obtain a duplicate.
  Throws:
    `java.lang.IllegalArgumentException` - if a `null` service 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(java.io.File exportDestinationFile)
                                  throws java.lang.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:
    `java.lang.IllegalArgumentException` - if an invalid file is specified.
  Since:
    9.2

### getServiceException

    public ServiceException getServiceException()

  Gets the service exception, if any, that occurred when exporting the foundation service deployment.

  Returns:
    ServiceException or `null` if the export succeeded.
  Since:
    9.2

### addObserver

    public void addObserver(java.util.Observer observer)

  Adds an observer that desires to be notified when the export operation has concluded, so that one can determine whether a `ServiceException` has occurred.

  Parameters:
    `observer` - Observer to be added.
  Since:
    1.0

### deleteObserver

    public void deleteObserver(java.util.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(java.lang.String[] args)

  Main 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
  --- | ---
  `-serviceDeploymentName` | Name of the SAS Foundation Services deployment (SoftwareComponent.Name) whose metadata is to be exported from the SAS Metadata Server to a file
  `-serviceDeploymentFile` | Name 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)

    One may optionally specify whether an option prompt is presented by specifying the command line option `-isPrompting <true|false>`

  Since:
    9.2

### exportDeployment

    public static void exportDeployment(java.lang.String[] args)
                                 throws ServiceException

  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
  --- | ---
  `-serviceDeploymentName` | Name of the SAS Foundation Services deployment (SoftwareComponent.Name) whose metadata is to be exported from the SAS Metadata Server to a file
  `-serviceDeploymentFile` | Name 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)

    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,
                                               java.lang.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` - `true` if it is OK to overwrite the export file if it already exists or `false` if an exception should be thrown if the file exists.
  Throws:
    `ServiceException` - if an exception is encountered.
  Since:
    9.2

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

All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Foundation |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 SAS Institute Inc. All Rights Reserved.