AdventNet WiFi Mediation API, v1.0

com.adventnet.wifi.mediation
Class MediationAPI

java.lang.Object
  extended bycom.adventnet.wifi.mediation.MediationAPI

public class MediationAPI
extends java.lang.Object

This is the Gateway Class to the WiFiMediation which provides methods for managing Wireless Devices. APIs to configure,reboot,firmware upgrades etc are available in this class.

Code Snippet given below helps you to configure a Cisco 1100 AP

//Creating a RadioBean
RadioBean rcb = new RadioBean();

//Specifying the RadioInterface for configuration
rcb.setRadioMode(MediationConstants.RADIO_BG);

//Making the Radio to UP.
rcb.setEnableRadio(true);

//Setting the Transmission to Maximum.
rcb.setTransmitPower(RadioBean.MAXIMUM_POWER);

//Creating the Device
Device device = new Device("Cisco1100AP",VendorConstants.CISCO,VendorConstants.CISCO_IOS_1100);
//Creating CLI Credentials
CLICredentials credn = new CLICredentials(23, "Cisco", "Cisco");
device.setCLICredentials(credn);

//Configuring the AccessPoint
ConfigResult result = MediationAPI.configureAccessPoint(device,bean);

See Also:
Device, RadioBean, SSIDBean, FirmwareBean, ACLBean

Constructor Summary
MediationAPI()
           
 
Method Summary
static void cleanUpResources(boolean flag)
          Method to cleanup the resources used by the WiFiMediation.
static ConfigResult configureAccessPoint(Device device, AbstractBean bean)
          Method to configure WLAN Devices.
static AbstractBean[] getAccessPointDetails(Device device, int details)
          Fetches the details from WLAN Devices.
static java.lang.String getFirmwareVersion(Device device)
          Returns the firmware version of the WLAN Device.
static boolean isModelSupported(int vendor, int model)
          Says whether a particular model of WLAN Device is supported in WiFiMediation or not.
static ConfigResult rebootAccessPoint(Device device)
          Reboots the specified WLAN Device.
static ConfigResult upgradeFirmware(Device device, FirmwareBean bean)
          Method to upgrade firmwares on WLAN Devices.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MediationAPI

public MediationAPI()
Method Detail

configureAccessPoint

public static ConfigResult configureAccessPoint(Device device,
                                                AbstractBean bean)
                                         throws AgentNotReachableException,
                                                MediationException,
                                                InvalidInputsException
Method to configure WLAN Devices.

Parameters:
device - Represents a WLAN Device to be configured.
bean - Holds values to be configured.
Returns:
ConfigResult containing the result of the operation.
Throws:
AgentNotReachableException - Throws this exception when the agent (CLI or SNMP) in the device, which is used for this particular operation is not reachable from the mediation server.
MediationException - Other unspecified exceptions including the runtime exceptions are wrapped and thrown as MediationException.
InvalidInputsException - when the inputs are not valid.
See Also:
RadioBean, SSIDBean, ACLBean, FirmwareBean

rebootAccessPoint

public static ConfigResult rebootAccessPoint(Device device)
                                      throws AgentNotReachableException,
                                             MediationException
Reboots the specified WLAN Device.

Parameters:
device - Represents a WLAN Device that needs to be rebooted.
Returns:
ConfigResult containing the result of the Operation
Throws:
AgentNotReachableException - Throws this exception when the agent (CLI or SNMP) in the device, which is used for this particular operation is not reachable from the WiFiMediation.
MediationException - Other unspecified exceptions including the runtime exceptions are wrapped and thrown as MediationException.

upgradeFirmware

public static ConfigResult upgradeFirmware(Device device,
                                           FirmwareBean bean)
                                    throws AgentNotReachableException,
                                           MediationException
Method to upgrade firmwares on WLAN Devices. Call to this method will be returned immediately as another thread will be spawned to do the actual upgrade. FirmwareUpgrade Listeners can be registered with WiFiMediation for getting Firmware Upgrade Events.

Code Snippet given below helps you to upgrade firmware on Cisco 1100 AP
//Creating Firmware Bean & TFTP Credentials
TftpCredentials tftpDetails = new TftpCredentials();
tftpDetails.setServerName("<Name of the TFTPServer where image are available>");
FirmwareBean bean = new FirmwareBean();
bean.setTftpCredentails(tftpDetails);
bean.setImageFilePath("c1200-k9w7-tar.123-7.JA2.tar");

//Registering a listener for receiving upgrade events
bean.registerForFirmwareUpgradeStatus(<Object that implements FirmwareUpgradeStatusListener>,60,10);

//Creating the Device
Device device = new Device("Cisco1100AP",VendorConstants.CISCO,VendorConstants.CISCO_IOS_1100);
CLICredentials credn = new CLICredentials(23, "Cisco", "Cisco");
device.setCLICredentials(credn);
 
//Upgrading the Firmware
ConfigResult result = MediationAPI.upgradeFirmware(device,bean);

Parameters:
device - Represents a WLAN Device whose firmware is to be upgraded.
bean - Holds details related to image path and TFTPServer IP
Returns:
ConfigResult which always says that the upgrade is inprogress.
Throws:
AgentNotReachableException
MediationException
See Also:
FirmwareUpgradeStatusListener, FirmwareUpgradeEvent

getFirmwareVersion

public static java.lang.String getFirmwareVersion(Device device)
                                           throws MediationException,
                                                  AgentNotReachableException
Returns the firmware version of the WLAN Device.

Parameters:
device - Represents a WLAN Device whose Firmware version is to be known
Returns:
Version of the Firmware currently running on the device.
Throws:
MediationException
AgentNotReachableException

isModelSupported

public static boolean isModelSupported(int vendor,
                                       int model)
                                throws MediationException
Says whether a particular model of WLAN Device is supported in WiFiMediation or not.

Parameters:
vendor - Represents the manufacturer of the WLAN Device
model - Represents a specific model from that Vendor
Returns:
true if the Model is supported otherwise false.
Throws:
MediationException - Wraps the run time exceptions and throws it as MediationException
See Also:
VendorConstants

getAccessPointDetails

public static AbstractBean[] getAccessPointDetails(Device device,
                                                   int details)
                                            throws AgentNotReachableException,
                                                   MediationException
Fetches the details from WLAN Devices. The int passed as argument to this method refers to the type of details that needs to be fetched.

Parameters:
device - Represents a WLAN Device from which the details has to be fetched.
details - the type of details that needs to be fetched, constants for this are defined in MediationConstants.
Returns:
requested details of the Access point as an array of AbstractBean.
Throws:
AgentNotReachableException - Throws this exception when the agent (CLI or SNMP) in the device, which is used for this particular operation is not reachable from the mediation server.
MediationException - Other unspecified exceptions including the runtime exceptions are wrapped and thrown as MediationException.
See Also:
MediationConstants.RADIO_DETAILS, MediationConstants.RADIUS_DETAILS, MediationConstants.SSID_DETAILS, MediationConstants.ACL_DETAILS, MediationConstants.RX_TRAFFIC, MediationConstants.TX_TRAFFIC, MediationConstants.RX_ERRORS, MediationConstants.TX_ERRORS, MediationConstants.WEP_ICV_ERRORS, MediationConstants.WEP_UNDECRYPTABLE_ERRORS, MediationConstants.FCS_ERRORS, MediationConstants.FRAME_RETRIES, MediationConstants.MOBILE_CLIENT_DETAILS

cleanUpResources

public static void cleanUpResources(boolean flag)
Method to cleanup the resources used by the WiFiMediation. Any thread used in this product will monitor this flag. If it is true, it will gracefully stop the operation for smooth shut down of the parent process. This will be useful when the parent process wants to close immediately. It can invoke this method to ensure the graceful shutdown.

Parameters:
flag - the status of the clean up operation. Set value 'true' to stop all the running threads.

AdventNet WiFi Mediation API, v1.0

Copyright © 2005 AdventNet Inc. All Rights Reserved.