public abstract class AbstractTask extends Object implements org.nuxeo.connect.update.task.Task
Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
env
A map of environment key/values that can be used in XML install files as variables.
|
static String |
ENV_BUNDLES |
static String |
ENV_CONFIG |
static String |
ENV_EAR
Set only on JBoss - the EAR root directory path
|
static String |
ENV_HOME |
static String |
ENV_HOSTAPP_NAME
The host application name.
|
static String |
ENV_HOSTAPP_VERSION
The host application version
|
static String |
ENV_LIB |
static String |
ENV_SERVER_HOME |
static String |
ENV_SYSLIB |
static String |
ENV_TEMPLATES |
static String |
ENV_TIMESTAMP |
protected org.nuxeo.connect.update.LocalPackage |
pkg |
static String |
PKG_ID |
static String |
PKG_NAME |
static String |
PKG_ROOT |
static String |
PKG_VERSION |
protected boolean |
restart |
protected String |
serverPathPrefix |
protected org.nuxeo.connect.update.PackageUpdateService |
service |
protected UpdateManager |
updateMgr |
protected boolean |
updateMgrLoaded |
Constructor and Description |
---|
AbstractTask(org.nuxeo.connect.update.PackageUpdateService pus) |
Modifier and Type | Method and Description |
---|---|
protected Map<Object,Object> |
createContextMap(Map<String,String> params) |
protected abstract void |
doRollback() |
protected abstract void |
doRun(Map<String,String> params) |
abstract void |
doValidate(org.nuxeo.connect.update.ValidationStatus status) |
File |
getFile(String key)
Get a file given its key in the environment map.
|
org.nuxeo.connect.update.LocalPackage |
getPackage() |
String |
getRelativeFilePath(File file) |
UpdateManager |
getUpdateManager() |
void |
initialize(org.nuxeo.connect.update.LocalPackage pkg,
boolean restart) |
abstract boolean |
isInstallTask() |
boolean |
isRestartRequired() |
protected String |
loadParametrizedFile(File file,
Map<String,String> params) |
void |
rollback() |
protected abstract void |
rollbackDone() |
void |
run(Map<String,String> params) |
protected void |
saveParams(Map<String,String> params) |
void |
setRestartRequired(boolean isRestartRequired) |
protected abstract void |
taskDone() |
org.nuxeo.connect.update.ValidationStatus |
validate() |
protected org.nuxeo.connect.update.LocalPackage |
validateInstall(org.nuxeo.connect.update.ValidationStatus status) |
public static final String PKG_ID
public static final String PKG_NAME
public static final String PKG_VERSION
public static final String PKG_ROOT
public static final String ENV_HOME
public static final String ENV_SERVER_HOME
public static final String ENV_EAR
public static final String ENV_LIB
public static final String ENV_SYSLIB
public static final String ENV_BUNDLES
public static final String ENV_CONFIG
public static final String ENV_TEMPLATES
public static final String ENV_TIMESTAMP
public static final String ENV_HOSTAPP_NAME
public static final String ENV_HOSTAPP_VERSION
protected boolean restart
protected org.nuxeo.connect.update.LocalPackage pkg
protected String serverPathPrefix
protected UpdateManager updateMgr
protected boolean updateMgrLoaded
protected org.nuxeo.connect.update.PackageUpdateService service
public AbstractTask(org.nuxeo.connect.update.PackageUpdateService pus)
public abstract boolean isInstallTask()
public void initialize(org.nuxeo.connect.update.LocalPackage pkg, boolean restart) throws org.nuxeo.connect.update.PackageException
initialize
in interface org.nuxeo.connect.update.task.Task
org.nuxeo.connect.update.PackageException
public File getFile(String key)
key
- public boolean isRestartRequired()
isRestartRequired
in interface org.nuxeo.connect.update.task.Task
public org.nuxeo.connect.update.LocalPackage getPackage()
getPackage
in interface org.nuxeo.connect.update.task.Task
protected String loadParametrizedFile(File file, Map<String,String> params) throws IOException
IOException
protected void saveParams(Map<String,String> params) throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
public void run(Map<String,String> params) throws org.nuxeo.connect.update.PackageException
run
in interface org.nuxeo.connect.update.task.Task
org.nuxeo.connect.update.PackageException
public UpdateManager getUpdateManager() throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
protected abstract void rollbackDone() throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
protected abstract void taskDone() throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
public void rollback() throws org.nuxeo.connect.update.PackageException
rollback
in interface org.nuxeo.connect.update.task.Task
org.nuxeo.connect.update.PackageException
public void setRestartRequired(boolean isRestartRequired)
setRestartRequired
in interface org.nuxeo.connect.update.task.Task
protected abstract void doRun(Map<String,String> params) throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
protected abstract void doRollback() throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
public org.nuxeo.connect.update.ValidationStatus validate() throws org.nuxeo.connect.update.PackageException
validate
in interface org.nuxeo.connect.update.task.Task
org.nuxeo.connect.update.PackageException
public abstract void doValidate(org.nuxeo.connect.update.ValidationStatus status) throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
protected org.nuxeo.connect.update.LocalPackage validateInstall(org.nuxeo.connect.update.ValidationStatus status) throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
public String getRelativeFilePath(File file)
getRelativeFilePath
in interface org.nuxeo.connect.update.task.Task
Copyright © 2015 Nuxeo SA. All rights reserved.