com.ibm.datapower.wamt.amp
Class Utilities

java.lang.Object
  extended by com.ibm.datapower.wamt.amp.Utilities

public class Utilities
extends java.lang.Object

This class provides utilities which can be used for parsing information needed by the other classes in this package. More information can be found in each method javadoc below. The get*Firmware* methods parse the headers of a firmware file to extract metadata.


Field Summary
static java.lang.String COPYRIGHT_2009_2013
           
 
Method Summary
static DeviceType getFirmwareDeviceType(Blob firmwareImage)
          Get the deviceType that this firmware image is for.
static java.lang.String getFirmwareLevel(Blob firmwareImage)
          Get the manufacturer's level (i.e., "3.5.0.9") that is embedded in a firmware file.
static java.util.Date getFirmwareManufactureDate(Blob firmwareImage)
          Get the manufacturer's build date that is embedded in a firmware file.
static ModelType getFirmwareModelType(Blob firmwareImage)
          Get the modelType that this firmware image is for.
static java.lang.String getFirmwareScryptVersion(Blob firmwareImage)
          Get the scrypt version of this firmware file.
static java.lang.String getLocalIPAddress(java.lang.String ipInterface)
           
static StringCollection getNonStrictFirmwareFeatures(Blob firmwareImage)
          Get the list of non-strict features (libraries) that are included in this firmware image.
static java.lang.String getRepositoryDirectory()
          Get WAMT repository directory
static StringCollection getStrictFirmwareFeatures(Blob firmwareImage)
          Get the list of strict features (libraries) that are included in this firmware image.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_2009_2013

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

getFirmwareScryptVersion

public static java.lang.String getFirmwareScryptVersion(Blob firmwareImage)
                                                 throws java.io.IOException,
                                                        AMPException
Get the scrypt version of this firmware file. At the time of this writing, both scrypt1 and scrypt2 files are being published by the appliance manufacturer. However, the manager supports only scrypt2 because scrypt1 doesn't have headers that we need. The only valid value for this should be "2.0", although we would like this to be forward compatible.

Parameters:
firmwareImage - a reference to the firmware file blob
Returns:
a String representation of the scrypt version, i.e., "2.0"

getFirmwareLevel

public static java.lang.String getFirmwareLevel(Blob firmwareImage)
                                         throws java.io.IOException,
                                                AMPException
Get the manufacturer's level (i.e., "3.5.0.9") that is embedded in a firmware file.

Parameters:
firmwareImage - a reference to the firmware file blob
Returns:
a String representation of the firmware level, i.e., 3.5.0.9

getFirmwareManufactureDate

public static java.util.Date getFirmwareManufactureDate(Blob firmwareImage)
                                                 throws java.io.IOException
Get the manufacturer's build date that is embedded in a firmware file.

Parameters:
firmwareImage - a reference to the firmware file blob
Returns:
a timestamp of the firmware build

getFirmwareDeviceType

public static DeviceType getFirmwareDeviceType(Blob firmwareImage)
                                        throws java.io.IOException,
                                               AMPException
Get the deviceType that this firmware image is for.

Parameters:
firmwareImage - a reference to the firmware file blob
Returns:
the type of device that this firmware is for
See Also:
Firmware.isCompatibleWith(com.ibm.datapower.wamt.clientAPI.Device)

getFirmwareModelType

public static ModelType getFirmwareModelType(Blob firmwareImage)
                                      throws java.io.IOException,
                                             AMPException
Get the modelType that this firmware image is for.

Parameters:
firmwareImage - a reference to the firmware file blob
Returns:
the modelType that this firmware is for
See Also:
Firmware.isCompatibleWith(com.ibm.datapower.wamt.clientAPI.Device)

getStrictFirmwareFeatures

public static StringCollection getStrictFirmwareFeatures(Blob firmwareImage)
                                                  throws java.io.IOException,
                                                         AMPException
Get the list of strict features (libraries) that are included in this firmware image. For a description of what a strict feature is, refer to the javadoc for getIncompatibilityReason().

Parameters:
firmwareImage - a reference to the firmware file blob
Returns:
a list of strict features that are included in this firmware image
See Also:
Firmware.isCompatibleWith(com.ibm.datapower.wamt.clientAPI.Device)

getNonStrictFirmwareFeatures

public static StringCollection getNonStrictFirmwareFeatures(Blob firmwareImage)
                                                     throws java.io.IOException,
                                                            AMPException
Get the list of non-strict features (libraries) that are included in this firmware image. For a description of what a non-strict feature is, refer to the javadoc for getIncompatibilityReason().

Parameters:
firmwareImage - a reference to the firmware file blob
Returns:
a list of non-strict features that are included in the firmware file
See Also:
Firmware.isCompatibleWith(com.ibm.datapower.wamt.clientAPI.Device)

getLocalIPAddress

public static java.lang.String getLocalIPAddress(java.lang.String ipInterface)
                                          throws java.net.SocketException

getRepositoryDirectory

public static java.lang.String getRepositoryDirectory()
Get WAMT repository directory

Returns:
the path of WAMT repository


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