com.esf.core.application.manager.service
Interface IEsfApplicationManagerService


public interface IEsfApplicationManagerService

The Application Manager Service provides an API for software components to install, start, stop, and uninstall applications. An application is defined as one or more bundles that provide some business level functionality. There is also a hook to the MQTT client to allow bundles to be installed, started, stopped, or uninstalled via the MQTT interface. Copyright (c) 2011 Eurotech Inc. All rights reserved.


Field Summary
static java.lang.String SERVICE_NAME
           
static java.lang.String TOPIC_INSTALL
          MQTT topic to install a new application
static java.lang.String TOPIC_START
          MQTT topic to start an application that has previously been installed via the application manager
static java.lang.String TOPIC_STOP
          MQTT topic to stop an application that has previously been installed and started via the application manager
static java.lang.String TOPIC_UNINSTALL
          MQTT topic to uninstall an application that has previously been
 
Method Summary
 void install(java.io.File[] files)
          Method used to install an application to the application manager.
 boolean isInstalled(java.lang.String applicationName)
          Checks to see if an application is currently installed via the IEsfApplicationManagerService.
 boolean isRunning(java.lang.String applicationName)
          Checks to see if an application is currently running via the IEsfApplicationManagerService.
 void start(java.lang.String applicationName)
          Starts an application by name.
 void stop(java.lang.String applicationName)
          Stops an application by name.
 void uninstall(java.lang.String applicationName)
          Uninstalls and application that has previously been installed via the IEsfApplicationManagerService.
 

Field Detail

SERVICE_NAME

static final java.lang.String SERVICE_NAME

TOPIC_INSTALL

static final java.lang.String TOPIC_INSTALL
MQTT topic to install a new application

See Also:
Constant Field Values

TOPIC_START

static final java.lang.String TOPIC_START
MQTT topic to start an application that has previously been installed via the application manager

See Also:
Constant Field Values

TOPIC_STOP

static final java.lang.String TOPIC_STOP
MQTT topic to stop an application that has previously been installed and started via the application manager

See Also:
Constant Field Values

TOPIC_UNINSTALL

static final java.lang.String TOPIC_UNINSTALL
MQTT topic to uninstall an application that has previously been

See Also:
Constant Field Values
Method Detail

install

void install(java.io.File[] files)
             throws java.lang.Exception
Method used to install an application to the application manager. The files must be a set of ESF based jar files along with another file of the form myapplication.md5. The application name will become myapplication in the above example. The myapplication.md5 file should contain md5sums for all of the Files that are being installed. The form of the file should be: filename1.jar=3bf59f8cd2e96ff8930724ec8df0a61a filename2.jar=791b487490e0ddcff76a1162a5f76a9d Before being installed the new application will be validated via the md5sums provided in the application_name.md5 to ensure files are not corrupted.

Parameters:
files - A set of ESF jar files that make up the application plus an [application_name].md5 file containing the md5sums of the jar files
Throws:
java.lang.Exception - If there is an error processing the application to be installed

start

void start(java.lang.String applicationName)
           throws java.lang.Exception
Starts an application by name. The application must have previously been installed via the IEsfApplicationManagerService in order to be able to start it.

Parameters:
applicationName - The application name to start.
Throws:
java.lang.Exception - If the application is unable to be started.

stop

void stop(java.lang.String applicationName)
          throws java.lang.Exception
Stops an application by name. The application must have previously been installed and started via the IEsfApplicationManagerService in order to be able to stop it.

Parameters:
applicationName - The application name to stop.
Throws:
java.lang.Exception - If the application can not be stopped

uninstall

void uninstall(java.lang.String applicationName)
               throws java.lang.Exception
Uninstalls and application that has previously been installed via the IEsfApplicationManagerService. If the application is currently running it will be stopped before being uninstalled.

Parameters:
applicationName - The application name to uninstall.
Throws:
java.lang.Exception - If the application can not be uninstalled.

isInstalled

boolean isInstalled(java.lang.String applicationName)
Checks to see if an application is currently installed via the IEsfApplicationManagerService.

Parameters:
applicationName - The application name to see if it is currently installed.
Returns:
true if the application is installed, otherwise false

isRunning

boolean isRunning(java.lang.String applicationName)
Checks to see if an application is currently running via the IEsfApplicationManagerService.

Parameters:
applicationName - The application name to see if it is currently running
Returns:
true if the application is running, otherwise false