Framework Professional Edition Package


com.prosyst.mbs.services.kitmanager
Interface KitManagerService


public interface KitManagerService

The Kit Manager Service provides an interface for easy and centralized installation/uninstallation of bundle kits and demos. For remote installation the property mbs.script.base on the server must point to the server directory with the kit's bundles. The Kit Manager Service analyses and executes the given script, replacing the locations of the bundles with the correct remote locations as necessary. Note: This service doesn't support the "-S" parameter ("starts after installation of all bundles") of the install command

Author:
Sofia Doncheva

Field Summary
static java.lang.String EXTERNAL_XML
          An URL of a remote location of the text file with list of kits in an XML-like format
static java.lang.String KITLIST_FILENAME
          The name of the text file with list of kits in an XML-like format to be read from /bin/pscripts
static java.lang.String LOCAL_SCRIPT_DIRS
          A semicolon separated list of directories to be searched recursively for install scripts
static java.lang.String SCRIPT_BASE
          The script base.
static java.lang.String SCRIPT_EXTENSION
          The extension of the install script files
static int SCRIPT_LOC
          The index of the element in a String[] contained in the vector returned by listKits() which holds the script location
static int SCRIPT_NAME
          The index of the element in a String[] contained in the vector returned by listKits() which holds the script name
 
Method Summary
 KitStatus analyseKit(java.lang.String relativeScriptLoc)
          This method receives an install script, parses it, finds the bundles that were installed by that script and returns detailed info for the kit state - installed/not installed/bad script and the state of the bundles - present/ installed/not installed.
 InstallStatus installKit(java.lang.String relativeScriptLoc, boolean repairOption)
          This method receives an install script, parses it, replaces the locations as needed with the corrected remote locations and executes the commands through the Parser Service.
 java.util.Vector listKits()
          This method lists the available kits.
 DependencyList uninstallKit(java.lang.String relativeScriptLoc, boolean doUninstall)
          This method receives an install script, parses it, replaces the locations as needed with the corrected remote locations and uninstalls the bundles found in the install script.
 java.lang.String uninstallList(long[] ids)
          Uninstalls the list of Bundle IDs.
 

Field Detail

KITLIST_FILENAME

static final java.lang.String KITLIST_FILENAME
The name of the text file with list of kits in an XML-like format to be read from /bin/pscripts

See Also:
Constant Field Values

EXTERNAL_XML

static final java.lang.String EXTERNAL_XML
An URL of a remote location of the text file with list of kits in an XML-like format

See Also:
Constant Field Values

LOCAL_SCRIPT_DIRS

static final java.lang.String LOCAL_SCRIPT_DIRS
A semicolon separated list of directories to be searched recursively for install scripts

See Also:
Constant Field Values

SCRIPT_BASE

static final java.lang.String SCRIPT_BASE
The script base. All relative (i.e. not beginning with a protocol) bundle locations in the script will be recalculated relative to this base location. It can be an URL or a file location.

See Also:
Constant Field Values

SCRIPT_EXTENSION

static final java.lang.String SCRIPT_EXTENSION
The extension of the install script files

See Also:
Constant Field Values

SCRIPT_NAME

static final int SCRIPT_NAME
The index of the element in a String[] contained in the vector returned by listKits() which holds the script name

See Also:
Constant Field Values

SCRIPT_LOC

static final int SCRIPT_LOC
The index of the element in a String[] contained in the vector returned by listKits() which holds the script location

See Also:
Constant Field Values
Method Detail

listKits

java.util.Vector listKits()
                          throws java.net.MalformedURLException,
                                 java.io.IOException
This method lists the available kits. The kits are collected from: 1. A text file with list of kits in an XML-like format. First the system property EXTERNAL_XML is checked for location of an external text file with kits list. If it is empty or not present, the file with name KITLIST_FILENAME in /bin/pscripts is used by default if present. 2. If a local file system exists, the directories listed in the system property LOCAL_SCRIPT_DIRS will be searched for install scripts.

Returns:
a vector of kits - every kit is a String[] {name, script_location}
Throws:
java.io.IOException - If an exception occurred while reading the kitslist file
java.net.MalformedURLException - if the EXTERNAL_XML property contains invalid URL.

installKit

InstallStatus installKit(java.lang.String relativeScriptLoc,
                         boolean repairOption)
                         throws java.io.IOException
This method receives an install script, parses it, replaces the locations as needed with the corrected remote locations and executes the commands through the Parser Service. The script is expected to contain info for the name, vendor and version of the bundles to be installed in the form of comments as well as info for the default alias and group of the postlet of this kit if any. The bundles are compared to the existing bundles in the Framework by {name, vendor, version} if all three exist; by location otherwise. If a match is found, the bundle is not installed.

Parameters:
relativeScriptLoc - The location of the install script.
repairOption - If true, the Bundle-Name, Bundle-Vendor and Bundle-Version comments in the install script will be corrected with the info from the manifests of the installed bundles or the matching bundles in the Framework
Throws:
java.io.IOException - If an exception occurred during the analysis or installation (like invalid location of the script or a bundle).

uninstallKit

DependencyList uninstallKit(java.lang.String relativeScriptLoc,
                            boolean doUninstall)
                            throws java.io.IOException
This method receives an install script, parses it, replaces the locations as needed with the corrected remote locations and uninstalls the bundles found in the install script. First, the bundles are compared to the existing bundles in the Framework by location to determine their IDs. Second, a dependance analysis is done to detemine if some other bundle in the Framework (not part of this kit) depends on a bundle of the kit (i.e. imports a package that is exported by a bundle of the kit and there is no other provider of this package in the Framework). If such dependance is found, the minimum set of needed kit bundles is calculated and no uninstallation is done; the method returns full info for the dependancies instead. The caller of this service is expected to ask the user for the appropriate action and then call uninstallList(long[] ids). If no dependance is found, the bundles are uninstalled and info about the sucess of the uninstallations is returned in the description in the DependencyList object. If the script has not previously been installed, null is returned.

Parameters:
relativeScriptLoc - The location of the install script.
doUninstall - Whether to uninstall all bundles if no dependencies are found or wait for confirmation. if false, the method serves as a dependencies analyser.
Throws:
java.io.IOException - If an exception occurred during the analysis or uninstallation (like invalid location of the script or a bundle).

uninstallList

java.lang.String uninstallList(long[] ids)
                               throws java.io.IOException
Uninstalls the list of Bundle IDs.

Parameters:
ids - an array with the Bundle IDs to be uninstalled.
Throws:
java.io.IOException - If an exception occurred during the analysis or uninstallation.

analyseKit

KitStatus analyseKit(java.lang.String relativeScriptLoc)
                     throws java.io.IOException
This method receives an install script, parses it, finds the bundles that were installed by that script and returns detailed info for the kit state - installed/not installed/bad script and the state of the bundles - present/ installed/not installed.

Parameters:
relativeScriptLoc - The location of the install script.
Throws:
java.io.IOException - If an exception occurred during the analysis (like invalid location of the script or a bundle).

Framework Professional Edition Package


Copyright © 1999-2007 ProSyst Software GmbH. All Rights Reserved