com.ibm.datapower.wamt.clientAPI
Class DeploymentPolicy

java.lang.Object
  extended by com.ibm.datapower.wamt.clientAPI.DeploymentPolicy
All Implemented Interfaces:
Versionable

public class DeploymentPolicy
extends java.lang.Object
implements Versionable

This class represents the deployment policy that is to be applied to a Domain during deployment. This deployment policy will not reside on the DataPower device after domain deployment because it is only applied at deploy-time.

This behavior of this class is controlled by the Domain class, and as such, all of the methods in this class are for internal use only.

A DeploymentPolicy is tightly coupled with a Domain. When a Domain object is created an empty DeploymentPolicy object is created within it. The settings for a deployment policy must be specified via the setDeploymentPolicy(url, policydomain, policyObjectName) method on Domain. Calling setDeploymentPolicy(null, null, null) on Domain sets the DeploymentPolicy to an empty state.

When calling setPolicyExport on Domain, the URLSource is a reference to a configuration blob from a device, the domainName and policyObjectName serve as an "index" into the blob, pointing to the domain, and associated deployment policy within the blob. The domainName specified does not have to match the name of the Domain that owns this DeploymentPolicy object.

See Also:
Domain, DeploymentPolicyVersion

Field Summary
static java.lang.String COPYRIGHT_2009_2013
           
 
Fields inherited from interface com.ibm.datapower.wamt.clientAPI.Versionable
COPYRIGHT_2009_2010, SCM_REVISION
 
Method Summary
 java.lang.String getAbsoluteDisplayName()
          Get a human-readable name that represents this object.
 byte[] getCachedBytes()
           
 Domain getDomain()
           
 int getHighestVersionNumber()
          Get the highest version number of all the DeploymentPolicyVersions in this DeploymentPolicy.
 java.lang.String getName()
          Only used for stored instance.
 java.lang.String getPolicyDomainName()
          Returns the name of the domain that contains the deployment policy in the blob.
 java.lang.String getPolicyObjectName()
          Returns the name of the deployment policy object to use.
 DeploymentPolicyType getPolicyType()
          Returns the deployment policy enum type.
 URLSource getPolicyURLSource()
          Returns the policy URL source.
 java.lang.String getPrimaryKey()
           
 java.lang.String getRelativeDisplayName()
          Get a human-readable name that represents this object.
 DeploymentPolicyVersion getVersion(int targetVersionNumber)
          Get the specified Version of this Versionable object.
 DeploymentPolicyVersion[] getVersions()
          Get all the versions that exist of this Versionable object.
 void setPolicyExport(URLSource url, java.lang.String policyDomain, java.lang.String policyObjName)
          When calling setPolicyExport, the URLSource is a reference to the configuration blob, the domainName and policyObjectName serve as an "index" into the blob, pointing to the domain, and associated deployment policy within the blob.
 void setPolicyNone()
          This method is called when null parameters are passed to setDeploymentPolicy(null, null, null) in Domain
 void setPolicyXML(URLSource url)
          When calling setPolicyXML, the URLSource is a reference to a deployment policy in XML format.
 java.lang.String toString()
          Get a String representation of this object for the purpose of debugging or tracing.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT_2009_2013

public static final java.lang.String COPYRIGHT_2009_2013
See Also:
Constant Field Values
Method Detail

setPolicyExport

public void setPolicyExport(URLSource url,
                            java.lang.String policyDomain,
                            java.lang.String policyObjName)
                     throws DeletedException,
                            AlreadyExistsInRepositoryException,
                            DatastoreException,
                            InvalidParameterException
When calling setPolicyExport, the URLSource is a reference to the configuration blob, the domainName and policyObjectName serve as an "index" into the blob, pointing to the domain, and associated deployment policy within the blob. The domainName specified does not have to match the name of the Domain that owns this DeploymentPolicy object.

Parameters:
url - - is a URLSource that points to a configuration blob. This parameter is required.
policyDomain - - this is the first piece of information used to find the deployment policy within the configuration source specified by the URLSource. This parameter is only required if the source is a backup, since a backup may contain multiple domains.
policyObjName - - this is the second piece of information used to find the deployment policy within the configuration source specified by the URLSource. This parameter is required.

setPolicyXML

public void setPolicyXML(URLSource url)
                  throws DeletedException,
                         DatastoreException,
                         InvalidParameterException
When calling setPolicyXML, the URLSource is a reference to a deployment policy in XML format. The XML must follow the schema for the deployment-policy type in the AMP protocol. Below is an example deployment policy in XML:

<Policy> <ModifiedConfig> <Match>*&#047;*&#047;wsm&#047;wsm-endpointrewrite?Name=simplyWSP&amp;Property=WSEndpointRemoteRewriteRule/RemoteEndpointPort&amp;Value=12345</Match> <Type>change</Type> <Property/> <Value>12345</Value> </ModifiedConfig> <ModifiedConfig> <Match>*&#047;*&#047;wsm&#047;wsm-endpointrewrite?Name=simplyWSP&amp;Property=WSEndpointRemoteRewriteRule/RemoteEndpointHostname&amp;Value=.*</Match> <Type>change</Type> <Property/> <Value>new.hostname.value</Value> </ModifiedConfig> </Policy>

Parameters:
url - - is a URLSource that points to a deployment policy in XML format. This parameter is required.

setPolicyNone

public void setPolicyNone()
                   throws DeletedException,
                          AlreadyExistsInRepositoryException,
                          DatastoreException
This method is called when null parameters are passed to setDeploymentPolicy(null, null, null) in Domain


getCachedBytes

public byte[] getCachedBytes()

getPolicyType

public DeploymentPolicyType getPolicyType()
                                   throws DeletedException
Returns the deployment policy enum type.


getPolicyURLSource

public URLSource getPolicyURLSource()
                             throws DeletedException
Returns the policy URL source.


getPolicyDomainName

public java.lang.String getPolicyDomainName()
                                     throws DeletedException
Returns the name of the domain that contains the deployment policy in the blob.


getPolicyObjectName

public java.lang.String getPolicyObjectName()
                                     throws DeletedException
Returns the name of the deployment policy object to use.


getName

public java.lang.String getName()
                         throws DeletedException
Only used for stored instance.


getDomain

public Domain getDomain()
                 throws DeletedException

getPrimaryKey

public java.lang.String getPrimaryKey()
                               throws DeletedException

getVersions

public DeploymentPolicyVersion[] getVersions()
                                      throws DeletedException
Description copied from interface: Versionable
Get all the versions that exist of this Versionable object.

This object should implement the Versionable interface, and versions of this object should implement the Version interface.

Specified by:
getVersions in interface Versionable
Returns:
an array of objects which describe all the versions of this object.
See Also:
Versionable.getVersion(int)

getVersion

public DeploymentPolicyVersion getVersion(int targetVersionNumber)
                                   throws DeletedException
Description copied from interface: Versionable
Get the specified Version of this Versionable object. Versions are specified by a version number, which is a monotomically increasing integer that should be unique across this Versionable object.

Specified by:
getVersion in interface Versionable
Parameters:
targetVersionNumber - the specified version to get of this object.
Returns:
the specified version of this object. May return null if no version of the specified number exists.
See Also:
Versionable.getVersions()

getHighestVersionNumber

public int getHighestVersionNumber()
                            throws DeletedException
Get the highest version number of all the DeploymentPolicyVersions in this DeploymentPolicy.

Returns:
the highest version number of all the DeploymentPolicyVersions.

toString

public java.lang.String toString()
Get a String representation of this object for the purpose of debugging or tracing.

Overrides:
toString in class java.lang.Object
Returns:
a String representation of this object for the purpose of debugging or tracing.

getRelativeDisplayName

public java.lang.String getRelativeDisplayName()
Get a human-readable name that represents this object. This name may be used in user interfaces. This name is relative to the context of a Device.

Returns:
a human-readable name that represents this object. For example, "domain1".

getAbsoluteDisplayName

public java.lang.String getAbsoluteDisplayName()
Get a human-readable name that represents this object. This name may be used in user interfaces. This name is absolute to the context of the system.

Returns:
a human-readable name that represents this object. For example "DeploymentPolicy: URL Source:file:///C:/DP/policydefaultdp12.zip, Policy Domain Name:default, Policy Object Name:policy1 for Domain:domain1 on Device:dp12.raleighnc.ibm.com/9.42.102.11 in Managed Set:set1".


© Copyright IBM Corp. 2006, 2010 All Rights Reserved.