public class ConnectBroker extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DISTRIBUTION_MP_DIR_DEFAULT |
static String |
OPTION_ACCEPT_DEFAULT |
static String |
OPTION_RELAX_DEFAULT |
static String |
PACKAGES_XML |
static String |
PARAM_MP_DIR |
static String[] |
POSITIVE_ANSWERS |
Constructor and Description |
---|
ConnectBroker(Environment env) |
Modifier and Type | Method and Description |
---|---|
boolean |
addDistributionPackages() |
boolean |
executePending(File commandsFile,
boolean doExecute,
boolean useResolver) |
String |
getCLID() |
CommandSetInfo |
getCommandSet() |
org.nuxeo.connect.packages.PackageManager |
getPackageManager() |
List<org.nuxeo.connect.update.LocalPackage> |
getPkgList() |
StandaloneUpdateService |
getUpdateService() |
boolean |
listPending(File commandsFile) |
static String |
parseAnswer(String answer) |
boolean |
pkgAdd(List<String> pkgsToAdd)
Add a list of packages into the cache, downloading them if needed and possible.
|
boolean |
pkgAdd(List<String> pkgsToAdd,
boolean ignoreMissing)
Add a list of packages into the cache, downloading them if needed and possible.
|
org.nuxeo.connect.update.LocalPackage |
pkgAdd(String packageFileName)
Add a package file into the cache
|
org.nuxeo.connect.update.LocalPackage |
pkgAdd(String packageFileName,
boolean ignoreMissing)
Add a package file into the cache
|
boolean |
pkgHotfix() |
boolean |
pkgInstall(List<String> packageIdsToInstall)
Install a list of local packages.
|
boolean |
pkgInstall(List<String> packageIdsToInstall,
boolean ignoreMissing)
Install a list of local packages.
|
org.nuxeo.connect.update.LocalPackage |
pkgInstall(String pkgId)
Install a local package.
|
org.nuxeo.connect.update.LocalPackage |
pkgInstall(String pkgId,
boolean ignoreMissing)
Install a local package.
|
void |
pkgList() |
void |
pkgList(List<? extends org.nuxeo.connect.update.Package> packagesList) |
void |
pkgListAll() |
boolean |
pkgPurge() |
boolean |
pkgRemove(List<String> pkgsToRemove)
Remove a list of packages from cache.
|
org.nuxeo.connect.update.LocalPackage |
pkgRemove(String pkgId)
Remove a package from cache.
|
boolean |
pkgRequest(List<String> pkgsToAdd,
List<String> pkgsToInstall,
List<String> pkgsToUninstall,
List<String> pkgsToRemove) |
boolean |
pkgRequest(List<String> pkgsToAdd,
List<String> pkgsToInstall,
List<String> pkgsToUninstall,
List<String> pkgsToRemove,
boolean keepExisting) |
boolean |
pkgRequest(List<String> pkgsToAdd,
List<String> pkgsToInstall,
List<String> pkgsToUninstall,
List<String> pkgsToRemove,
boolean keepExisting,
boolean ignoreMissing) |
boolean |
pkgReset() |
boolean |
pkgSet(List<String> pkgList)
Installs a list of packages and uninstalls the rest (no dependency check)
|
boolean |
pkgSet(List<String> pkgList,
boolean ignoreMissing)
Installs a list of packages and uninstalls the rest (no dependency check)
|
boolean |
pkgShow(List<String> packages) |
boolean |
pkgUninstall(List<String> packageIdsToRemove)
Uninstall a list of packages.
|
org.nuxeo.connect.update.LocalPackage |
pkgUninstall(String pkgId)
Uninstall a local package.
|
boolean |
pkgUpgrade() |
void |
refreshCache() |
void |
setAccept(String acceptValue) |
void |
setAllowSNAPSHOT(boolean allow) |
void |
setCLID(String file) |
void |
setRelax(String relaxValue)
Must be called after
setAccept(String) which overwrites its value. |
public static final String PARAM_MP_DIR
public static final String DISTRIBUTION_MP_DIR_DEFAULT
public static final String PACKAGES_XML
public static final String[] POSITIVE_ANSWERS
public static final String OPTION_RELAX_DEFAULT
public static final String OPTION_ACCEPT_DEFAULT
public ConnectBroker(Environment env) throws IOException, org.nuxeo.connect.update.PackageException
IOException
org.nuxeo.connect.update.PackageException
public String getCLID() throws org.nuxeo.connect.identity.LogicalInstanceIdentifier.NoCLID
org.nuxeo.connect.identity.LogicalInstanceIdentifier.NoCLID
public void setCLID(String file) throws org.nuxeo.connect.identity.LogicalInstanceIdentifier.NoCLID
org.nuxeo.connect.identity.LogicalInstanceIdentifier.NoCLID
public StandaloneUpdateService getUpdateService()
public org.nuxeo.connect.packages.PackageManager getPackageManager()
public void refreshCache()
public CommandSetInfo getCommandSet()
public boolean addDistributionPackages()
public List<org.nuxeo.connect.update.LocalPackage> getPkgList()
public void pkgList()
public void pkgListAll()
public void pkgList(List<? extends org.nuxeo.connect.update.Package> packagesList)
public boolean pkgReset()
public boolean pkgPurge() throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
public boolean pkgUninstall(List<String> packageIdsToRemove)
packageIdsToRemove
- The list can contain package IDs and namespkgUninstall(String)
public org.nuxeo.connect.update.LocalPackage pkgUninstall(String pkgId)
pkgId
- Package ID or Namepublic boolean pkgRemove(List<String> pkgsToRemove)
pkgsToRemove
- The list can contain package IDs and namespkgRemove(String)
public org.nuxeo.connect.update.LocalPackage pkgRemove(String pkgId)
pkgId
- Package ID or Namepublic boolean pkgAdd(List<String> pkgsToAdd)
pkgsToAdd
- pkgAdd(String)
public boolean pkgAdd(List<String> pkgsToAdd, boolean ignoreMissing)
pkgsToAdd
- ignoreMissing
- pkgAdd(String)
public org.nuxeo.connect.update.LocalPackage pkgAdd(String packageFileName)
packageFileName
- public org.nuxeo.connect.update.LocalPackage pkgAdd(String packageFileName, boolean ignoreMissing)
packageFileName
- ignoreMissing
- public boolean pkgInstall(List<String> packageIdsToInstall)
packageIdsToInstall
- The list can contain package IDs and namespkgInstall(String)
public boolean pkgInstall(List<String> packageIdsToInstall, boolean ignoreMissing)
packageIdsToInstall
- The list can contain package IDs and namesignoreMissing
- If true, doesn't throw an exception on unknown packagespkgInstall(String)
public org.nuxeo.connect.update.LocalPackage pkgInstall(String pkgId)
pkgId
- Package ID or Namepublic org.nuxeo.connect.update.LocalPackage pkgInstall(String pkgId, boolean ignoreMissing)
pkgId
- Package ID or NameignoreMissing
- If true, doesn't throw an exception on unknown packagespublic boolean listPending(File commandsFile)
public boolean executePending(File commandsFile, boolean doExecute, boolean useResolver)
commandsFile
- File containing the commands to executedoExecute
- Whether to execute or list the actionsuseResolver
- Whether to use full resolution or just execute individual actionspublic boolean pkgRequest(List<String> pkgsToAdd, List<String> pkgsToInstall, List<String> pkgsToUninstall, List<String> pkgsToRemove)
public boolean pkgRequest(List<String> pkgsToAdd, List<String> pkgsToInstall, List<String> pkgsToUninstall, List<String> pkgsToRemove, boolean keepExisting)
keepExisting
- If false, the request will remove existing packages that are not part of the resolutionpublic boolean pkgRequest(List<String> pkgsToAdd, List<String> pkgsToInstall, List<String> pkgsToUninstall, List<String> pkgsToRemove, boolean keepExisting, boolean ignoreMissing)
keepExisting
- If false, the request will remove existing packages that are not part of the resolutionignoreMissing
- Do not error out on missing packages, just handle the restpublic boolean pkgSet(List<String> pkgList)
public boolean pkgSet(List<String> pkgList, boolean ignoreMissing)
public static String parseAnswer(String answer)
"true"
if answer is in POSITIVE_ANSWERS
, and "ask"
if answer values
"ask"
, else return "false"
public boolean pkgHotfix()
public boolean pkgUpgrade()
public void setRelax(String relaxValue)
setAccept(String)
which overwrites its value.relaxValue
- true, false or ask; ignored if nullpublic void setAccept(String acceptValue)
acceptValue
- true, false or ask; if true or ask, then calls setRelax(String)
with the same value;
ignored if nullpublic boolean pkgShow(List<String> packages)
packages
- List of packages identified by their ID, name or local filename.public void setAllowSNAPSHOT(boolean allow)
Copyright © 2015 Nuxeo SA. All rights reserved.