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

com.sas.services.deployment
Class ServiceDeploymentDeleter

com.sas.services.deployment.ServiceDeploymentDeleter

public final class ServiceDeploymentDeleter

Utility used to delete a SAS Foundation Services deployment from a SAS Metadata Repository.
Usage Example: Delete SAS Foundation Services Deployment
 import com.sas.metadata.remote.SoftwareComponent;
 import com.sas.services.ServiceException;
 import com.sas.services.deployment.ServiceDeploymentDeleter;
 
 void deleteServiceDeployment (
    SoftwareComponent softwareComponent serviceDeployment)
    throws ServiceException {
 
    ServiceDeploymentDeleter deleter =
      new ServiceDeploymentDeleter(serviceDeployment);
    deleter.delete();
 
 }
 

Since:
9.2

Constructor Summary
ServiceDeploymentDeleter(com.sas.metadata.remote.SoftwareComponent softwareComponent)
          Constructs an instance of a utility that can be used to delete a SAS Foundation Services deployment.
 
Method Summary
protected  void addDeletionTemplates(java.util.Map<java.lang.String,java.lang.String> deletionTemplateMap)
          Adds deletion templates necessary to delete the following: service component named services localized resources properties (Property) property's stored configuration (TextStore)
 void delete()
          Delete this metadata ServiceComponent representing a foundation service.
static void deleteDeployment(java.lang.String[] args)
          Main method for an application which is used to delete a SAS Foundation Services deployment from a SAS Metadata Repository.
protected  void deleteMetadataObjects(java.util.List<com.sas.metadata.remote.CMetadata> deletedObjects)
          Deletes the metadata objects specified in the list.
protected static void deleteProperties(com.sas.metadata.remote.Root root, java.util.List<com.sas.metadata.remote.CMetadata> deletedObjects)
          Removes properties from the metadata object by collecting the Property, its owning PropertyType, and its stored configuration Text eligible for deletion.
protected static void deleteProperty(com.sas.metadata.remote.Property property, java.util.List<com.sas.metadata.remote.CMetadata> deletedObjects)
          Removes properties from the metadata object by collecting the Property, its owning PropertyType, and its stored configuration Text eligible for deletion.
static void deleteServiceDeployment(com.sas.metadata.remote.MdStore mdStore, java.lang.String repositoryName, java.lang.String serviceDeploymentName)
          Deletes the SAS Foundation Services deployment from the metadata server.
static void deleteServiceDeploymentForID(com.sas.metadata.remote.MdStore mdStore, java.lang.String repositoryName, java.lang.String serviceDeploymentID)
          Deletes the SAS Foundation Services deployment from the metadata server which matches the specified FQID (SoftwareComponent.Id).
protected static java.lang.String getDeleteTemplateDeployedComponent()
          Gets a deletion template for a DeployedComponent.
protected static java.lang.String getDeleteTemplateEvent()
          Gets a deletion template for an Event.
protected static java.lang.String getDeleteTemplateLocalizedResource()
          Gets a deletion template for a localized resource.
protected static java.lang.String getDeleteTemplateNamedService()
          Gets a deletion template for a named service.
protected static java.lang.String getDeleteTemplateProperty()
          Gets a deletion template for a DeployedComponent.
protected static java.lang.String getDeleteTemplateTextStore()
          Gets a deletion template for a DeployedComponent.
protected  com.sas.metadata.remote.Root getRoot()
          Gets the metadata object which is to be deleted.
static void main(java.lang.String[] args)
          Main method for an application which is used to delete a SAS Foundation Services deployment from a SAS Metadata Repository.
protected  void verifyIsOKToDelete()
          Verify whether or not it is OK to delete the metadata object.
 

Constructor Detail

ServiceDeploymentDeleter

public ServiceDeploymentDeleter(com.sas.metadata.remote.SoftwareComponent softwareComponent)
Constructs an instance of a utility that can be used to delete a SAS Foundation Services deployment.

Parameters:
softwareComponent - The SAS Foundation Services deployment that is to be deleted.
Throws:
java.lang.IllegalArgumentException - if an invalid service deployment is specified.
Since:
9.2
Method Detail

addDeletionTemplates

protected void addDeletionTemplates(java.util.Map<java.lang.String,java.lang.String> deletionTemplateMap)
                             throws ServiceException
Adds deletion templates necessary to delete the following:

Parameters:
deletionTemplateMap - Map keyed by a deletion template to a deletion template.
Throws:
ServiceException - if an exception occurred while attempting to delete the foundation services deployment.

deleteMetadataObjects

protected void deleteMetadataObjects(java.util.List<com.sas.metadata.remote.CMetadata> deletedObjects)
                              throws ServiceException
Deletes the metadata objects specified in the list. A sub-class should collect the necessary metadata objects which need to be deleted and then call this method to execute the deletion.

Parameters:
deletedObjects - Metadata objects to be deleted.
Throws:
ServiceException - if an exception occurred while attempting to delete the foundation services deployment.

main

public static void main(java.lang.String[] args)
Main method for an application which is used to delete a SAS Foundation Services deployment from a SAS Metadata Repository.

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 deleted from the SAS Metadata Server to a file
-serviceDeploymentID FQID of the SAS Foundation Services deployment (SoftwareComponent.Id) whose metadata is to be deleted from the SAS Metadata Server to a file

Metadata Server

One must specify the SAS Metadata Server and the desired connection approach.

Parameters:
args - Command line arguments specifying the metadata server, the name of the services deployment to be deleted.
  • -metaserver <server>
  • -metaport <port>
  • -metarepository <repository>
  • -serviceDeploymentID <serviceDeploymentID> | -serviceDeploymentName <serviceDeploymentName>
  • Connection
    • using a Login Credential
      • -metauser <userID>
      • -metapass <password> | -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

deleteDeployment

public static void deleteDeployment(java.lang.String[] args)
                             throws ServiceException
Main method for an application which is used to delete a SAS Foundation Services deployment from a SAS Metadata Repository.
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 deleted from the SAS Metadata Server to a file
-serviceDeploymentID FQID of the SAS Foundation Services deployment (SoftwareComponent.Id) whose metadata is to be deleted from the SAS Metadata Server to a file

Metadata Server

One must specify the SAS Metadata Server and the desired connection approach.

Parameters:
args - Command line arguments specifying the metadata server and either the ID or name of the services deployment to be deleted.
  • -metaserver <server>
  • -metaport <port>
  • -metarepository <repository>
  • -serviceDeploymentName <serviceDeploymentID> | -serviceDeploymentName <serviceDeploymentName>
  • Connection
    • using a Login Credential
      • -metauser <userID>
      • -metapass <password> | -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 delete the deployment.
Since:
9.2

deleteServiceDeployment

public static void deleteServiceDeployment(com.sas.metadata.remote.MdStore mdStore,
                                           java.lang.String repositoryName,
                                           java.lang.String serviceDeploymentName)
                                    throws ServiceException
Deletes the SAS Foundation Services deployment from the metadata server.

Parameters:
mdStore - Metadata store whose factory has a connection to the metadata server.
repositoryName - The name of the metadata repository that contains the SAS Foundation Services deployment that is to be deleted.
serviceDeploymentName - The name of the SAS Foundation Services deployment that is to be deleted from the SAS Metadata Server.
Throws:
ServiceException - if an exception is encountered.
Since:
9.2

deleteServiceDeploymentForID

public static void deleteServiceDeploymentForID(com.sas.metadata.remote.MdStore mdStore,
                                                java.lang.String repositoryName,
                                                java.lang.String serviceDeploymentID)
                                         throws ServiceException
Deletes the SAS Foundation Services deployment from the metadata server which matches the specified FQID (SoftwareComponent.Id).

Parameters:
mdStore - Metadata store whose factory has a connection to the metadata server.
repositoryName - The name of the metadata repository that contains the SAS Foundation Services deployment that is to be deleted.
serviceDeploymentID - The FQID (SoftwareComponent.Id) of the SAS Foundation Services deployment that is to be deleted from the SAS Metadata Server.
Throws:
ServiceException - if an exception is encountered.
Since:
9.3

getDeleteTemplateDeployedComponent

protected static final java.lang.String getDeleteTemplateDeployedComponent()
Gets a deletion template for a DeployedComponent.

Returns:
Deletion template for a deployed component.

getDeleteTemplateEvent

protected static final java.lang.String getDeleteTemplateEvent()
Gets a deletion template for an Event.

Returns:
Deletion template for an event.

getDeleteTemplateLocalizedResource

protected static final java.lang.String getDeleteTemplateLocalizedResource()
Gets a deletion template for a localized resource.

Returns:
Deletion template for a localized resource.

getDeleteTemplateNamedService

protected static final java.lang.String getDeleteTemplateNamedService()
Gets a deletion template for a named service.

Returns:
Deletion template for a named service.

getDeleteTemplateTextStore

protected static final java.lang.String getDeleteTemplateTextStore()
Gets a deletion template for a DeployedComponent.

Returns:
Deletion template for a deployed component.

getDeleteTemplateProperty

protected static final java.lang.String getDeleteTemplateProperty()
Gets a deletion template for a DeployedComponent.

Returns:
Deletion template for a deployed component.

delete

public void delete()
            throws DependentServicesException,
                   ServiceException
Delete this metadata ServiceComponent representing a foundation service. Note that no other services must depend upon this service or else this deletion request will be rejected.

Throws:
DependentServicesException - if the request to delete the service was denied because another service depends upon the service being deleted.
ServiceException - if unable to delete the service.

verifyIsOKToDelete

protected void verifyIsOKToDelete()
                           throws ServiceException
Verify whether or not it is OK to delete the metadata object. A sub-class should override this method to provide necessary deletion verification logic.

Throws:
ServiceException - if it is not OK to delete the metadata object.

deleteProperties

protected static final void deleteProperties(com.sas.metadata.remote.Root root,
                                             java.util.List<com.sas.metadata.remote.CMetadata> deletedObjects)
                                      throws com.sas.metadata.remote.MdException
Removes properties from the metadata object by collecting the Property, its owning PropertyType, and its stored configuration Text eligible for deletion.

Parameters:
root - The metadata object whose properties are to be cleared.
deletedObjects - List of CMetadata objects which are to be deleted. This list will be updated with objects which should be deleted.
Throws:
com.sas.metadata.remote.MdException - if unable to determine which objects need to be deleted.

deleteProperty

protected static final void deleteProperty(com.sas.metadata.remote.Property property,
                                           java.util.List<com.sas.metadata.remote.CMetadata> deletedObjects)
                                    throws com.sas.metadata.remote.MdException
Removes properties from the metadata object by collecting the Property, its owning PropertyType, and its stored configuration Text eligible for deletion.

Parameters:
property - A metadata property which is to be deleted.
deletedObjects - List of CMetadata objects which are to be deleted. This list will be updated with objects which should be deleted.
Throws:
com.sas.metadata.remote.MdException - if unable to determine which objects need to be deleted.

getRoot

protected final com.sas.metadata.remote.Root getRoot()
Gets the metadata object which is to be deleted.

Returns:
Metadata object.

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




Copyright © 2009 SAS Institute Inc. All Rights Reserved.