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

java.lang.Object
  extended by com.ibm.datapower.wamt.dataAPI.local.filesystem.StoredDomainImpl
All Implemented Interfaces:
Persistable, StoredDeployableConfiguration, StoredDomain

public class StoredDomainImpl
extends java.lang.Object
implements StoredDomain

The information that must be persisted for a StoredDomain on a DataPower device. This includes the Domain name, the device the domain resides on, synchronization mode, configuration source and the associated deployment policy. It is a container for all the StoredDomainVersions that are persisted in the local file system. When a domain is created an empty deploymentpolicy object is also created and persisted. Below is a sample domain element

 
 <domains xmi:id="DPDomain_0" highestVersion="1" name="lathas" SourceURL="device://9.42.112.79/latha" SynchDate="0" OutOfSynch="false" checkVersionSynch="false" quiesceTimeout="60" SyncMode="MANUAL">
   ...
 </domains>
 
 


Field Summary
 
Fields inherited from interface com.ibm.datapower.wamt.dataAPI.StoredDomain
COPYRIGHT_2009_2010, SCM_REVISION
 
Constructor Summary
StoredDomainImpl(java.util.Hashtable allDomains, StoredDevice device, java.lang.String domainName)
           
 
Method Summary
 void add(StoredTag tag)
          Add a tag to the domain.
 void addDomainPolicy(StoredDeploymentPolicyImpl domainPolicy)
           
 void addVersion(StoredDomainVersion version)
          Add a new StoredDomainVervion to this StoredDomain
 void delete()
          Deletes this StoredDeployableConfiguration.
 StoredDeploymentPolicy getDeploymentPolicy()
          Gets the Deployment Policy on this StoredDomain.
 StoredDevice getDevice()
           Note: In the Local File System implementation the domain element is contained within the device element on which the domain resides.
 int getHighestVersionNumber()
          Returns the highest version number that has EVER been used for a version of this object.
 long getLastModifiedOfDeployedSource()
          Internal use only.
 java.lang.String getName()
           Note: The Local File System implementation combines the domain name with the serial number of the containing StoredDevice as the unique identifier of this object.
 boolean getOutOfSynch()
          Internal Use Only

Gets the value of the OutOfSynch attribute on this StoreDomain.

 java.lang.String getPrimaryKey()
           Note: The Local File System uses The name of this StoredDomain combined with the Device primaryKey as the the unique identifier for this object
 int getQuiesceTimeout()
          Gets the persisted timeout value for quiescing a domain on the DataPower device.
 URLSource getSourceURL()
          Gets the configuration source location where the configuration is stored.
 DomainSynchronizationMode getSynchMode()
          Gets the Synchronization Mode on this StoredDomain.
 StoredTag[] getTags()
          Gets the tags for this domain.
 StoredVersion[] getVersions()
          Returns the versions of the specified StoredDeployableConfiguration from the repository.
 void remove(StoredTag tag)
          Remove the tags for this domain.
 void removeTags()
          Remove all tags for this domain.
 void setLastModifiedOfDeployedSource(long synchDate)
           Note: The Local File System persists time as an attribute on domains element.
 void setOutOfSynch(boolean outOfSynch)
          Internal use only Sets the value of the OutOfSynch attribute on the StoreDomain.
 void setQuiesceTimeout(int timeout)
          Sets the timeout value for quiescing a domain on the DataPower device before configuration deployment.
 void setSourceURL(URLSource urlSource)
          Sets the Configuration source on this StoredDomain.
 void setSynchMode(DomainSynchronizationMode synchMode)
          Sets the Synchronization Mode on this StoredDomain to AUTO or MANUAL.
 void updateDevice()
          Non-interface method to add this Domain to a DeviceImpls list of managed domains.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StoredDomainImpl

public StoredDomainImpl(java.util.Hashtable allDomains,
                        StoredDevice device,
                        java.lang.String domainName)
                 throws AlreadyExistsInRepositoryException
Method Detail

addDomainPolicy

public void addDomainPolicy(StoredDeploymentPolicyImpl domainPolicy)
                     throws DatastoreException

delete

public void delete()
            throws DatastoreException,
                   NotEmptyInRepositoryException
Description copied from interface: StoredDeployableConfiguration
Deletes this StoredDeployableConfiguration. The StoredDomain will be removed from the StoredDevice that contains it. This is invoked from Device.removeManagedDomain(String)

Note: The Local File System implementation clears the StoredDomain 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 StoredDeployableConfiguration

getName

public java.lang.String getName()

Note: The Local File System implementation combines the domain name with the serial number of the containing StoredDevice as the unique identifier of this object.

Specified by:
getName in interface StoredDomain
Returns:
the name of this StoredDomain
See Also:
StoredDomain.getPrimaryKey()

getPrimaryKey

public java.lang.String getPrimaryKey()

Note: The Local File System uses The name of this StoredDomain combined with the Device primaryKey as the the unique identifier for this object

Specified by:
getPrimaryKey in interface Persistable
Specified by:
getPrimaryKey in interface StoredDomain
Returns:
the unique identifier for this object

getDevice

public StoredDevice getDevice()

Note: In the Local File System implementation the domain element is contained within the device element on which the domain resides.

Specified by:
getDevice in interface StoredDomain
Returns:
the StoredDevice object

updateDevice

public void updateDevice()
Non-interface method to add this Domain to a DeviceImpls list of managed domains.


addVersion

public void addVersion(StoredDomainVersion version)
                throws AlreadyExistsInRepositoryException
Add a new StoredDomainVervion to this StoredDomain

Parameters:
version -

getVersions

public StoredVersion[] getVersions()
Description copied from interface: StoredDeployableConfiguration
Returns the versions of the specified StoredDeployableConfiguration from the repository. This is invoked from Domain.getVersions()

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

getHighestVersionNumber

public int getHighestVersionNumber()
Description copied from interface: StoredDeployableConfiguration
Returns 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 dataAPI implementation and there is no setHighestVersion. This is called by Domain.getHighestVersionNumber()

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

setSourceURL

public void setSourceURL(URLSource urlSource)
Description copied from interface: StoredDomain
Sets the Configuration source on this StoredDomain. This is invoked by Domain.setSourceConfiguration(URLSource)

Specified by:
setSourceURL in interface StoredDomain
Parameters:
urlSource - indicates the source for the configuration to be deployed to the Domain
See Also:
Domain.deployConfiguration(), Domain.setDeploymentPolicy(URLSource, String, String)

getSourceURL

public URLSource getSourceURL()
Description copied from interface: StoredDomain
Gets the configuration source location where the configuration is stored. This is invoked by Domain.getSourceConfiguration() and Domain.setSourceConfiguration(URLSource)

Specified by:
getSourceURL in interface StoredDomain
Returns:
the URLSource for this domain configuration source

getDeploymentPolicy

public StoredDeploymentPolicy getDeploymentPolicy()
Description copied from interface: StoredDomain
Gets the Deployment Policy on this StoredDomain. This is invoked by Domain.getDeploymentPolicy()

Specified by:
getDeploymentPolicy in interface StoredDomain
Returns:
the deployment policy for this domain
See Also:
Domain.setDeploymentPolicy(URLSource, String, String)

getSynchMode

public DomainSynchronizationMode getSynchMode()
Description copied from interface: StoredDomain
Gets the Synchronization Mode on this StoredDomain. This is invoked by Domain.getSynchronizationMode()

Specified by:
getSynchMode in interface StoredDomain
Returns:
synchronization mode persisted on the StoredDomain
See Also:
DomainSynchronizationMode.AUTO, DomainSynchronizationMode.MANUAL

setSynchMode

public void setSynchMode(DomainSynchronizationMode synchMode)
Description copied from interface: StoredDomain
Sets the Synchronization Mode on this StoredDomain to AUTO or MANUAL. This is invoked by Domain.setSynchronizationMode(DomainSynchronizationMode)

Specified by:
setSynchMode in interface StoredDomain
Parameters:
synchMode - a value of AUTO indicates the domain will be synchronized automatically
See Also:
DomainSynchronizationMode.AUTO, DomainSynchronizationMode.MANUAL

setLastModifiedOfDeployedSource

public void setLastModifiedOfDeployedSource(long synchDate)

Note: The Local File System persists time as an attribute on domains element.

Specified by:
setLastModifiedOfDeployedSource in interface StoredDomain
Parameters:
synchDate - time in milliseconds when the domain configuration is deployed and persisted in the repository
See Also:
StoredDomain.getLastModifiedOfDeployedSource()

getLastModifiedOfDeployedSource

public long getLastModifiedOfDeployedSource()
Description copied from interface: StoredDomain
Internal use only. Gets the time stamp (in milliseconds) on the domain source Configuration when it was last deployed. This timestamp is used to perform automatic domain synchronization when the DomainSynchronizationMode is set to DomainSynchronizationMode.AUTO. See StoredDomain.setLastModifiedOfDeployedSource(long) for details of how the timestamp is used for domain synchronization.

Specified by:
getLastModifiedOfDeployedSource in interface StoredDomain
Returns:
time in milliseconds
See Also:
StoredDomain.setLastModifiedOfDeployedSource(long)

getOutOfSynch

public boolean getOutOfSynch()
Description copied from interface: StoredDomain
Internal Use Only

Gets the value of the OutOfSynch attribute on this StoreDomain. A value of TRUE indicates that domain on the device is out of synch with the source configuration last deployed and persisted in the repository. The value is TRUE if users invoke any "set" method on Domain that causes the domain configuration to get out of synch.

Specified by:
getOutOfSynch in interface StoredDomain
Returns:
a value of true indicates the domain is not synchronized
See Also:
Domain.setSourceConfiguration(URLSource), Domain.setDeploymentPolicy(URLSource,String,String), Domain.setSynchronizationMode(DomainSynchronizationMode)

setOutOfSynch

public void setOutOfSynch(boolean outOfSynch)
Description copied from interface: StoredDomain
Internal use only Sets the value of the OutOfSynch attribute on the StoreDomain. The value is set to TRUE when set methods are called on the Domain and the domain on the device becomes out of synch with the configuration last deployed and persisted in the repository. This is set to FALSE when the domain is re-synched making the device domain configuration the same as the deployed domain configuration

Specified by:
setOutOfSynch in interface StoredDomain
Parameters:
outOfSynch - the value of true indicates the domain is not synchronized.
See Also:
Domain.setSourceConfiguration(URLSource), Domain.setDeploymentPolicy(URLSource,String,String), Domain.setSynchronizationMode(DomainSynchronizationMode)

setQuiesceTimeout

public void setQuiesceTimeout(int timeout)
Description copied from interface: StoredDomain
Sets the timeout value for quiescing a domain on the DataPower device before configuration deployment. This is invoked from Domain.setQuiesceTimeout(int). The time is used to This timeout value (in seconds) is used for checking the status of a domain quiesce or unquiesce operation. The quiesce operation is used on firmware versions 3.8.1 or higher to stop a domain before deploying source configuration or updating it.

Specified by:
setQuiesceTimeout in interface StoredDomain
Parameters:
timeout - value in seconds
See Also:
StoredDomain.getQuiesceTimeout()

getQuiesceTimeout

public int getQuiesceTimeout()
Description copied from interface: StoredDomain
Gets the persisted timeout value for quiescing a domain on the DataPower device. This is invoked from Domain.getQuiesceTimeout()

Specified by:
getQuiesceTimeout in interface StoredDomain
Returns:
timeout value in seconds
See Also:
StoredDomain.setQuiesceTimeout(int)

add

public void add(StoredTag tag)
Description copied from interface: StoredDomain
Add a tag to the domain. This is invoked by Domain.addTag(String, String) to set the tag on a StoredTag and persist it in the repository.

Specified by:
add in interface StoredDomain
Parameters:
tag - StoreTag

getTags

public StoredTag[] getTags()
Description copied from interface: StoredDomain
Gets the tags for this domain. This is invoked from Domain.getTagNames(), Domain.getTagValues(String), Domain.removeTag(String) and Domain.removeTag(String, String), to retrieve the information from the repository.

Specified by:
getTags in interface StoredDomain
Returns:
a array of StoredTags

remove

public void remove(StoredTag tag)
Description copied from interface: StoredDomain
Remove the tags for this domain. This is invoked from Domain.removeTag(String, String) and Domain.removeTag(String)

Specified by:
remove in interface StoredDomain
Parameters:
tag - the StoredTag

removeTags

public void removeTags()
Description copied from interface: StoredDomain
Remove all tags for this domain. This is invoked from Device.removeTags()

Specified by:
removeTags in interface StoredDomain


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