Skip navigation links
org.netbeans.modules.autoupdate.services 1.52

Auto Update Services
Official

See: Description

Auto Update Services 
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.
schema.png

Naming: What is feature? Group of modules which are close connected together and cannot acts separately. I think that feature is common understand notation and fits its matter we will use it from now on.

What is New (see all changes)?

Use Cases

Browse all available units
Give overview of IDE installation to users, it involve overview of installed modules (grouped together as feature), overview of available updates, overview of available new features. The API can return list of 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()
Browse all units by chosen style (e.g. modules, features, localization)
Sometimes there can be a need to get overview of units by chosen style, e.g. feature, module or localization.

Proposed usage of API: Call List<UpdateUnit> UpdateManager.getDefault().getUpdateUnits(UpdateStyle style)
Browse installed modules
When an API client needs to get overview of installed modules.

Proposed usage of API: Call List<UpdateUnit> UpdateManager.getDefault().getUpdateUnits(UpdateStyle style) and filter units which haven't been installed yet.
Search for new functionality
Someone is searching for some functionality which can be installed into IDE. It needs a set of available UpdateUnits which are applicable to active IDE. UpdateManager will search all available UpdateUnit given attribute.
Install new functionality
An client needs to install new functionality into the IDE installation. She knows what unit and what version wants to install. Needs to identify if the functionality is ready to install, resolve its dependencies, identify possible problems and locate other unit what have to be installed together with asked functionality.

Proposed usage of API:
  • Client needs install NetBeans module in required minimal specification version.
  • Find corresnponing UpdateUnit by module's code name and finds UpdateElement what fits the required version.
  • So, the client now have UpdateElement which wants to install.
  • Take the OperationContainer for install, e.g. OperationContainer.createForInstall
  • Adds the element into container OperationContainer.add(UpdateElement) and gets OperationInfo for that operation.
  • Identify other required elements: OperationInfo.getRequiredElements()
  • Check if there is no broken dependencies: OperationInfo.getBrokenDependency() Note: if there are some broken dependencies then operation cannot continue.
  • If all okay, then install the unit: OperationContainer.doOperation()
Update of installed unit
A client needs to update some unit of functionality which is already installed. She knows what unit and what update element (by version) wants to install. Needs to identify possible problems with update install, resolve its dependencies, identify possible problems and locate other unit what have to be installed together with asked functionality.

Proposed usage of API: See above Install new functionality
Uninstall functionality
An client needs to uninstall some functionality from IDE installation. She knows what unit wants to uninstall. Needs to identify if the functionality is ready to uninstall, resolve its dependencies, identify possible problems and locate other unit what will be disabled together.

Proposed usage of API:
  • Client knows UpdateElement which wants to uninstall.
  • Take the OperationContainer for uninstall, e.g. OperationContainer.createForUninstall
  • Adds the element into container OperationContainer.add(UpdateElement) and gets OperationInfo for that operation.
  • Identify other required elements: OperationInfo.getRequiredElements()
  • If all okay, then uninstall the unit: OperationContainer.doOperation()
Switch off functionality
An client needs to switch off (disable) some functionality in IDE installation. Needs to resolve its dependencies, identify possible problems and locate other unit what will be disabled together.

Proposed usage of API:
  • Client knows UpdateElement which wants to uninstall.
  • Take the OperationContainer for disable, e.g. OperationContainer.createForDisable
  • Adds the element into container OperationContainer.add(UpdateElement) and gets OperationInfo for that operation.
  • Identify other required elements: OperationInfo.getRequiredElements()
  • If all okay, then disable the unit: OperationContainer.doOperation()
Switch on functionality
Like Switch off functionality An client needs to switch on (enable) some functionality in IDE installation.
Rollback of previous update
Sometimes an client needs to rollback of installed update of unit to previous version. Needs to resolve its dependencies, identify possible problems and locate other unit what are affected by rollback.

Proposed usage of API: Like above Switch off functionality
  • Client knows UpdateElement which wants to uninstall.
  • Take the OperationContainer for enable, e.g. OperationContainer.createForEnable
  • Adds the element into container OperationContainer.add(UpdateElement) and gets OperationInfo for that operation.
  • Identify other required elements: OperationInfo.getRequiredElements()
  • If all okay, then enable the unit: OperationContainer.doOperation()
Resolve problems what accrued while processing operation
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.
Make IDE up-to-date
Sometimes need to make whole IDE installation up-to-date. Find all available updates of installed units and install the latest available version. It is covered by previous use-cases.
Get all subscriptions to Update Center
Show me all registered subscriptions to Update Center, e.g. get me list of UpdateUnitProvider. Proposed usage of API: Call UpdateUnitProviderFactory.getUpdateUnitProviders()
Subscribe new Update Center
If there is a new Update Center which is not already subscribed into IDE user wants to subscribe new one Update Center which will be connected from that time in periodically checks. There should be a factory where subscribe new one Update Center, known types of Update Center have own factory method. Proposed usage of API: Simply call UpdateUnitProviderFactory.create() which creates and registered new one subscription in the system and will be used from that time in the future.
Customization of Update Center subscription
An user wants to enable or disable of Update Center subscription. Proposed usage of API: Simply call UpdateUnitProviderFactory.setEnable(UpdateUnitProvider, boolean).
Unsubscribe of some Update Center
Simple unsubscribe a chosen Update Center from the system. Need to know of chosen Update Provider Id. This Update Center won't be checked anymore. Proposed usage of API: Simply call UpdateUnitProviderFactory.remove(Id).
Refresh content of subscribed Update Center
The content of Update Provider is cached and the system works across there caches. There is a cache per each Update Center subscription. The caches are refreshed periodically by the system. But, sometime an user wants to call refresh manually. Proposed usage of API: Simply call UpdateUnitProvider.refresh().
Specify the cluster where to install
TBD
Get all installed files of given unit
TBD

Exported Interfaces

This table lists all of the module exported APIs with defined stability classifications. It is generated based on answers to questions about the architecture of the module. Read them all...
Group of java interfaces
Interface NameIn/OutStabilitySpecified in What Document?
org.netbeans.api.autoupdateExportedOfficialoverview-summary.html

org.netbeans.spi.autoupdateExportedOfficialoverview-summary.html

Group of dtd interfaces
Interface NameIn/OutStabilitySpecified in What Document?
catalog-dtdExportedStable .../doc-files/autoupdate-catalog-2_4.dtd

info-dtdExportedStable .../doc-files/autoupdate-info-2_4.dtd

Group of preferences interfaces
Interface NameIn/OutStabilitySpecified in What Document?
unique-idExportedStable
enable-update-providerExportedPrivate
last-check-of-providerExportedPrivate

Group of property interfaces
Interface NameIn/OutStabilitySpecified in What Document?
InitialTabExportedFriend

The associated module autoupdate.ui provides possibility to open plugin manager dialog (PluginManagerUI) with the specified tab. That is controlled by setting this string property to one of the following values:

  • update
  • available
  • local
  • installed

If property is not set (as default) then default tab is choosen due to the UI spec.

Proposed usage of API:
final FileObject fo = FileUtil.getConfigFile("Actions/System/org-netbeans-modules-autoupdate-ui-actions-PluginManagerAction.instance");
CallableSystemAction action = (CallableSystemAction) DataObject.find(fo).getCookie(InstanceCookie.class).instanceCreate();
action.putValue("InitialTab", "installed");
action.performAction();
            

Show-In-AutoUpdate-ClientExportedStable

Each module can control whether it shall be visible in a UI that presents updates, installed modules, etc. This can be done by defining OpenIDE-Module-Show-In-AutoUpdate-Client: false (or true) in its own
manifest. This attribute shall take precedence over any default deduced by the UI (e.g. don't show autoload modules for example).

Group of systemproperty interfaces
Interface NameIn/OutStabilitySpecified in What Document?
plugin.manager.detail.view.selectedExportedPrivate

Setting this property affects the associated module autoupdate.ui. Setting it to true results in the detailed view (all visible plugins) been selected when Installed tab is opened in Plugin Manager. Otherwise the simple view (high-level features) is selected.

Group of java.io.File interfaces
Interface NameIn/OutStabilitySpecified in What Document?

Implementation Details

Where are the sources for the module?

The sources for the module are in the NetBeans Mercurial repositories.

What do other modules need to do to declare a dependency on this one, in addition to or instead of a plain module dependency?

Read more about the implementation in the answers to architecture questions.

Skip navigation links
org.netbeans.modules.autoupdate.services 1.52

Built on April 30 2016.  |  Portions Copyright 1997-2016 Oracle. All rights reserved.