See: Description
Package | Description |
---|---|
org.netbeans.api.autoupdate |
Services for searching, downloading and installing NBM with new functionality or updates of installed modules.
|
org.netbeans.spi.autoupdate |
The provider this SPI can be plugged into Autoupdate's Updates Providers and can
supply NBM to Autoupdate Services.
|
AutoUpdate feature provides several services to IDE: download and install available updates of installed modules, search and install new features from subscribed Update Centers, browsing and manipulating the modules in IDE installation and handling of module localizations. To use the services have to AutoUpdate supply a GUI to easy manipulating. AutoUpdate feature has to care about registration Update Centers as well.
Several several services means that Autoupdate feature contain several parts of functionality.
These part of AutoUpdate should communicate each other. Moreover, some interface should be public.
One of them is SPI for Update Center backend - allows to create and subscribe the Update Center in IDE.
Next there should be a API which communicate to rest of IDE and provide some services what is useful for
NB installers, a non-visual client of Auto Update which make possible to use Auto Update from command line
as standalone application in "admin" mode. All of them needs a APIs. This document describes proposed APIs,
supposed use-cases and design of interaction Auto Update parts each other.
A distributed feature may list a module, which is only available on some update center, in NB IDE case because of licensing issues. This token must be reported so the as part of the UpdateElement and Operation so the caller may initiate the download operation.
Added a method UpdateUnit.getVisibleAncestor()
which returns a visible plugin
which depending upon this unit. Returns a unit if this unit is installed in the system and some of visible
units depending upon this one, otherwise returns null.
Added a preferredupdate
attribute into Update Center Descriptor
to specify if an update has to be installed before other updates or not. This flag is off as default.
UpdateUnitProvider.getContentDescription()
returns
a description of content staging by this provider. The description might contains HTML tags e.g. HTML Links.
Added a method UpdateElement.getLicenseId()
to get ID of license agreement if the UpdateElement
has a copyright.
This ID could be stored somewhere once an user approves the license and will not be asked for approval again the same license ID.
InstallSupport
find out the right directory where a plugin
should be installed. After that it checks if an user has privilege to write there.
In the case a lack of write permission, throws
org.netbeans.api.autoupdate.OperationException.WRITE_PERMISSION
.
Beside this it allows to write into
userdir
as a fallback in the case of insufficient privilege.
UpdateUnit
which describes all instances of unit, e.g. installation in IDE,
all its available updates, optionlly its backup instance.
UpdateUnit
can represent either a feature (e.g. group
of modules), a single module or a localization.
Proposed usage of API: Call List<UpdateUnit> UpdateManager.getDefault().getUpdateUnits()
List<UpdateUnit> UpdateManager.getDefault().getUpdateUnits(UpdateStyle style)
List<UpdateUnit> UpdateManager.getDefault().getUpdateUnits(UpdateStyle style)
and filter units which haven't been installed yet.
UpdateUnit
s
which are applicable to active IDE. UpdateManager
will
search all available UpdateUnit
given attribute.
UpdateUnit
by module's code name and finds UpdateElement
what fits the required version.UpdateElement
which wants to install.OperationContainer
for install, e.g. OperationContainer.createForInstall
OperationContainer.add(UpdateElement)
and gets OperationInfo
for that operation.OperationInfo.getRequiredElements()
OperationInfo.getBrokenDependency()
Note: if there are some broken dependencies then operation cannot continue.OperationContainer.doOperation()
UpdateElement
which wants to uninstall.OperationContainer
for uninstall, e.g. OperationContainer.createForUninstall
OperationContainer.add(UpdateElement)
and gets OperationInfo
for that operation.OperationInfo.getRequiredElements()
OperationContainer.doOperation()
UpdateElement
which wants to uninstall.OperationContainer
for disable, e.g. OperationContainer.createForDisable
OperationContainer.add(UpdateElement)
and gets OperationInfo
for that operation.OperationInfo.getRequiredElements()
OperationContainer.doOperation()
UpdateElement
which wants to uninstall.OperationContainer
for enable, e.g. OperationContainer.createForEnable
OperationContainer.add(UpdateElement)
and gets OperationInfo
for that operation.OperationInfo.getRequiredElements()
OperationContainer.doOperation()
OperationContainer
and OperationInfo
identifies some problems,
i.e. broken dependencies, needs to install more units, the operation causes disable some
other modules and so on. The client can use this information to consult these with end-user.
UpdateUnitProvider
.
Proposed usage of API: Call UpdateUnitProviderFactory.getUpdateUnitProviders()
UpdateUnitProviderFactory.create()
which creates and registered
new one subscription in the system and will be used from that time in the future.
UpdateUnitProviderFactory.setEnable(UpdateUnitProvider, boolean)
.
UpdateUnitProviderFactory.remove(Id)
.
UpdateUnitProvider.refresh()
.
|
|
|
|
|
|
The sources for the module are in the NetBeans Mercurial repositories.
Read more about the implementation in the answers to architecture questions.