sfi.director.application.DirectorPackage Class Reference

List of all members.

Detailed Description

Implements basic packaging functions for Director's native package format.

Functions include creation and installation of packages.


Public Member Functions

 DirectorPackage ()
 DirectorPackage (DBObject desc) throws DirectorException
 Init package object from a database entry.
void close ()
 Close this package object.
DBObject todb () throws DirectorException
 Dump package description into a database entry of class directorApplication.
DBObject topkgdb () throws DirectorException
 Dump package description into a database entry of class directorApplicationPackage.
void setReleaseDir (String dir)
 Set release directory.
void setRelease (String release) throws DirectorException
 Set release number.
void setFreezeMode (int mode)
 Set freeze mode for next freeze().
void incrementRelease ()
 increment the release number by one.
void getInfo (ZipInputStream archive) throws DirectorException
 Read application info from a package file.
void getInfo () throws DirectorException
 Read application info from .rel/meta/app_info.dat file this is mainly used when using "app_import" to import an application from another director environment.
void getInfo (BufferedReader info) throws DirectorException
 Read application info from an anonymous app_info.dat stream.
String getRelease () throws DirectorException
 return string representation of the application's release
boolean haveFreeze () throws DirectorException
 return true if there is an archive containing a freeze for the current release, false otherwise.
void writeInfo () throws DirectorException
 Dump application info into .rel/meta/app_info.dat.
void determineFilesInRelease (OutputStream fullInfo, OutputStream list, OutputStream deleteList, String baseListName) throws DirectorException
 Determine the paths of all the files that should be included in the current release.
int execScript (String nameAndArgs)
 Execute a package related script.
int execMetaScript (String name) throws DirectorException
 Execute a package related script, e.g.
void setReason (String reason)
 Set reason for next freeze().
void setUser (String user)
 Set freezing user for next freeze().
synchronized void freeze () throws DirectorException
 Freeze a specified application.
void unpackCpio (InputStream archive, String targetDir) throws DirectorException
void install (InputStream packageStream) throws DirectorException
 Install a package.

Static Public Member Functions

static Vector deleteTree (Vector tree)
 Recursively delete all files listed in a Vector.
static void scanRepository (RemoteJob job) throws DirectorException
 Scan a directory for director packages and send a list of found packages back to our caller.
static void main (String args[])

Static Public Attributes

static final int BASELINE = 0
 possible freeze modes set via setFreezeMode are BASELINE, UPDATE and PATCH.
static final int UPDATE = 1
static final int PATCH = 2

Protected Member Functions

void finalize ()
File removeOnClose (File file)
 Add file to the list of files to be deleted during close().
File removeOnClose (String filename)
 Create file object for file with the specified name and add it to the list of files to be deleted during close().
void fromDesc (DBObject desc) throws DirectorException
 Set package variables from a database entry.
String relDir () throws DirectorException
String metaDir () throws DirectorException
void determineRelease (boolean next) throws DirectorException
OutputStream packCpio (final OutputStream archive) throws DirectorException
void setExecutable (String path)
void deleteRecursively (String fname, int depth)
DirectorException moveFiles (String source, String target, int depth)
 Move a directory tree located under 'source' to a directory 'target'.
synchronized void unpackUsingArchiver (final InputStream archive, String targetDir, String command, boolean packNmove, boolean verboseList) throws DirectorException
ZipEntry extractMetaFiles (ZipEntry next, String prefix, ZipInputStream archive) throws IOException, DirectorException
void cleanUpSub (FileListComparer comparer, String dir, String prefix) throws DirectorException
void cleanUp (String dir, String prefix, BufferedReader fileList) throws DirectorException

Protected Attributes

Process packer = null
StoppableThread packerThread = null
DirectorException bgerror = null

Package Attributes

String releaseDir
int update
String release
int releaseParts []
String instdir
String owner
String name
boolean cleanAfterInstall = false
boolean unpackAndMove = true
String description
String version
String creator
String maintainer
String defined
String installer
Vector removeOnClose = new Vector()
Vector provides = null
Vector requires = null
Vector implications = null
String relDir = null
String reason = null
String user = null
String platform = null

Static Package Attributes

static final String bootDir = "/etc/sfi/boot/"
static final String appsDir = "/etc/sfi/apps/"
static final String rootExceptions []
static final String indepthExceptions []


Constructor & Destructor Documentation

sfi.director.application.DirectorPackage.DirectorPackage  ) 
 

sfi.director.application.DirectorPackage.DirectorPackage DBObject  desc  )  throws DirectorException
 

Init package object from a database entry.


Member Function Documentation

void sfi.director.application.DirectorPackage.cleanUp String  dir,
String  prefix,
BufferedReader  fileList
throws DirectorException [protected]
 

void sfi.director.application.DirectorPackage.cleanUpSub FileListComparer  comparer,
String  dir,
String  prefix
throws DirectorException [protected]
 

void sfi.director.application.DirectorPackage.close  ) 
 

Close this package object.

Cleans up temporary files, etc.

void sfi.director.application.DirectorPackage.deleteRecursively String  fname,
int  depth
[protected]
 

static Vector sfi.director.application.DirectorPackage.deleteTree Vector  tree  )  [static]
 

Recursively delete all files listed in a Vector.

void sfi.director.application.DirectorPackage.determineFilesInRelease OutputStream  fullInfo,
OutputStream  list,
OutputStream  deleteList,
String  baseListName
throws DirectorException
 

Determine the paths of all the files that should be included in the current release.

Parameters:
fullInfo stream where the full file info (including file attributes) is written to
list stream where the paths (one per line) are written to
deleteList stream where the paths of the files to be deleted in this release are written to
baseListName name of a file containing the full file info of a former (baseline) release this release is an incremental from. The baseListName file is a file originally written by determineFilesInRelease via the fullInfo argument.

void sfi.director.application.DirectorPackage.determineRelease boolean  next  )  throws DirectorException [protected]
 

int sfi.director.application.DirectorPackage.execMetaScript String  name  )  throws DirectorException
 

Execute a package related script, e.g.

a post-install script.

int sfi.director.application.DirectorPackage.execScript String  nameAndArgs  ) 
 

Execute a package related script.

ExecScript changes directory to the release/installation directory before invoking the script.

ZipEntry sfi.director.application.DirectorPackage.extractMetaFiles ZipEntry  next,
String  prefix,
ZipInputStream  archive
throws IOException, DirectorException [protected]
 

void sfi.director.application.DirectorPackage.finalize  )  [protected]
 

synchronized void sfi.director.application.DirectorPackage.freeze  )  throws DirectorException
 

Freeze a specified application.

void sfi.director.application.DirectorPackage.fromDesc DBObject  desc  )  throws DirectorException [protected]
 

Set package variables from a database entry.

void sfi.director.application.DirectorPackage.getInfo BufferedReader  info  )  throws DirectorException
 

Read application info from an anonymous app_info.dat stream.

void sfi.director.application.DirectorPackage.getInfo  )  throws DirectorException
 

Read application info from .rel/meta/app_info.dat file this is mainly used when using "app_import" to import an application from another director environment.

void sfi.director.application.DirectorPackage.getInfo ZipInputStream  archive  )  throws DirectorException
 

Read application info from a package file.

String sfi.director.application.DirectorPackage.getRelease  )  throws DirectorException
 

return string representation of the application's release

boolean sfi.director.application.DirectorPackage.haveFreeze  )  throws DirectorException
 

return true if there is an archive containing a freeze for the current release, false otherwise.

void sfi.director.application.DirectorPackage.incrementRelease  ) 
 

increment the release number by one.

Depending on the contents of the update variable the respective chunk of the number will be incremented.

See also:
setFreezeMode(int)

void sfi.director.application.DirectorPackage.install InputStream  packageStream  )  throws DirectorException
 

Install a package.

The input file must be an archive as created by the freeze() method.

See also:
freeze()

static void sfi.director.application.DirectorPackage.main String  args[]  )  [static]
 

String sfi.director.application.DirectorPackage.metaDir  )  throws DirectorException [protected]
 

DirectorException sfi.director.application.DirectorPackage.moveFiles String  source,
String  target,
int  depth
[protected]
 

Move a directory tree located under 'source' to a directory 'target'.

Do not throw Exceptions. Instead, try to traverse the whole tree and only then return a possible Exception as the return value.

OutputStream sfi.director.application.DirectorPackage.packCpio final OutputStream  archive  )  throws DirectorException [protected]
 

String sfi.director.application.DirectorPackage.relDir  )  throws DirectorException [protected]
 

File sfi.director.application.DirectorPackage.removeOnClose String  filename  )  [protected]
 

Create file object for file with the specified name and add it to the list of files to be deleted during close().

File sfi.director.application.DirectorPackage.removeOnClose File  file  )  [protected]
 

Add file to the list of files to be deleted during close().

static void sfi.director.application.DirectorPackage.scanRepository RemoteJob  job  )  throws DirectorException [static]
 

Scan a directory for director packages and send a list of found packages back to our caller.

If job argument "freeze" is set baseline freeze any application which is not frozen yet.

void sfi.director.application.DirectorPackage.setExecutable String  path  )  [protected]
 

void sfi.director.application.DirectorPackage.setFreezeMode int  mode  ) 
 

Set freeze mode for next freeze().

Valid freeze modes are BASELINE, UPDATE and PATCH.

See also:
freeze()

void sfi.director.application.DirectorPackage.setReason String  reason  ) 
 

Set reason for next freeze().

void sfi.director.application.DirectorPackage.setRelease String  release  )  throws DirectorException
 

Set release number.

void sfi.director.application.DirectorPackage.setReleaseDir String  dir  ) 
 

Set release directory.

void sfi.director.application.DirectorPackage.setUser String  user  ) 
 

Set freezing user for next freeze().

DBObject sfi.director.application.DirectorPackage.todb  )  throws DirectorException
 

Dump package description into a database entry of class directorApplication.

DBObject sfi.director.application.DirectorPackage.topkgdb  )  throws DirectorException
 

Dump package description into a database entry of class directorApplicationPackage.

void sfi.director.application.DirectorPackage.unpackCpio InputStream  archive,
String  targetDir
throws DirectorException
 

synchronized void sfi.director.application.DirectorPackage.unpackUsingArchiver final InputStream  archive,
String  targetDir,
String  command,
boolean  packNmove,
boolean  verboseList
throws DirectorException [protected]
 

void sfi.director.application.DirectorPackage.writeInfo  )  throws DirectorException
 

Dump application info into .rel/meta/app_info.dat.


Member Data Documentation

final String sfi.director.application.DirectorPackage.appsDir = "/etc/sfi/apps/" [static, package]
 

final int sfi.director.application.DirectorPackage.BASELINE = 0 [static]
 

possible freeze modes set via setFreezeMode are BASELINE, UPDATE and PATCH.

A release number is always a three-chunk number like 001.02.03. The BASELINE/UPDATE/PATCH constants correspond with the respective chunk's index.

See also:
setFreezeMode(int)

DirectorException sfi.director.application.DirectorPackage.bgerror = null [protected]
 

final String sfi.director.application.DirectorPackage.bootDir = "/etc/sfi/boot/" [static, package]
 

boolean sfi.director.application.DirectorPackage.cleanAfterInstall = false [package]
 

String sfi.director.application.DirectorPackage.creator [package]
 

String sfi.director.application.DirectorPackage.defined [package]
 

String sfi.director.application.DirectorPackage.description [package]
 

Vector sfi.director.application.DirectorPackage.implications = null [package]
 

final String sfi.director.application.DirectorPackage.indepthExceptions[] [static, package]
 

Initial value:

 new String[] {
    "CVS",
    "RCS"
}

String sfi.director.application.DirectorPackage.installer [package]
 

String sfi.director.application.DirectorPackage.instdir [package]
 

String sfi.director.application.DirectorPackage.maintainer [package]
 

String sfi.director.application.DirectorPackage.name [package]
 

String sfi.director.application.DirectorPackage.owner [package]
 

Process sfi.director.application.DirectorPackage.packer = null [protected]
 

StoppableThread sfi.director.application.DirectorPackage.packerThread = null [protected]
 

final int sfi.director.application.DirectorPackage.PATCH = 2 [static]
 

String sfi.director.application.DirectorPackage.platform = null [package]
 

Vector sfi.director.application.DirectorPackage.provides = null [package]
 

String sfi.director.application.DirectorPackage.reason = null [package]
 

String sfi.director.application.DirectorPackage.relDir = null [package]
 

String sfi.director.application.DirectorPackage.release [package]
 

String sfi.director.application.DirectorPackage.releaseDir [package]
 

int sfi.director.application.DirectorPackage.releaseParts[] [package]
 

Vector sfi.director.application.DirectorPackage.removeOnClose = new Vector() [package]
 

Vector sfi.director.application.DirectorPackage.requires = null [package]
 

final String sfi.director.application.DirectorPackage.rootExceptions[] [static, package]
 

Initial value:

 new String[] {
    "CVS",
    "RCS",
    ".rel",
    "internal" 
}

boolean sfi.director.application.DirectorPackage.unpackAndMove = true [package]
 

int sfi.director.application.DirectorPackage.update [package]
 

final int sfi.director.application.DirectorPackage.UPDATE = 1 [static]
 

String sfi.director.application.DirectorPackage.user = null [package]
 

String sfi.director.application.DirectorPackage.version [package]
 


The documentation for this class was generated from the following file:
Generated on Sat May 19 01:19:50 2012 for Node Director by  doxygen 1.4.5