com.motorola.oem.websession
Class OTADownload

java.lang.Object
  extended by OEM
      extended by com.motorola.oem.websession.OTADownload

public class OTADownload
extends OEM

 OTADownload API enables triggering OTA provisioning using the OTA Download start methods.
A successful startOTA will stop the running MIDlet and replace it with the new one.

Status Retrieving:
Get the last OTA download result by getLastOTAStatus().
Get OTA failure report by OSC.getProperty(java.lang.String) with the parameter "oem.lastfault.ota".

See Also:
WebSession, WebSessionManager

Field Summary
static int OTA_STATUS_FAIL
          Last OTA provisioning status: last OTA provisioning failed.
static int OTA_STATUS_SUCCESS
          Last OTA provisioning status: last OTA download process completed successfully.
 
Constructor Summary
OTADownload()
          Only one instance of the OTADownload class can be created.
 
Method Summary
static int getLastOTAStatus()
          Returns last OTA provisioning status.
static void startOTA(int webSessionIndex)
          Triggers OTA MIDlet Download - user defined web session is used.
static void startOTA(java.lang.String url)
          Triggers the OTA Download process - uses Java web session.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OTA_STATUS_FAIL

public static final int OTA_STATUS_FAIL
Last OTA provisioning status: last OTA provisioning failed.

See Also:
getLastOTAStatus(), Constant Field Values

OTA_STATUS_SUCCESS

public static final int OTA_STATUS_SUCCESS
Last OTA provisioning status: last OTA download process completed successfully.

See Also:
getLastOTAStatus(), Constant Field Values
Constructor Detail

OTADownload

public OTADownload()
            throws OTAException
Only one instance of the OTADownload class can be created. Note: Class can have a single instance.

Throws:
OTAException - Trying to create a second instance of OTADownload when there is one instance that already exists.
Method Detail

getLastOTAStatus

public static int getLastOTAStatus()
Returns last OTA provisioning status.

Returns:
Last OTA provisioning status. Possible return values are: OTA_STATUS_FAIL and OTA_STATUS_SUCCESS.
For result description use OSC.getProperty(java.lang.String) with the parameter "oem.lastfault.ota"
See Also:
startOTA(String), startOTA(int), OSC.getProperty(java.lang.String)

startOTA

public static void startOTA(int webSessionIndex)
                     throws WebSessionException,
                            java.lang.IndexOutOfBoundsException,
                            java.lang.SecurityException,
                            OTAException
Triggers OTA MIDlet Download - user defined web session is used.

NOTE: Java Session is the OTA download's default session.
Use startOTA(int), only if a different Web Session is preferred (see WebSessionManager for more information).
If current web session was not established before startOTA call then web session specified by webSessionIndex will be set as current.

Parameters:
webSessionIndex - A reference to the WebSession entry.
Throws:
java.lang.IndexOutOfBoundsException -
  • webSessionIndex is out of range i.e:1 to getMaxWebSessions().
  • WebSessionException -
  • No existing WebSession entry matches the webSessionIndex parameter.
  • OTAException - homePage of the specified websession is null or empty. jad or jar file are not specified in the homePage field of the WebSession.
    java.lang.SecurityException - MIDlet is not signed for using this service.

    startOTA

    public static void startOTA(java.lang.String url)
                         throws OTAException,
                                WebSessionException,
                                java.lang.SecurityException
    Triggers the OTA Download process - uses Java web session.
    An important WS URL should serve this API.

    NOTE: Java Session will be used by default for the OTA download. If current web session was not established before startOTA call then Java Session will be set as current.

    Parameters:
    url - Server's URL for MIDlet download.
    Throws:
    OTAException - url is null. url is empty. 'APP' session with the name Java Session does not exist. jad or jar file are not specified in the url.
    java.lang.SecurityException - MIDlet is not signed for using this service.
    WebSessionException - Failed to find web session.