|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tivoli.twg.SoftwarePackageEditor.TWGSwPkgMgr
Class to use to manage the creation and deletion of packages programatically.
Nested Class Summary | |
---|---|
static interface |
TWGSwPkgMgr.PkgTaskListener
Interface those classes interested in listening for package creation events should implement |
Field Summary | |
---|---|
static int |
CANNOT_ACCESS_PACKAGE
Another ServiceNode has a lock on this package |
static int |
COMMUNICATION_ERROR
A problem communicating with, or starting the server |
protected static int |
CREATE
Control variables for package saving and creation |
protected static int |
DELETE
|
static int |
FAIL_DUPLICATE_PKG_NAME
A package with the same name already exists |
static int |
FILE_SIGNATURE_INVALID
A file does not have a valid signature |
static int |
FILE_SIZE_LIMIT_EXCEEDED
Package has exceeded its total file size limit or a file has exceeded its size limit |
static int |
FULL_FUNCTION_REQUIRED
You cannot do this without a full function release of Director |
static int |
GENERAL_ERROR
A general failure occured |
static int |
IO_ERROR
An error occured reading or writing data |
static int |
PACKAGE_SIGNATURE_INVALID
This package does not have a valid signature, and we require one |
protected static int |
SAVE
|
static int |
SUCCESS
Action was sucessful |
Constructor Summary | |
---|---|
TWGSwPkgMgr()
|
Method Summary | |
---|---|
static long |
createDistributionJob(java.lang.String pkgId,
LongValueSet moids,
int flags,
int maxActs,
int maxDays,
ServiceNode sn)
Creates a distribute job. |
static long |
createDistributionJob(java.lang.String pkgId,
LongValueSet moids,
ServiceNode sn)
Creates a distribute job. |
static void |
createPackage(TWGSwPackage toCreate,
ServiceNode sn,
TWGSwPkgMgr.PkgTaskListener ptl)
Deprecated. As of Director 3.1 |
static void |
createPkg(com.tivoli.twg.SoftwarePackageEditor.pkg.PkgInstall pkg,
ServiceNode sn,
TWGSwPkgMgr.PkgTaskListener ptl)
Creates the given software package. |
static void |
createPkgUninstall(java.lang.String pkgId,
ServiceNode sn,
java.lang.String pkgName,
TWGSwPkgMgr.PkgTaskListener ptl)
Creates an uninstall package from the given custom package. |
static void |
deletePackage(java.lang.String pkgId,
ServiceNode sn,
TWGSwPkgMgr.PkgTaskListener ptl)
Delete a package |
static void |
exportPackage(FileSource fs,
java.lang.String path,
ServiceNode sn,
java.lang.String pkgId,
TWGSwPkgMgr.PkgTaskListener ptl)
Exports a package to a .bfp file. |
static java.util.ArrayList |
getPackageIds(ServiceNode sn)
Gets the packages that exist on the server. |
static void |
importPackage(FileSource fs,
java.lang.String path,
ServiceNode sn,
java.lang.String title,
boolean webReq,
TWGSwPkgMgr.PkgTaskListener ptl)
Imports a package from a .bfp file. |
static TWGSwPackage |
loadPackage(java.lang.String pkgId,
ServiceNode sn)
Load Package from the server |
static com.tivoli.twg.SoftwarePackageEditor.pkg.PkgInstall |
loadPkg(java.lang.String pkgId,
ServiceNode sn)
|
static boolean |
lockForRead(java.lang.String pkgId,
ServiceNode sn)
Lock a package for read |
static TWGSwPackage |
lockForWrite(java.lang.String pkgId,
ServiceNode sn)
Lock a package for write. |
static java.lang.String |
pkgIdToTaskId(java.lang.String pkgId)
Converts a package id to a task id. |
static void |
savePackage(java.lang.String pkgId,
TWGSwPackage toSave,
ServiceNode sn,
TWGSwPkgMgr.PkgTaskListener ptl)
Saves the given software package over an existing one. |
static void |
savePkg(java.lang.String pkgId,
com.tivoli.twg.SoftwarePackageEditor.pkg.PkgInstall pkg,
ServiceNode sn,
TWGSwPkgMgr.PkgTaskListener ptl)
|
static java.lang.String |
taskIdToPkgId(java.lang.String taskId)
Converts a task id to a package id. |
static boolean |
unlockForRead(java.lang.String pkgId,
ServiceNode sn)
Release a package that is locked for read |
static boolean |
unlockForWrite(java.lang.String pkgId,
ServiceNode sn)
Release a package that is locked for write. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SUCCESS
public static final int GENERAL_ERROR
public static final int COMMUNICATION_ERROR
public static final int CANNOT_ACCESS_PACKAGE
public static final int PACKAGE_SIGNATURE_INVALID
public static final int IO_ERROR
public static final int FULL_FUNCTION_REQUIRED
public static final int FILE_SIZE_LIMIT_EXCEEDED
public static final int FILE_SIGNATURE_INVALID
public static final int FAIL_DUPLICATE_PKG_NAME
protected static final int CREATE
protected static final int SAVE
protected static final int DELETE
Constructor Detail |
public TWGSwPkgMgr()
Method Detail |
public static java.lang.String pkgIdToTaskId(java.lang.String pkgId)
public static java.lang.String taskIdToPkgId(java.lang.String taskId)
java.lang.IllegalArgumentException
- if given taskId is not a valid software package taskId.public static long createDistributionJob(java.lang.String pkgId, LongValueSet moids, ServiceNode sn)
pkgId
- the package to distribute.moids
- a set of moids the package should be distributed to.sn
- the service node to use for task commands to the server.
public static long createDistributionJob(java.lang.String pkgId, LongValueSet moids, int flags, int maxActs, int maxDays, ServiceNode sn)
pkgId
- the package to distribute.moids
- a set of moids the package should be distributed to.sn
- the service node to use for task commands to the server.flags
- the flags for the created jobmaxActs
- the maximum number of jobActivations to keep as historymaxDays
- the maximum number of days to keep a TWGJobActivation object as history
public static void createPkg(com.tivoli.twg.SoftwarePackageEditor.pkg.PkgInstall pkg, ServiceNode sn, TWGSwPkgMgr.PkgTaskListener ptl)
pkg
- - package to createsn
- - service node to send commands to the server onptl
- - listener to listen for the completion of the creation. can be null if
not neededpublic static void createPackage(TWGSwPackage toCreate, ServiceNode sn, TWGSwPkgMgr.PkgTaskListener ptl)
toCreate
- the package definitionsn
- the service node to send commands to the server onptl
- a listener to listen for the completion of the creation. Can be null if not needed.createPkg
public static void createPkgUninstall(java.lang.String pkgId, ServiceNode sn, java.lang.String pkgName, TWGSwPkgMgr.PkgTaskListener ptl)
pkgId
- - custom package idsn
- - the service node to send commands to the server onpkgName
- - name of the new uninstall packageptl
- - a listener to listen for the completion of the creation. Can be null if not needed.public static void savePkg(java.lang.String pkgId, com.tivoli.twg.SoftwarePackageEditor.pkg.PkgInstall pkg, ServiceNode sn, TWGSwPkgMgr.PkgTaskListener ptl)
public static void savePackage(java.lang.String pkgId, TWGSwPackage toSave, ServiceNode sn, TWGSwPkgMgr.PkgTaskListener ptl)
toSave
- the package definition to savesn
- the service node to send commands to the server onptl
- a listener to listen for the completion of the save. Can be null if not needed.pkgId
- the id of the package to replacelockForWrite
,
unlockForWrite
public static java.util.ArrayList getPackageIds(ServiceNode sn)
sn
- the service node to use for communication
public static com.tivoli.twg.SoftwarePackageEditor.pkg.PkgInstall loadPkg(java.lang.String pkgId, ServiceNode sn)
public static TWGSwPackage loadPackage(java.lang.String pkgId, ServiceNode sn)
pkgId
- the id of the package to load.
public static void exportPackage(FileSource fs, java.lang.String path, ServiceNode sn, java.lang.String pkgId, TWGSwPkgMgr.PkgTaskListener ptl)
fs
- The FileSource that these files should be loaded from.path
- The path of the .bfp file to export the software package to.sn
- The service node for use when communicating with the server.pkgId
- The package id of the package to exportptl
- Who is listening for the end of the importpublic static void importPackage(FileSource fs, java.lang.String path, ServiceNode sn, java.lang.String title, boolean webReq, TWGSwPkgMgr.PkgTaskListener ptl)
fs
- The FileSource that these files should be loaded from.path
- The path of the .bfp file to import the software package from.sn
- The service node for use when communicating with the server.title
- The title to give the imported package.webReq
- Should this package be web requestable once imported.ptl
- Who is listening for the end of the importpublic static void deletePackage(java.lang.String pkgId, ServiceNode sn, TWGSwPkgMgr.PkgTaskListener ptl)
pkgId
- the id pf the package to deletesn
- the service node to use when communicating with the serverptl
- a listener fo the result of the deletepublic static boolean lockForRead(java.lang.String pkgId, ServiceNode sn)
pkgId
- the id of the package to lock for readsn
- the service node to use to communicate with server. You must use this servicenode to unlock the package
public static boolean unlockForRead(java.lang.String pkgId, ServiceNode sn)
pkgId
- the id of the package to release the lock for read forsn
- the service node to use to communicate to the server.
Must be the same service node used to lock the package.
public static TWGSwPackage lockForWrite(java.lang.String pkgId, ServiceNode sn)
pkgId
- the id of the package to lock for writesn
- the service node to use to communicate with server.
You must use this servicenode to unlock the package
public static boolean unlockForWrite(java.lang.String pkgId, ServiceNode sn)
pkgId
- the id of the package to release the lock for write forsn
- the service node to use to communicate to the server.
Must be the same service node used to lock the package.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |