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

com.sas.services.deployment
Class ServiceDeploymentImportFile

java.lang.Object
  |
  +--com.sas.services.deployment.ServiceDeploymentImportFile

public class ServiceDeploymentImportFile
extends Object

This class represents a foundation services deployment file that was exported from a SAS Metadata foundation repository. The Foundation Services Manager plug-in to the SAS Management Console provides the capability to export a services deployment.

The services deployment file is a UTF-8 encoded XML that contains SAS metadata describing an application's foundation services deployment. This file may be later imported into a SAS Metadata Repository.

The name of the service deployment may be changed by designating a new name using setServiceDeploymentName(String name). This capability can be used to rename a foundation services deployment (SoftwareComponent.Name) that is being imported into a SAS Metadata foundation repository.

Usage Example: Create a file that can be imported
 import java.io.File;

 ...
 
 // specify the file containing the foundation services deployment
 // metadata created using the Foundation Services Manager plug-in
 // and the fully qualified SAS Metadata Repository ID.
 ServiceDeploymentImportFile serviceDeploymentImportFile =
   new ServiceDeploymentImportFile(new File(filePath));

 // rename the foundation services deployment (i.e. the SoftwareComponent.Name)
 // if desired
 String newName = "My Services Deployment";
 serviceDeploymentImportFile.setServiceDeploymentName(newName);
 
 // use the service deployment import file to import 
 // the deployment into a SAS Metadata Repository using
 // the ServiceDeploymentImporter
 ...
 
 

Since:
1.0

Constructor Summary
ServiceDeploymentImportFile(File importFile)
          Constructs a representation of a foundation service deployment import file.
ServiceDeploymentImportFile(InputStream inputStream)
          Constructs a representation of a foundation service deployment import file by reading metadata from an input stream.
 
Method Summary
 File getFile()
          Gets the file containing the foundation services deployment metadata that is to be imported into a SAS Metadata Repository.
 String getMetadata()
          Gets the foundation services deployment metadata from the file.
 String getServiceDeploymentName()
          Gets the name of the application's foundation services deployment.
 Set getServiceDeploymentSet()
          Deprecated. This methods access will be changed from public to private.
static String renameServiceDeployment(String inputXML, String newServiceDeploymentName)
          Takes a string representing an application's foundation services deployment metadata and updates the name of the SoftwareComponent to the newly specified name.
 void setServiceDeploymentName(String name)
          Sets the name of the application's foundation services deployment.
static ServiceException validateFile(File file)
          Determines whether or not the specified file contains a valid foundation services deployment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceDeploymentImportFile

public ServiceDeploymentImportFile(File importFile)
                            throws IllegalArgumentException
Constructs a representation of a foundation service deployment import file.
Parameters:
importFile - File containing a foundation service deployment that can be imported into a SAS Metadata Repository.
Throws:
IllegalArgumentException - if an invalid file is specified.

ServiceDeploymentImportFile

public ServiceDeploymentImportFile(InputStream inputStream)
                            throws IllegalArgumentException
Constructs a representation of a foundation service deployment import file by reading metadata from an input stream.
Parameters:
inputStream - Input stream from which foundation service deployment metadata is to be read for import into a SAS Metadata Repository. The input stream will be closed once its been read.
Throws:
IllegalArgumentException - if unable to obtain foundation services metadata from the specified input stream.
Method Detail

getFile

public final File getFile()
Gets the file containing the foundation services deployment metadata that is to be imported into a SAS Metadata Repository.
Returns:
File containing a foundation services deployment exported from a SAS Metadata Repository using the Foundation Services Manager plug-in.

getMetadata

public final String getMetadata()
                         throws ServiceDeploymentImportException
Gets the foundation services deployment metadata from the file.
Returns:
Foundation services deployment metadata read from the file or null if no data was defined.
Throws:
ServiceDeploymentImportException - if unable to read an application's foundation services deployment metadata from the specified XML formatted import file.

renameServiceDeployment

public static final String renameServiceDeployment(String inputXML,
                                                   String newServiceDeploymentName)
                                            throws IllegalArgumentException,
                                                   ServiceException
Takes a string representing an application's foundation services deployment metadata and updates the name of the SoftwareComponent to the newly specified name.
Parameters:
inputXML - XML representing a foundation services deployment.
newServiceDeploymentName - The new name for the foundation services deployment.
Returns:
XML representing the foundation services deployment that has been updated to use the new service deployment name.
Throws:
IllegalArgumentException - if invalid XML or name is specified.
ServiceException - if an exception was encountered renaming the service deployment.

getServiceDeploymentName

public final String getServiceDeploymentName()
Gets the name of the application's foundation services deployment.
Returns:
The application's foundation services deployment name or null if one is not defined. The name is obtained from the SoftwareComponent.Name attribute.

setServiceDeploymentName

public final void setServiceDeploymentName(String name)
Sets the name of the application's foundation services deployment.

This method updates an in-memory copy of the metadata read from the file and can be used to change the name of the deployment that is to be imported into a SAS Metadata Repository.

Parameters:
name - The application's foundation services deployment name.
Throws:
IllegalArgumentException - if an invalid name is specified.

validateFile

public static final ServiceException validateFile(File file)
Determines whether or not the specified file contains a valid foundation services deployment.
Parameters:
file - File to validate. A valid file is one that was created by the Foundation Services Manager.
Returns:
ServiceException if the file is invalid.

getServiceDeploymentSet

public final Set getServiceDeploymentSet()
Deprecated. This methods access will be changed from public to private.

Gets an XSL translated version of the foundation service deployment metadata from the file containing the Metadata element and only its SoftwareComponent element(s). Only the Name attribute of the SoftwareComponent is retrieved. All other data is discarded. The returned value is a well-formed XML string.
Returns:
XML string with a Metadata root element parenting 0..* SoftwareComponent elements.

***  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