Reference Guide

Table Of Contents
5 Including Debian Packages with
Applications
This chapter documents the requirements for installing a debian package with an application.
Steps for removing a debian package are also provided.
Required Services
AppService
The AppService provides:
Reference to the directory where the contents of the application zip file is extracted
Current state information for the application
Ability to register a listener to hear of application specific events
AdminRest
The AdminRest provides:
Ability to upload a debian package to the controller
Ability to run an installation on a debian package
Ability to run a removal of a debian package
Application zip file
When the application is installed via the application manager the contents of the application zip
file are extracted to an “unzipped” directory for that application. The application specific
directory is located at “/opt/sdn/config/apps/app_id/app_version/unzipped”. All files found
within the application zip will be extracted to this location. The extraction process does not
perform any validation on the extracted files.
The AppService provides a call to retrieve the Java File object representing this unzipped directory.
The required parameters for this call are the application id (string) and the application version
(string). The call will return a valid File object that is a directory if the unzipped directory exists for
the application id and version, otherwise it throws a not found exception.
An application can use this call to obtain the parent directory for any debian files that are
included with the application:
private static final String APP_ID = "com.hp.sdn.demo.debinst";
private static final String APP_VERSION = "1.0.0.SNAPSHOT";
130