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 OperationContainerdoDownload(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)
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 |
isSigned(InstallSupport.Installer validator,
UpdateElement uElement)
Returns if the
UpdateElement is signed 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
UpdateElements in corresponing 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.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 instancesOperationExceptiondoDownload(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 nullOperationExceptiondoValidate(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
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 nullOperationExceptionOperationExceptionpublic 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 - UpdateElementdoValidate(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 - UpdateElementUpdateElementdoValidate(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 - UpdateElementUpdateElementdoValidate(org.netbeans.api.autoupdate.InstallSupport.Validator, org.netbeans.api.progress.ProgressHandle)public OperationContainer<InstallSupport> getContainer()
OperationContainer.OperationContainerBuilt on August 24 2014. | Portions Copyright 1997-2014 Sun Microsystems, Inc. All rights reserved.