com.ibm.datapower.wamt.clientAPI
Class FirmwareVersion

java.lang.Object
  extended by com.ibm.datapower.wamt.clientAPI.FirmwareVersion
All Implemented Interfaces:
Version

public class FirmwareVersion
extends java.lang.Object
implements Version

A single instance of a firmware image.
A firmware image for a device is uniquely identified by 5 pieces of information

The first four items in the list are represented by the Firmware object, because they are controlled by device hardware and licensing constraints. The last element is represented by this object (FirmwareVersion).

Although FirmwareVersion has an opaque integer version member (i.e., 2) , it is deprecated in favor of the more meaningful member level (i.e., "3.6.0.1").

For more information read the javadoc for the classes Firmware and Version.

See Also:
Firmware

Field Summary
static java.lang.String COPYRIGHT_2009_2013
          The minimum firmware level that can be deployed to any ManagedSets or added to the Manager.
 
Fields inherited from interface com.ibm.datapower.wamt.clientAPI.Version
COPYRIGHT_2009_2010, SCM_REVISION
 
Method Summary
 java.lang.String getAbsoluteDisplayName()
          Get a human-readable name that represents this object, within the context of the system.
 Blob getBlob()
          Get the Blob for this FirmwareVersion.
static FirmwareVersion getByPrimaryKey(java.lang.String targetKey)
          Retrieve a reference to the FirmwareVersion that has the specified primary key.
 Firmware getFirmware()
          The same as getVersionedObject(), but casts the return value to a Firmare class.
 java.lang.String getLevel()
          Get the version level of this firmware.
 java.util.Date getManufactureDate()
          Get the manufacture date of this firmware.
 java.lang.String getPrimaryKey()
           
 java.lang.String getRelativeDisplayName()
          Get a human-readable name that represents this object, within the context of a specific Firmware.
 java.util.Date getTimestamp()
          Get the timestamp that signifies when the Version was created in the Manager.
 java.lang.String getUserComment()
          Get the user comment that corresponds to this Version.
 Versionable getVersionedObject()
          Get a reference to the object that this Version is a version of.
 int getVersionNumber()
          Deprecated. Although this method will return a valid version number (i.e., 2), you probably want to use the more meaningful method getLevel(). This method should work and is supported, but probably isn't the value you are looking for. It is anticipated that a user interface would reference a FirmwareVersion via the level instead of versionNumber.
static boolean meetsMinimumLevel(java.lang.String levelToTest)
          Check if a specified firmware level meets the minimum supported level.
static boolean meetsMinimumLevel(java.lang.String minimumLevel, java.lang.String levelToTestIn)
          Check if a specified firmware level meets the minimum supported level.
 void setUserComment(java.lang.String userComment)
          This is the method to set the user comment that can be later retrieved via Version.getUserComment().
 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
The minimum firmware level that can be deployed to any ManagedSets or added to the Manager. You can use this value to warn users what the minimum allowed firmware level is, and it is used internally in the method meetsMinimumLevel.

See Also:
meetsMinimumLevel(String), Constant Field Values
Method Detail

getLevel

public java.lang.String getLevel()
                          throws DeletedException
Get the version level of this firmware. This is what should be used in place of Version.getVersionNumber(). This value is embedded in the firmware image header, so there is no setVersionNumber(String) method. It will be automatically populated by the method Manager.addFirmware(Blob, String).

Returns:
the firmware version level, for example "3.6.0.1"
See Also:
Version.getVersionNumber()

getPrimaryKey

public java.lang.String getPrimaryKey()
                               throws DeletedException

meetsMinimumLevel

public static boolean meetsMinimumLevel(java.lang.String levelToTest)
Check if a specified firmware level meets the minimum supported level. Because the manager uses AMP to manage a device, and the firmware contains the AMP implementation for the device, and AMP was implemented in firmware level "3.6.0.4".

This method can be used to verify that this FirmwareVersion has a fully working AMP implementation. Otherwise the manager could be locked out from managing the device. The manager should deny any request to deploy firmware to devices that does not meet the minimum supported level.

Parameters:
levelToTest - the level to test against the minimum supported firmware level.
Returns:
true if this firmware meets or exceeds the minimum supported level, false otherwise.

meetsMinimumLevel

public static boolean meetsMinimumLevel(java.lang.String minimumLevel,
                                        java.lang.String levelToTestIn)
Check if a specified firmware level meets the minimum supported level. This check is performed by comparing the level of this firmware to the known minimum level. This is useful for checking to see if the device has a firmware level greater than or equal to a level required by a particular feature.

Parameters:
minimumLevel - the minimum level to test against for a supported firmware level.
levelToTest - the level to test against minimumLevel. This is usually the current level of the device, but can be specified arbitrarily.
Returns:
true if this firmware meets or exceeds the minimum supported level, false otherwise.
See Also:
Device.meetsMinimumFirmwareLevel(String)

getByPrimaryKey

public static FirmwareVersion getByPrimaryKey(java.lang.String targetKey)
Retrieve a reference to the FirmwareVersion that has the specified primary key.

Parameters:
targetKey - the primary key to search for
Returns:
the Firmware that has the specified primary key. May return null if no Firmware with the specified primary key was found.
See Also:
getPrimaryKey()

getManufactureDate

public java.util.Date getManufactureDate()
                                  throws DeletedException
Get the manufacture date of this firmware. This value is embedded in the firmware image header, so there is no setManufactureDate(Date) method. It will be automatically populated by the method Manager.addFirmware(Blob, String).

Returns:
the data of manufacture of this firmware image

getVersionedObject

public Versionable getVersionedObject()
                               throws DeletedException
Description copied from interface: Version
Get a reference to the object that this Version is a version of. For example, calling DomainVersion.getVersionedObject() should return a Domain, which is the parent object. This should be a reminder for the subclass to implement the method getDomain() or getFirmware() that would return a typed object instead of a generic one. It isn't expected that a caller would actually use this method.

Specified by:
getVersionedObject in interface Version
Returns:
a reference to either a Firmware, Domain, or DeploymentPolicy object.

getFirmware

public Firmware getFirmware()
                     throws DeletedException
The same as getVersionedObject(), but casts the return value to a Firmare class.

Returns:
the Firmware object that this is a version of

getVersionNumber

public int getVersionNumber()
                     throws DeletedException
Deprecated. Although this method will return a valid version number (i.e., 2), you probably want to use the more meaningful method getLevel(). This method should work and is supported, but probably isn't the value you are looking for. It is anticipated that a user interface would reference a FirmwareVersion via the level instead of versionNumber.

Description copied from interface: Version
Get the version number that this Version object represents. Version numbers are immutable in the Version object, and are incremented automatically by the Manager when a new Version object is created, so there is no setVersionNumber(int) method. The combination of version number and Object reference forms the primary key for a Version object in the Manager.

Specified by:
getVersionNumber in interface Version
Returns:
the version number that this Version object represents.

getTimestamp

public java.util.Date getTimestamp()
                            throws DeletedException
Description copied from interface: Version
Get the timestamp that signifies when the Version was created in the Manager. This value is set automatically by the Manager, so there is no setTimestamp(Date) method.

Specified by:
getTimestamp in interface Version
Returns:
the timestamp of the Version creation

getUserComment

public java.lang.String getUserComment()
                                throws DeletedException
Description copied from interface: Version
Get the user comment that corresponds to this Version. This is where the user can attach a String to the Version that helps describe the version in their terms.

Specified by:
getUserComment in interface Version
Returns:
the user comment associated with this version
See Also:
Version.setUserComment(String)

setUserComment

public void setUserComment(java.lang.String userComment)
                    throws DeletedException,
                           DatastoreException,
                           DirtySaveException
Description copied from interface: Version
This is the method to set the user comment that can be later retrieved via Version.getUserComment(). Calling this method will cause the comment to be written to the persisted datastore.

Specified by:
setUserComment in interface Version
Parameters:
userComment - the user-defined comment to attach to this Version. It may have reference to a new function, bug fix, change management or problem management ticket, etc. This is a freeform field of unlimited length.
See Also:
Version.getUserComment()

getBlob

public Blob getBlob()
             throws DeletedException
Get the Blob for this FirmwareVersion. The Blob for a FirmwareVersion is the firmware file (the "scrypt2" file).

Beware that the content inside the Blob is base64 encoded. This is different behavior than DomainVersion. The reason for this is documented in Commands.setFirmware(DeviceContext, InputStream).

Specified by:
getBlob in interface Version
Returns:
the Blob for this FirmwareVersion. The content is base64 encoded.

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, within the context of a specific Firmware. This name may be used in user interfaces.

Returns:
a human-readable name that represents this object. This is the level member of this object. For example, "3.6.1.0".
See Also:
getAbsoluteDisplayName()

getAbsoluteDisplayName

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

Returns:
a human-readable name that represents this object. This includes the display name of the parent Firmware object. For example, "3.6.0.1 of firmware for device type XS40 and model type 9003 with the strict features Tibco-EMS, TAM, and with the non-strict features JAXP-API, HSM".
See Also:
getRelativeDisplayName(), Firmware.getDisplayName()


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