com.h3c.sdn.app

## Interface ApplicationService

- All Known Subinterfaces:
    ApplicationServiceInternal

      public interface ApplicationService

  Service for registering and tracking various internal applications.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addHealthMonitor(String appId, ApplicationHealthMonitor healthMonitor)` Adds a health monitor listener for application health.
    `void` | `addListener(ApplicationListener listener)` Adds a listener for application installation and run state changes.
    `Application` | `getApplication(String appId)` Returns the application with the given unique id.
    `List<Application>` | `getApplications()` Returns a list of all installed applications.
    `File` | `getArchive(Application app)` Retrieves the application archive.
    `ApplicationHealthStatus` | `getHealthStatus(String appId)` Returns the state of the application given an application id.
    `Application` | `install(String appId, Authentication auth)` Installs an application.
    `void` | `removeHealthMonitor(String appId)` Removes a health monitor listener for application health.
    `void` | `removeListener(ApplicationListener listener)` Removes a listener for application installation and run state changes.
    `Application` | `resolve(String appId, Authentication auth)` Install the application but do not make active.
    `Application` | `start(String appId, Authentication auth)` Starts an application.
    `Application` | `stop(String appId, Authentication auth)` Stops an application.
    `void` | `uninstall(String appId, Authentication auth)` Uninstalls an application.
    `Application` | `upload(InputStream uploadStream, String fileName, Authentication auth)` Uploads an application archive to the system.

- - ### Method Detail

    - #### upload

          Application upload(InputStream uploadStream,
                           String fileName,
                           Authentication auth)

      Uploads an application archive to the system.
      Parameters:
        `uploadStream` - input stream for upload
        `fileName` - application archive name
        `auth` - the authentication record for the user that invoked this method
      Returns:
        application object of uploaded application

    - #### install

          Application install(String appId,
                            Authentication auth)

      Installs an application. The application will be installed and will be made active (start is called on the application).
      Parameters:
        `appId` - application unique id
        `auth` - the authentication record for the user
      Returns:
        the installed application

    - #### resolve

          Application resolve(String appId,
                            Authentication auth)

      Install the application but do not make active. This will set up the application to run, but will not start the application.
      Parameters:
        `appId` - application unique id
        `auth` - the authentication record for the user
      Returns:
        the resolved application

    - #### uninstall

          void uninstall(String appId,
                       Authentication auth)

      Uninstalls an application.
      Parameters:
        `appId` - application unique id
        `auth` - the authentication record for the user that invoked this method performed on other nodes in case of cluster
      Throws:
        `NotFoundException` - if application with the given id is not found

    - #### start

          Application start(String appId,
                          Authentication auth)

      Starts an application.
      Parameters:
        `appId` - application unique id
        `auth` - the authentication record for the user that invoked this method
      Returns:
        handle of started application
      Throws:
        `NotFoundException` - if application with the given id is not found

    - #### stop

          Application stop(String appId,
                         Authentication auth)

      Stops an application.
      Parameters:
        `appId` - application unique id
        `auth` - the authentication record for the user that invoked this method
      Returns:
        handle of stopped application
      Throws:
        `NotFoundException` - if application with the given id is not found

    - #### getApplication

          Application getApplication(String appId)
                                     throws NotFoundException

      Returns the application with the given unique id.
      Parameters:
        `appId` - unique application id
      Returns:
        installed application
      Throws:
        `NotFoundException` - if application with the given id is not found

    - #### getApplications

          List<Application> getApplications()

      Returns a list of all installed applications.
      Returns:
        list of installed application
      Throws:
        `NotFoundException` - if application with the given id is not found

    - #### getArchive

          File getArchive(Application app)
                          throws NotFoundException

      Retrieves the application archive.
      Parameters:
        `app` - application id
      Returns:
        the application archive compressed as ZIP
      Throws:
        `NotFoundException` - if the archive is not found

    - #### addListener

          void addListener(ApplicationListener listener)

      Adds a listener for application installation and run state changes.
      Parameters:
        `listener` - listener to be added

    - #### removeListener

          void removeListener(ApplicationListener listener)

      Removes a listener for application installation and run state changes.
      Parameters:
        `listener` - listener to be added

    - #### addHealthMonitor

          void addHealthMonitor(String appId,
                              ApplicationHealthMonitor healthMonitor)

      Adds a health monitor listener for application health.
      Parameters:
        `appId` - unique identifier for the application whose health will be monitored
        `healthMonitor` - health monitor listener to be added

    - #### removeHealthMonitor

          void removeHealthMonitor(String appId)

      Removes a health monitor listener for application health.
      Parameters:
        `appId` - unique identifier for the application whose health will be monitored

    - #### getHealthStatus

          ApplicationHealthStatus getHealthStatus(String appId)

      Returns the state of the application given an application id.
      Parameters:
        `appId` - id of the application
      Returns:
        application health status object

Copyright © 2014. All Rights Reserved.