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

java.lang.Object
  extended by com.ibm.datapower.wamt.dataAPI.local.filesystem.StoredDeviceImpl
All Implemented Interfaces:
Persistable, StoredDevice

public class StoredDeviceImpl
extends java.lang.Object
implements StoredDevice

It represents a DataPower device. All device related information that must be persisted for a physical DataPower device. This includes the device serialnumber, hostname, GUIPOrt, HLMPort, Hostname, Model, Symbolic Name, and quiesce time out.

It is the container for StoredDomains that represent domains on a DataPower device. Below is a sample of a device element

 
 <devices xmi:id="DPDevice_0" deviceType="XI50" GUIPort="8080" HLMPort="5550" 
   Hostname="9.42.112.77" password="password" serialNumber="130018M" userId="admin" 
   name="dp10.rtp.raleigh.ibm.com" modelType="9003" currentAMPVersion="2.0" 
   quiesceTimeout="60" featureLicenses="JAXP-API;WebSphere-JMS;">
   ...
 </devices>
 
 


Field Summary
 
Fields inherited from interface com.ibm.datapower.wamt.dataAPI.StoredDevice
COPYRIGHT_2009_2010, SCM_REVISION
 
Method Summary
 void add(StoredTag tag)
          Add a tag to the device.
 void delete()
          Deletes the persisted instance of this StoredDevice.
 URLSource getBackupCertificateLocation()
          Gets the location of the certificate file to be used in a secure backup operation on a device
 java.net.URI getBackupFileLocation()
          Gets the location where the backup files are to be saved for a secure backup operation.
 java.lang.String getCurrentAMPVersion()
           Note: The Local File System implementation stores the AMP version as an attribute on the 'devices' element in the WAMT.repository.xml file.
 DeviceType getDeviceType()
           Note: The Local File System implementation stores the deviceType as an attribute on the devices element in the WAMT.repository.xml file.
 StringCollection getFeatureLicenses()
           Note: The Local File System implementation stores the getFeatureLicenses as an attribute on the device element in the WAMT.repository.xml file.
 int getGUIPort()
           Note: The Local File System implementation stores the WebGUI port as an attribute on the device element in the WAMT.repository.xml file.
 int getHLMPort()
          Gets the device's port number for HLM communication.
 java.lang.String getHostname()
           Note: The Local File System implementation stores the hostname as an attribute on the devices element in the WAMT.repository.xml file.
 StoredDomain getManagedDomain(java.lang.String domainName)
          Gets the domain from the repository that has the specified name.
 StoredDomain[] getManagedDomains()
           Note: The Local File System implementation stores all managed domains elements inside a device element in the WAMT.repository.xml file.
 StoredManagedSet getManagedSet()
           Note: The Local File System implementation stores managed device as attribute on the managedSets element in the WAMT.repository.xml file.
 ModelType getModelType()
          Gets the ModelType for this device.
 java.lang.String getPassword()
           Note: The Local File System implementation stores the password as an attribute on the device element in the WAMT.repository.xml file.
 java.lang.String getPrimaryKey()
           Note: The Local File System implementation uses the serialNumber of the DataPower device that this object represents as the primary key.
 int getQuiesceTimeout()
          Gets the persisted timeout value for quiescing the device.
 java.lang.String getSerialNumber()
           Note: The Local File System implementation stores the serial number as an attribute on the 'devices' element in the WAMT.repository.xml file.
 java.lang.String getSymbolicName()
           Note: The Local File System implementation stores the symbolic name as an attribute on the 'devices' element in the WAMT.repository.xml file.
 StoredTag[] getTags()
          Gets the tags for this device.
 java.lang.String getUserId()
           Note: The Local File System implementation stores the userId as an attribute on the device element in the WAMT.repository.xml file.
 void remove(StoredDomain domain)
           Note: The Local File System implementation will remove the specified domain element from the WAMT.repository.xml file.
 void remove(StoredTag tag)
          Remove the tags for this device.
 void removeTags()
          Remove all tags for this device.
 void setBackupCertificateLocation(URLSource certificateLocation)
          Stores the location of the certificate file to be used in the secure backup operation.
 void setBackupFileLocation(java.net.URI fileLocation)
          Stores the location for the backup file from a Device.
 void setCurrentAMPVersion(java.lang.String ampVersion)
          Sets the current AMP version supported by this device.
 void setDeviceType(DeviceType deviceType)
           
 void setFeatureLicenses(StringCollection featureLicenses)
          Sets the list of Strings that represent the feature licenses for this device.
 void setGUIPort(int guiPort)
          Sets the device's port for the WebGUI.
 void setHLMPort(int hlmPort)
           Note: The Local File System implementation stores the HLM Posrt as an attribute on the device element in the WAMT.repository.xml file.
 void setHostname(java.lang.String hostname)
          Sets the hostname or IP address of this device.
 void setManagedSet(StoredManagedSet managedSet)
          Non-interface method to set the ManagedSet this device belongs to
 void setModelType(ModelType modelType)
           
 void setPassword(java.lang.String password)
          Sets the administrative password for this device.
 void setQuiesceTimeout(int timeout)
          Sets the timeout value for quiescing a Device before performing a firmware update on the device.
 void setSymbolicName(java.lang.String name)
          Sets the symbolic name of this StoredDevice.
 void setUserId(java.lang.String userid)
          Sets the administrative userid for this device.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getManagedDomains

public StoredDomain[] getManagedDomains()

Note: The Local File System implementation stores all managed domains elements inside a device element in the WAMT.repository.xml file. Domains cannot exist outside of a containing device.

Specified by:
getManagedDomains in interface StoredDevice
Returns:
an array of StoredDomain objects

getManagedDomain

public StoredDomain getManagedDomain(java.lang.String domainName)
Description copied from interface: StoredDevice
Gets the domain from the repository that has the specified name. This is a convenience method used internally within the clientAPI and this information can also be accessed by invoking Device.getManagedDomain(String)

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

getPrimaryKey

public java.lang.String getPrimaryKey()

Note: The Local File System implementation uses the serialNumber of the DataPower device that this object represents as the primary key.

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

getSymbolicName

public java.lang.String getSymbolicName()

Note: The Local File System implementation stores the symbolic name as an attribute on the 'devices' element in the WAMT.repository.xml file.

Specified by:
getSymbolicName in interface StoredDevice
Returns:
the device Name
See Also:
StoredDevice.setSymbolicName(String)

setSymbolicName

public void setSymbolicName(java.lang.String name)
                     throws AlreadyExistsInRepositoryException,
                            DatastoreException
Description copied from interface: StoredDevice
Sets the symbolic name of this StoredDevice. This name is designed to be human-consumable. This name must be unique but it is mutable. This is invoked by Device.setSymbolicName(String)to set this symbolic name.

Specified by:
setSymbolicName in interface StoredDevice
Parameters:
name - the device name
See Also:
StoredDevice.getSymbolicName()

getSerialNumber

public java.lang.String getSerialNumber()

Note: The Local File System implementation stores the serial number as an attribute on the 'devices' element in the WAMT.repository.xml file.

Specified by:
getSerialNumber in interface StoredDevice
Returns:
the device's embedded serial number

getHostname

public java.lang.String getHostname()

Note: The Local File System implementation stores the hostname as an attribute on the devices element in the WAMT.repository.xml file.

Specified by:
getHostname in interface StoredDevice
Returns:
the device's hostname or IP address
See Also:
StoredDevice.setHostname(String)

setHostname

public void setHostname(java.lang.String hostname)
                 throws DatastoreException
Description copied from interface: StoredDevice
Sets the hostname or IP address of this device. This value is used when the repository attempts to communicate with the device. Users of the clientAPI can use Device.setHostname(String) to set the hostname a StoredDevice object.

Specified by:
setHostname in interface StoredDevice
Parameters:
hostname - the new hostname or IP address for this device *
See Also:
StoredDevice.getHostname()

getUserId

public java.lang.String getUserId()

Note: The Local File System implementation stores the userId as an attribute on the device element in the WAMT.repository.xml file.

Specified by:
getUserId in interface StoredDevice
Returns:
the device's administrative userid
See Also:
StoredDevice.setUserId(String)

setUserId

public void setUserId(java.lang.String userid)
               throws DatastoreException
Description copied from interface: StoredDevice
Sets the administrative userid for this device. This value is used when the repository attempts to communicate with the device. It can be invoked using Device.getUserId().

Specified by:
setUserId in interface StoredDevice
Parameters:
userid - the new administrative userid *
See Also:
StoredDevice.setUserId(String)

setPassword

public void setPassword(java.lang.String password)
                 throws DatastoreException
Description copied from interface: StoredDevice
Sets the administrative password for this device. This value is used when the repository attempts to communicate with the device. It can be invoked using Device.setPassword(String).

Specified by:
setPassword in interface StoredDevice
Parameters:
password - the new administrative password *
See Also:
StoredDevice.getPassword()

getPassword

public java.lang.String getPassword()

Note: The Local File System implementation stores the password as an attribute on the device element in the WAMT.repository.xml file.

Specified by:
getPassword in interface StoredDevice
Returns:
password the new administrative password

getCurrentAMPVersion

public java.lang.String getCurrentAMPVersion()

Note: The Local File System implementation stores the AMP version as an attribute on the 'devices' element in the WAMT.repository.xml file.

Specified by:
getCurrentAMPVersion in interface StoredDevice
Returns:
the device's current AMP version

setCurrentAMPVersion

public void setCurrentAMPVersion(java.lang.String ampVersion)
                          throws DatastoreException
Description copied from interface: StoredDevice
Sets the current AMP version supported by this device. The AMP version is the string representation of the numeric version. The AMP version supported is determined by the firmware.

Specified by:
setCurrentAMPVersion in interface StoredDevice
Parameters:
ampVersion - the amp Version currently supported by the DataPower device

getHLMPort

public int getHLMPort()
Description copied from interface: StoredDevice
Gets the device's port number for HLM communication. This is invoked by Device.getHLMPort() to retrieve the information from the repository.

Specified by:
getHLMPort in interface StoredDevice
Returns:
the device's port number for HLM communication
See Also:
StoredDevice.setHLMPort(int)

setHLMPort

public void setHLMPort(int hlmPort)
                throws DatastoreException

Note: The Local File System implementation stores the HLM Posrt as an attribute on the device element in the WAMT.repository.xml file.

< inheritDoc/>

Specified by:
setHLMPort in interface StoredDevice
Parameters:
hlmPort - the device's port number for HLM communication.
See Also:
StoredDevice.getHLMPort()

getGUIPort

public int getGUIPort()

Note: The Local File System implementation stores the WebGUI port as an attribute on the device element in the WAMT.repository.xml file.

Specified by:
getGUIPort in interface StoredDevice
Returns:
the device's port for the WebGUI
See Also:
StoredDevice.setGUIPort(int)

setGUIPort

public void setGUIPort(int guiPort)
                throws DatastoreException
Description copied from interface: StoredDevice
Sets the device's port for the WebGUI. This is invoked by Device.setGUIPort(int) to set the port number for the WebGUI on a StoredDevice and persist it in the repository.

Specified by:
setGUIPort in interface StoredDevice
Parameters:
guiPort - the device's port for the WebGUI
See Also:
StoredDevice.getGUIPort()

getFeatureLicenses

public StringCollection getFeatureLicenses()

Note: The Local File System implementation stores the getFeatureLicenses as an attribute on the device element in the WAMT.repository.xml file.

< inheritDoc/>

Specified by:
getFeatureLicenses in interface StoredDevice
Returns:
the list of Strings that represent the feature licenses for this device, i.e., "MQ", "TAM", etc.

setFeatureLicenses

public void setFeatureLicenses(StringCollection featureLicenses)
                        throws DatastoreException
Description copied from interface: StoredDevice
Sets the list of Strings that represent the feature licenses for this device. This is invoked by Device.createDevice(String, String, String, String, int) to set the feature entitlements for this device and persist it in the repository.

Specified by:
setFeatureLicenses in interface StoredDevice
See Also:
StoredDevice.getFeatureLicenses()

getModelType

public ModelType getModelType()
Description copied from interface: StoredDevice
Gets the ModelType for this device. A device ModelType is immutable, so there is no need for a setModelType(). This is in invoked from Device.getModelType() to retrieve the information from the repository.

Specified by:
getModelType in interface StoredDevice
Returns:
the ModelType for this device

setModelType

public void setModelType(ModelType modelType)

getManagedSet

public StoredManagedSet getManagedSet()

Note: The Local File System implementation stores managed device as attribute on the managedSets element in the WAMT.repository.xml file.

< inheritDoc/>

Specified by:
getManagedSet in interface StoredDevice
Returns:
the StoredManagedSet that the device is a member of. If the device is not a member of any StoredManagedSet, then this value will be null.
See Also:
StoredManagedSet.add(StoredDevice)

remove

public void remove(StoredDomain domain)

Note: The Local File System implementation will remove the specified domain element from the WAMT.repository.xml file. The clientAPI logic will delete all elements contained within a domain element.

Specified by:
remove in interface StoredDevice
Parameters:
domain - the domain to remove
See Also:
Repository.createDomain(StoredDevice, String)

setManagedSet

public void setManagedSet(StoredManagedSet managedSet)
Non-interface method to set the ManagedSet this device belongs to

Parameters:
managedSet -

getDeviceType

public DeviceType getDeviceType()

Note: The Local File System implementation stores the deviceType as an attribute on the devices element in the WAMT.repository.xml file.

< inheritDoc/>

Specified by:
getDeviceType in interface StoredDevice
Returns:
the device's device type, i.e., "XS35", "XS40", "XI50"

setDeviceType

public void setDeviceType(DeviceType deviceType)
                   throws DatastoreException

delete

public void delete()
Description copied from interface: StoredDevice
Deletes the persisted instance of this StoredDevice. This is in invoked from Manager.remove(com.ibm.datapower.wamt.clientAPI.Device) If this StoredDevice is managed by a StoredManagedSet,i.e it is a device member of a StoredManagedSet, it will be removed from that StoredManagedSet before it is deleted. Also all stored objects contained within the StoredManagedSet such as StoredDomain, DomainVersion, StoredDeploymentPolicy, StoredDeploymentPolicyVersion, and StoredTag are also deleted because they do not exist without the containing StoredDevice object.

Specified by:
delete in interface StoredDevice

getBackupCertificateLocation

public URLSource getBackupCertificateLocation()
Description copied from interface: StoredDevice
Gets the location of the certificate file to be used in a secure backup operation on a device

Specified by:
getBackupCertificateLocation in interface StoredDevice
Returns:
the location which holds the certificate file that can be later used during the restore operation on the device

getBackupFileLocation

public java.net.URI getBackupFileLocation()
Description copied from interface: StoredDevice
Gets the location where the backup files are to be saved for a secure backup operation.

Specified by:
getBackupFileLocation in interface StoredDevice
Returns:
location which holds location of backed up files that can be later used during the restore operation on the device

setBackupCertificateLocation

public void setBackupCertificateLocation(URLSource certificateLocation)
Description copied from interface: StoredDevice
Stores the location of the certificate file to be used in the secure backup operation. This information is stored when Device.backup(String, URLSource, URI, boolean, boolean) is invoked to backup up a managed or unmanaged device.

Specified by:
setBackupCertificateLocation in interface StoredDevice
Parameters:
certificateLocation - indicates location of back up certificates that can be later used during the restore operation on the device

setBackupFileLocation

public void setBackupFileLocation(java.net.URI fileLocation)
Description copied from interface: StoredDevice
Stores the location for the backup file from a Device. This information is stored when Device.backup(String, URLSource, URI, boolean, boolean) is invoked to backup up a managed or unmanaged device.

Specified by:
setBackupFileLocation in interface StoredDevice
Parameters:
fileLocation - indicates location of back up files for a secure backup operation

setQuiesceTimeout

public void setQuiesceTimeout(int timeout)
Description copied from interface: StoredDevice
Sets the timeout value for quiescing a Device before performing a firmware update on the device. This is invoked by Device.setQuiesceTimeout(int)

Specified by:
setQuiesceTimeout in interface StoredDevice
Parameters:
timeout - value in sec

getQuiesceTimeout

public int getQuiesceTimeout()
Description copied from interface: StoredDevice
Gets the persisted timeout value for quiescing the device. This is invoked by Device.getQuiesceTimeout()

Specified by:
getQuiesceTimeout in interface StoredDevice
Returns:
timeout value in sec

add

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

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

getTags

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

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

remove

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

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

removeTags

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

Specified by:
removeTags in interface StoredDevice


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