com.ibm.datapower.wamt.dataAPI.local.filesystem
Class StoredDeploymentPolicyImpl

java.lang.Object
  extended by com.ibm.datapower.wamt.dataAPI.local.filesystem.StoredDeploymentPolicyImpl
All Implemented Interfaces:
Persistable, StoredDeployablePolicy, StoredDeploymentPolicy

public class StoredDeploymentPolicyImpl
extends java.lang.Object
implements StoredDeploymentPolicy

The deployment policy information includes the domain configuration blob, the policy type, the policy source, and the associated domain name. It is a container for all the deployed versions of this StoredDeploymentPolicy. Below is a sample of a persisted deployment policy.

 
 <deploymentPolicy xmi:id="DPPolicy_0" highestVersion="1" policyName="lathas" SynchDate="1276806718906" SourceURL="file:///C:/DataPower2010/DatapowerTest/lathasdomain.zip" policyType="EXPORT" domainName="lathas">
     ...
 </deploymentPolicy>
 
 

See Also:
StoredDeploymentPolicy

Field Summary
 
Fields inherited from interface com.ibm.datapower.wamt.dataAPI.StoredDeploymentPolicy
COPYRIGHT_2009_2010, SCM_REVISION
 
Method Summary
 void delete()
          Deletes this StoredDeployablePolicy.
 StoredDomain getDomain()
          Gets the name of the StoredDomain that contains this StoredDeploymentPolicy.
 int getHighestVersionNumber()
          Gets the highest version number that has EVER been used for a version of this object.
 long getLastModifiedOfDeployedSource()
          Gets the "last modified" timestamp of the policy source persisted on this deployment policy object.
 java.lang.String getPolicyDomainName()
           Note: For the Local File System implementation, the policy domain name is stored as an attribute on the deploymentPolicy element.
 java.lang.String getPolicyName()
           Note: In the Local File System implementation, the policy name is stored as an attribute on the deploymentPolicy element.
 DeploymentPolicyType getPolicyType()
           Note: In the Local File System implementation, the policy type is stored as an attribute on the deploymentPolicy element.
 URLSource getPolicyURL()
          Returns the domain configuration source that was persisted on this DeploymentPolicy object.
 java.lang.String getPrimaryKey()
           Note: The Local File System implementation combines the containing domain identifier with the policy name on this StoredDeploymentPolicy as the unique identifier of this object.
 StoredDeploymentPolicyVersion getVersion(int versionNumber)
          Gets the DeploymentPolicyVersion object with the specified version number.
 StoredDeploymentPolicyVersion[] getVersions()
          Gets the versions of the specified StoredDeployablePolicy from the repository.
 void setLastModifiedOfDeployedSource(long synchDate)
           Note: In the Local File System implementation, the synchDate is stored as an attribute on the deploymentPolicy element.
 void setPolicyDomainName(java.lang.String policyDomainName)
          Sets the Domain name that is to find the deployment domain within the configuration URLSource which will be deployed on the device
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

delete

public void delete()
            throws DatastoreException,
                   NotEmptyInRepositoryException
Description copied from interface: StoredDeployablePolicy
Deletes this StoredDeployablePolicy. The StoredDeploymentPolicy will be removed from the StoredDomain that contains it. The logic to create and remove the StoredDeploymentPolicy is handled by the clientAPI and is not visible via the clientAPI. This is invoked from Device.removeManagedDomain(String)

Note: The Local File System implementation clears the StoredDeploymetPolicy object and removes the element from the WAMT.repository.xml file. It does not remove any contained elements. The logic to remove the contained elements is handled in the clientAPI.

Specified by:
delete in interface StoredDeployablePolicy

getPolicyName

public java.lang.String getPolicyName()

Note: In the Local File System implementation, the policy name is stored as an attribute on the deploymentPolicy element.

Specified by:
getPolicyName in interface StoredDeploymentPolicy
Returns:
the policy name set on this StoredDeploymentPolicy to index into the persisted configuration source

getPrimaryKey

public java.lang.String getPrimaryKey()

Note: The Local File System implementation combines the containing domain identifier with the policy name on this StoredDeploymentPolicy as the unique identifier of this object.

Specified by:
getPrimaryKey in interface Persistable
Specified by:
getPrimaryKey in interface StoredDeploymentPolicy
Returns:
the unique identifier for this object
See Also:
StoredDeploymentPolicy.getPolicyName()

getDomain

public StoredDomain getDomain()
Description copied from interface: StoredDeploymentPolicy
Gets the name of the StoredDomain that contains this StoredDeploymentPolicy. There is only one DeploymentPolicy persisted for each Domain. This name should be human-consumable. This is exposed by DeploymentPolicy.getDomain()

Specified by:
getDomain in interface StoredDeploymentPolicy
Returns:
StoredDomain return the containing StoredDomain object.
See Also:
StoredDomain

getVersion

public StoredDeploymentPolicyVersion getVersion(int versionNumber)
Description copied from interface: StoredDeploymentPolicy
Gets the DeploymentPolicyVersion object with the specified version number. This is invoked by DeploymentPolicy.getVersion(int)

Specified by:
getVersion in interface StoredDeploymentPolicy
Returns:
StoredDeploymentPolicyVersion if found, otherwise return

getVersions

public StoredDeploymentPolicyVersion[] getVersions()
Description copied from interface: StoredDeployablePolicy
Gets the versions of the specified StoredDeployablePolicy from the repository. This is invoked from DeploymentPolicy.getVersions()

Specified by:
getVersions in interface StoredDeployablePolicy
Returns:
the Versions of the specified StoredDeployablePolicy. The array is in chronological order with the oldest version first in the array.

getHighestVersionNumber

public int getHighestVersionNumber()
Description copied from interface: StoredDeployablePolicy
Gets the highest version number that has EVER been used for a version of this object. Used to create unique identifiers for the versions of this object. It is OK for this number to wrap as long as it doesn't create duplicated identifiers among the current set of versions. The version number is calculated and maintained by the repository and there is no setHighestVersion. This is called by DeploymentPolicy.getHighestVersionNumber()

Specified by:
getHighestVersionNumber in interface StoredDeployablePolicy
Returns:
The highest version number that has EVER been for a version of this object

getPolicyDomainName

public java.lang.String getPolicyDomainName()

Note: For the Local File System implementation, the policy domain name is stored as an attribute on the deploymentPolicy element.

Specified by:
getPolicyDomainName in interface StoredDeploymentPolicy
Returns:
the policy domain name that serves as an "index" into the configuration source, and points to the domain within the domain configuration blob.
See Also:
DeploymentPolicy.setPolicyExport(URLSource, String, String)

setPolicyDomainName

public void setPolicyDomainName(java.lang.String policyDomainName)
Description copied from interface: StoredDeploymentPolicy
Sets the Domain name that is to find the deployment domain within the configuration URLSource which will be deployed on the device

Specified by:
setPolicyDomainName in interface StoredDeploymentPolicy
Parameters:
policyDomainName - domain name that is used index into the configuration source and point to the domain within the configuration source.
See Also:
StoredDeploymentPolicy.getPolicyDomainName()

getPolicyURL

public URLSource getPolicyURL()
Description copied from interface: StoredDeploymentPolicy
Returns the domain configuration source that was persisted on this DeploymentPolicy object. This can be set by invoking

Note: In the Local File System implementation, the policy domain name is stored as an string attribute on the policydeployment element.

Specified by:
getPolicyURL in interface StoredDeploymentPolicy
Returns:
the configuration URLSource for this StoredDeploymentPolicy

getPolicyType

public DeploymentPolicyType getPolicyType()

Note: In the Local File System implementation, the policy type is stored as an attribute on the deploymentPolicy element.

Specified by:
getPolicyType in interface StoredDeploymentPolicy
Returns:
the Deployment Policy Type on this object
See Also:
DeploymentPolicyType.EXPORT, DeploymentPolicyType.XML, DeploymentPolicyType.NONE

setLastModifiedOfDeployedSource

public void setLastModifiedOfDeployedSource(long synchDate)

Note: In the Local File System implementation, the synchDate is stored as an attribute on the deploymentPolicy element.

Specified by:
setLastModifiedOfDeployedSource in interface StoredDeploymentPolicy
Parameters:
synchDate - time stamp on the configuration source file
See Also:
StoredDeploymentPolicy.getLastModifiedOfDeployedSource()

getLastModifiedOfDeployedSource

public long getLastModifiedOfDeployedSource()
Description copied from interface: StoredDeploymentPolicy
Gets the "last modified" timestamp of the policy source persisted on this deployment policy object. This retrieved timestamp can be used to determine if the policy source has a more recent timestamp than the persisted timestamp. If the policy source has a more recent timestamp than the persisted timestamp, the manager may synchronize the domain if other conditions are also met. This is for internal use only.

Specified by:
getLastModifiedOfDeployedSource in interface StoredDeploymentPolicy
Returns:
timestamp on the StoredDeploymentPolicy
See Also:
StoredDeploymentPolicy.setLastModifiedOfDeployedSource(long)


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