Support - the type of support for performing chosen operation like
OperationSupport or InstallSupportpublic final class OperationContainer<Support> extends Object
UpdateEelement
(like install, uninstall, update, enable, disable), provides checks whether
chosen operation is allowed (e.g. already installed plugin cannot be scheduled for install again),
provides information which additional plugins are
required and so on.
Typical scenario how to use:
OperationContainer
for chosen operation: OperationContainer.createForInstall(), OperationContainer.createForUninstall(),
OperationContainer.createForUpdate(), OperationContainer.createForEnable(),OperationContainer.createForDisable()UpdateElement (see OperationContainer.add(java.util.Collection<org.netbeans.api.autoupdate.UpdateElement>))UpdateElement are needed
(OperationContainer.OperationInfo.getRequiredElements()),
if so then these required instances should be also addedOperationContainer.OperationInfo.getBrokenDependencies()) OperationContainer.getSupport() to get either InstallSupport or OperationSupport
that can be used for performing operationUpdateElement element = ...; OperationContainer<OperationSupport> container = createForDirectInstall(); OperationInfo<Support> info = container.add(element); Set<UpdateElement> required = info.getRequiredElements(); container.add(required); OperationSupport support = container.getSupport(); support.doOperation(null);
| Modifier and Type | Class and Description |
|---|---|
static class |
OperationContainer.OperationInfo<Support>
Provides additional information
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Collection<UpdateElement> elems)
Adds all
elems |
void |
add(Map<UpdateUnit,UpdateElement> elems)
Adds all
elems |
OperationContainer.OperationInfo<Support> |
add(UpdateElement updateElement)
Adds
updateElement |
OperationContainer.OperationInfo<Support> |
add(UpdateUnit updateUnit,
UpdateElement updateElement)
Adds
updateElement |
boolean |
canBeAdded(UpdateUnit updateUnit,
UpdateElement updateElement)
Check if
updateElement can be added (OperationContainer.add(java.util.Collection<org.netbeans.api.autoupdate.UpdateElement>)) |
boolean |
contains(UpdateElement updateElement) |
static OperationContainer<OperationSupport> |
createForCustomInstallComponent()
The factory method to construct instance of
OperationContainer for installation of custom component |
static OperationContainer<OperationSupport> |
createForCustomUninstallComponent()
The factory method to construct instance of
OperationContainer for uninstallation of custom component |
static OperationContainer<OperationSupport> |
createForDirectDisable()
The factory method to construct instance of
OperationContainer for disable operation |
static OperationContainer<OperationSupport> |
createForDirectInstall()
The factory method to construct instance of
OperationContainer for install operation |
static OperationContainer<OperationSupport> |
createForDirectUninstall()
The factory method to construct instance of
OperationContainer for uninstall operation |
static OperationContainer<OperationSupport> |
createForDirectUpdate()
The factory method to construct instance of
OperationContainer for update operation |
static OperationContainer<OperationSupport> |
createForDisable()
The factory method to construct instance of
OperationContainer for disable operation |
static OperationContainer<OperationSupport> |
createForEnable()
The factory method to construct instance of
OperationContainer for enable operation |
static OperationContainer<InstallSupport> |
createForInstall()
The factory method to construct instance of
OperationContainer for install operation |
static OperationContainer<InstallSupport> |
createForInternalUpdate()
The factory method to construct instance of
OperationContainer for internal update operation |
static OperationContainer<OperationSupport> |
createForUninstall()
The factory method to construct instance of
OperationContainer for uninstall operation |
static OperationContainer<InstallSupport> |
createForUpdate()
The factory method to construct instance of
OperationContainer for update operation |
Support |
getSupport() |
List<OperationContainer.OperationInfo<Support>> |
listAll() |
List<OperationContainer.OperationInfo<Support>> |
listInvalid() |
void |
remove(Collection<UpdateElement> elems)
Removes all
elems |
void |
remove(OperationContainer.OperationInfo<Support> op)
Removes
op |
boolean |
remove(UpdateElement updateElement)
Removes
updateElement |
void |
removeAll()
Removes all content
|
void |
setUnpack200(File executable)
Specifies location of unpack200 executable.
|
String |
toString() |
public static OperationContainer<InstallSupport> createForInstall()
OperationContainer for install operationOperationContainer for install operationpublic static OperationContainer<InstallSupport> createForInternalUpdate()
OperationContainer for internal update operationOperationContainer for internal update operationpublic static OperationContainer<OperationSupport> createForDirectInstall()
OperationContainer for install operationOperationContainer for install operationpublic static OperationContainer<InstallSupport> createForUpdate()
OperationContainer for update operationOperationContainer for update operationpublic static OperationContainer<OperationSupport> createForDirectUpdate()
OperationContainer for update operationOperationContainer for update operationpublic static OperationContainer<OperationSupport> createForUninstall()
OperationContainer for uninstall operationOperationContainer for uninstall operationpublic static OperationContainer<OperationSupport> createForDirectUninstall()
OperationContainer for uninstall operationOperationContainer for uninstall operationpublic static OperationContainer<OperationSupport> createForEnable()
OperationContainer for enable operationOperationContainer for enable operationpublic static OperationContainer<OperationSupport> createForDisable()
OperationContainer for disable operationOperationContainer for disable operationpublic static OperationContainer<OperationSupport> createForDirectDisable()
OperationContainer for disable operationOperationContainer for disable operationpublic static OperationContainer<OperationSupport> createForCustomInstallComponent()
OperationContainer for installation of custom componentOperationContainer for installation of custom componentpublic static OperationContainer<OperationSupport> createForCustomUninstallComponent()
OperationContainer for uninstallation of custom componentOperationContainer for uninstallation of custom componentpublic Support getSupport()
OperationSupport or InstallSupport depending on type parameter of OperationContainer<Support> or
null if the OperationContainer is empty or contains any invalid elementsOperationContainer.listAll(),
See the difference between {@link #createForInstall} and {@link #createForDirectInstall} for example
public boolean canBeAdded(UpdateUnit updateUnit, UpdateElement updateElement)
updateElement can be added (OperationContainer.add(java.util.Collection<org.netbeans.api.autoupdate.UpdateElement>))updateUnit - updateElement - to be inserted.updateElement is allowedpublic void add(Collection<UpdateElement> elems)
elemselems - to be inserted.public void add(Map<UpdateUnit,UpdateElement> elems)
elemselems - to be inserted.public OperationContainer.OperationInfo<Support> add(UpdateUnit updateUnit, UpdateElement updateElement)
updateElementupdateUnit - updateElement - OperationContainer.OperationInfo<Support> or
null if the UpdateElement is already present in the containerpublic OperationContainer.OperationInfo<Support> add(UpdateElement updateElement)
updateElementupdateElement - OperationContainer.OperationInfo<Support> or
null if the UpdateElement is already present in the containerpublic void remove(Collection<UpdateElement> elems)
elemselems - public boolean remove(UpdateElement updateElement)
updateElementupdateElement - public boolean contains(UpdateElement updateElement)
updateElement - OperationContainer
contains the specified updateElement.public List<OperationContainer.OperationInfo<Support>> listAll()
OperationContainer.OperationInfo<Support> from this
instance of OperationContainerpublic List<OperationContainer.OperationInfo<Support>> listInvalid()
OperationContainer.OperationInfo<Support> from this
instance of OperationContainerpublic void remove(OperationContainer.OperationInfo<Support> op)
opop - public void removeAll()
public final void setUnpack200(File executable)
unpack200 has been
removed from JDK 14. As such it is not possible to unpack older NBM
files without providing alternative JDK implementation of this file.executable - path to the executable