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 UpdateElements. See OperationContainerInstallSupport.doDownload(org.netbeans.api.progress.ProgressHandle, boolean) for downloading install data.InstallSupport.doValidate(org.netbeans.api.autoupdate.InstallSupport.Validator, org.netbeans.api.progress.ProgressHandle) for verify consistency of downloaded data.InstallSupport.doInstall(org.netbeans.api.autoupdate.InstallSupport.Installer, org.netbeans.api.progress.ProgressHandle) for install contained UpdateElement.InstallSupport.doRestart(org.netbeans.api.autoupdate.OperationSupport.Restarter, org.netbeans.api.progress.ProgressHandle) or InstallSupport.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
|
static class |
InstallSupport.Validator
A helper object returned by a
InstallSupport.doDownload(org.netbeans.api.progress.ProgressHandle, boolean) for invoke
the method InstallSupport.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.
|
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. |
@Deprecated public InstallSupport.Validator doDownload(ProgressHandle progress, boolean isGlobal) throws OperationException
InstallSupport.doDownload(ProgressHandle, Boolean, boolean) instead.UpdateElements in corresponding OperationContainer.progress - ProgressHandle for notification progress in downloading, can be nullisGlobal - 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 stepOperationExceptionpublic InstallSupport.Validator doDownload(ProgressHandle progress, Boolean isGlobal, boolean useUserdirAsFallback) throws OperationException
UpdateElements in corresponding OperationContainer.progress - ProgressHandle for notification progress in downloading, can be nullisGlobal - 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 stepOperationExceptionpublic 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 nullInstaller an instance of Installer which allows to install all verified instancesOperationExceptionInstallSupport.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 nullRestarter an instance of Restart if application restart is required for complete the install operation, or nullOperationExceptionInstallSupport.doValidate(org.netbeans.api.autoupdate.InstallSupport.Validator, org.netbeans.api.progress.ProgressHandle)public void doCancel()
throws OperationException
OperationExceptionOperationExceptionpublic void doRestart(OperationSupport.Restarter restarter, ProgressHandle progress) throws OperationException
InstallSupport.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 InstallSupport.doInstall(org.netbeans.api.autoupdate.InstallSupport.Installer, org.netbeans.api.progress.ProgressHandle). Mustn't be null.progress - instance of ProgressHandle or nullOperationExceptionOperationExceptionpublic void doRestartLater(OperationSupport.Restarter restarter)
InstallSupport.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 InstallSupport.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 - UpdateElementInstallSupport.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 - UpdateElementUpdateElementInstallSupport.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 - UpdateElementUpdateElementInstallSupport.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 - UpdateElementUpdateElementInstallSupport.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 - UpdateElementUpdateElementInstallSupport.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 - UpdateElementUpdateElementInstallSupport.doValidate(org.netbeans.api.autoupdate.InstallSupport.Validator, org.netbeans.api.progress.ProgressHandle)public OperationContainer<InstallSupport> getContainer()
OperationContainer.OperationContainer