public final class InstallSupport extends Object
OperationContainer
.
Instance of InstallSupport
can be obtained by calling OperationContainer.getSupport()
Typical scenario how to use:
OperationContainer
created for chosen
operation: OperationContainer.createForInstall()
or OperationContainer.createForUninstall()
and contained
correct UpdateElement
s. See OperationContainer
doDownload(org.netbeans.api.progress.ProgressHandle, boolean)
for downloading install data.doValidate(org.netbeans.api.autoupdate.InstallSupport.Validator, org.netbeans.api.progress.ProgressHandle)
for verify consistency of downloaded data.doInstall(org.netbeans.api.autoupdate.InstallSupport.Installer, org.netbeans.api.progress.ProgressHandle)
for install contained UpdateElement
.doRestart(org.netbeans.api.autoupdate.OperationSupport.Restarter, org.netbeans.api.progress.ProgressHandle)
or doRestartLater(org.netbeans.api.autoupdate.OperationSupport.Restarter)
.
UpdateElement element = ...; OperationContainer<InstallSupport> container = createForInstall(); ... add elements ... InstallSupport support = container.getSupport(); Validator v = support.doDownload(null, false); Installer i = support.doValidate(v, null); Restarter r = support.doInstall(i, null); if (r != null) { support.doRestart(r, null); }
Modifier and Type | Class and Description |
---|---|
static class |
InstallSupport.Installer
A helper object returned by a
doValidate(org.netbeans.api.autoupdate.InstallSupport.Validator, org.netbeans.api.progress.ProgressHandle) for invoke
the method doInstall(org.netbeans.api.autoupdate.InstallSupport.Installer, org.netbeans.api.progress.ProgressHandle) |
static class |
InstallSupport.Validator
A helper object returned by a
doDownload(org.netbeans.api.progress.ProgressHandle, boolean) for invoke
the method doValidate(org.netbeans.api.autoupdate.InstallSupport.Validator, org.netbeans.api.progress.ProgressHandle) |
Modifier and Type | Method and Description |
---|---|
void |
doCancel()
Cancels changes done in previous calling methods.
|
InstallSupport.Validator |
doDownload(ProgressHandle progress,
boolean isGlobal)
Deprecated.
Use
doDownload(ProgressHandle, Boolean, boolean) instead. |
InstallSupport.Validator |
doDownload(ProgressHandle progress,
Boolean isGlobal,
boolean useUserdirAsFallback)
Downloads all instances i.e.
|
OperationSupport.Restarter |
doInstall(InstallSupport.Installer installer,
ProgressHandle progress)
Validates all instances that have been verified in the previous step.
|
void |
doRestart(OperationSupport.Restarter restarter,
ProgressHandle progress)
Completes the operation, applies all changes and ensures restart of the application immediately.
|
void |
doRestartLater(OperationSupport.Restarter restarter)
Finishes operation, all the changes will be completed after restart the application.
|
InstallSupport.Installer |
doValidate(InstallSupport.Validator validator,
ProgressHandle progress)
Validates all instances that have been downloaded in the previous step.
|
String |
getCertificate(InstallSupport.Installer validator,
UpdateElement uElement)
Returns java.security.cert.Certificate.toString() of given
UpdateElement . |
OperationContainer<InstallSupport> |
getContainer()
Returns the corresponing
OperationContainer . |
boolean |
isContentModified(InstallSupport.Installer validator,
UpdateElement uElement)
Returns if the
UpdateElement is modified or not. |
boolean |
isSigned(InstallSupport.Installer validator,
UpdateElement uElement)
Returns if the
UpdateElement is signed or not. |
boolean |
isSignedUnverified(InstallSupport.Installer validator,
UpdateElement uElement)
Returns if the
UpdateElement is signed but not verified or not. |
boolean |
isSignedVerified(InstallSupport.Installer validator,
UpdateElement uElement)
Returns if the
UpdateElement is signed and verified or not. |
boolean |
isTrusted(InstallSupport.Installer validator,
UpdateElement uElement)
Returns if the
UpdateElement is trusted or not. |
public InstallSupport.Validator doDownload(ProgressHandle progress, boolean isGlobal) throws OperationException
doDownload(ProgressHandle, Boolean, boolean)
instead.UpdateElement
s in corresponding OperationContainer
.progress
- ProgressHandle for notification progress in downloading, can be null
isGlobal
- if true
then forces download instances into shared directories i.e. installation directoryValidator
an instance of Validator which allows to verify downloaded instances in the next stepOperationException
public InstallSupport.Validator doDownload(ProgressHandle progress, Boolean isGlobal, boolean useUserdirAsFallback) throws OperationException
UpdateElement
s in corresponding OperationContainer
.progress
- ProgressHandle for notification progress in downloading, can be null
isGlobal
- if true
then forces download plugins into shared directories i.e. installation directory,
if false
then download plugins into userdir
. If null
then download plugins in a default place.useUserdirAsFallback
- if true
then download plugins into userdir if no permission to write in shared directoriesValidator
an instance of Validator which allows to verify downloaded instances in the next stepOperationException
public InstallSupport.Installer doValidate(InstallSupport.Validator validator, ProgressHandle progress) throws OperationException
validator
- an instance of Validator
that has been returned by {link @doDownload}. Mustn't be null.progress
- ProgressHandle for notification progress in validation, can be null
Installer
an instance of Installer which allows to install all verified instancesOperationException
doDownload(org.netbeans.api.progress.ProgressHandle, boolean)
public OperationSupport.Restarter doInstall(InstallSupport.Installer installer, ProgressHandle progress) throws OperationException
installer
- an instance of Installer
that has been returned by InstallSupport#doValidate. Mustn't be null.progress
- ProgressHandle for notification progress in installation, can be null
Restarter
an instance of Restart if application restart is required for complete the install operation, or nullOperationException
doValidate(org.netbeans.api.autoupdate.InstallSupport.Validator, org.netbeans.api.progress.ProgressHandle)
public void doCancel() throws OperationException
OperationException
OperationException
public void doRestart(OperationSupport.Restarter restarter, ProgressHandle progress) throws OperationException
doInstall(org.netbeans.api.autoupdate.InstallSupport.Installer, org.netbeans.api.progress.ProgressHandle)
returns non null instance of Restarter
then
this method must be called to apply all changes.restarter
- instance of Restarter
obtained from previous call doInstall(org.netbeans.api.autoupdate.InstallSupport.Installer, org.netbeans.api.progress.ProgressHandle)
. Mustn't be null.progress
- instance of ProgressHandle
or nullOperationException
OperationException
public void doRestartLater(OperationSupport.Restarter restarter)
doInstall(org.netbeans.api.autoupdate.InstallSupport.Installer, org.netbeans.api.progress.ProgressHandle)
returns non null instance of Restarter
then
this method must be called to apply all changesrestarter
- instance of Restarter
obtained from previous call doInstall(org.netbeans.api.autoupdate.InstallSupport.Installer, org.netbeans.api.progress.ProgressHandle)
.
Mustn't be null.public String getCertificate(InstallSupport.Installer validator, UpdateElement uElement)
UpdateElement
.validator
- Installer
an instance of Installer has been returned by {link @doValidate}uElement
- UpdateElement
doValidate(org.netbeans.api.autoupdate.InstallSupport.Validator, org.netbeans.api.progress.ProgressHandle)
public boolean isTrusted(InstallSupport.Installer validator, UpdateElement uElement)
UpdateElement
is trusted or not.validator
- Installer
an instance of Installer has been returned by {link @doValidate}uElement
- UpdateElement
UpdateElement
doValidate(org.netbeans.api.autoupdate.InstallSupport.Validator, org.netbeans.api.progress.ProgressHandle)
,
java.security.cert.Certificatepublic boolean isSigned(InstallSupport.Installer validator, UpdateElement uElement)
UpdateElement
is signed or not.validator
- Installer
an instance of Installer has been returned by {link @doValidate}uElement
- UpdateElement
UpdateElement
doValidate(org.netbeans.api.autoupdate.InstallSupport.Validator, org.netbeans.api.progress.ProgressHandle)
public boolean isSignedVerified(InstallSupport.Installer validator, UpdateElement uElement)
UpdateElement
is signed and verified or not.validator
- Installer
an instance of Installer has been returned by {link @doValidate}uElement
- UpdateElement
UpdateElement
doValidate(org.netbeans.api.autoupdate.InstallSupport.Validator, org.netbeans.api.progress.ProgressHandle)
public boolean isSignedUnverified(InstallSupport.Installer validator, UpdateElement uElement)
UpdateElement
is signed but not verified or not.validator
- Installer
an instance of Installer has been returned by {link @doValidate}uElement
- UpdateElement
UpdateElement
doValidate(org.netbeans.api.autoupdate.InstallSupport.Validator, org.netbeans.api.progress.ProgressHandle)
public boolean isContentModified(InstallSupport.Installer validator, UpdateElement uElement)
UpdateElement
is modified or not.validator
- Installer
an instance of Installer has been returned by {link @doValidate}uElement
- UpdateElement
UpdateElement
doValidate(org.netbeans.api.autoupdate.InstallSupport.Validator, org.netbeans.api.progress.ProgressHandle)
public OperationContainer<InstallSupport> getContainer()
OperationContainer
.OperationContainer
Built on May 31 2023. | Copyright © 2017-2023 Apache Software Foundation. All Rights Reserved.