org.netbeans.modules.autoupdate.services 1.3.1

org.netbeans.api.autoupdate
Class OperationContainer<Support>

java.lang.Object
  extended by org.netbeans.api.autoupdate.OperationContainer<Support>
Type Parameters:
Support - the type of support for performing chosen operation like OperationSupport or InstallSupport

public final class OperationContainer<Support>
extends Object

An object that keeps requests for operations upon instances of 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 additonal plugins are required and so on.

Typical scenario how to use:

Code example:
 
 UpdateElement 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);
 


Nested Class Summary
static class OperationContainer.OperationInfo<Support>
          Provides additional information
 
Method Summary
 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 (add(java.util.Collection))
 boolean contains(UpdateElement updateElement)
           
static OperationContainer<OperationSupport> createForCustomInstallComponent()
          The factory method to construct instance of OperationContainer for installation of custom compomnent
static OperationContainer<OperationSupport> createForCustomUninstallComponent()
          The factory method to construct instance of OperationContainer for uninstallation of custom compomnent
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<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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createForInstall

public static OperationContainer<InstallSupport> createForInstall()
The factory method to construct instance of OperationContainer for install operation

Returns:
newly constructed instance of OperationContainer for install operation

createForDirectInstall

public static OperationContainer<OperationSupport> createForDirectInstall()
The factory method to construct instance of OperationContainer for install operation

Returns:
newly constructed instance of OperationContainer for install operation

createForUpdate

public static OperationContainer<InstallSupport> createForUpdate()
The factory method to construct instance of OperationContainer for update operation

Returns:
newly constructed instance of OperationContainer for update operation

createForDirectUpdate

public static OperationContainer<OperationSupport> createForDirectUpdate()
The factory method to construct instance of OperationContainer for update operation

Returns:
newly constructed instance of OperationContainer for update operation

createForUninstall

public static OperationContainer<OperationSupport> createForUninstall()
The factory method to construct instance of OperationContainer for uninstall operation

Returns:
newly constructed instance of OperationContainer for uninstall operation

createForDirectUninstall

public static OperationContainer<OperationSupport> createForDirectUninstall()
The factory method to construct instance of OperationContainer for uninstall operation

Returns:
newly constructed instance of OperationContainer for uninstall operation

createForEnable

public static OperationContainer<OperationSupport> createForEnable()
The factory method to construct instance of OperationContainer for enable operation

Returns:
newly constructed instance of OperationContainer for enable operation

createForDisable

public static OperationContainer<OperationSupport> createForDisable()
The factory method to construct instance of OperationContainer for disable operation

Returns:
newly constructed instance of OperationContainer for disable operation

createForDirectDisable

public static OperationContainer<OperationSupport> createForDirectDisable()
The factory method to construct instance of OperationContainer for disable operation

Returns:
newly constructed instance of OperationContainer for disable operation

createForCustomInstallComponent

public static OperationContainer<OperationSupport> createForCustomInstallComponent()
The factory method to construct instance of OperationContainer for installation of custom compomnent

Returns:
newly constructed instance of OperationContainer for installation of custom compomnent

createForCustomUninstallComponent

public static OperationContainer<OperationSupport> createForCustomUninstallComponent()
The factory method to construct instance of OperationContainer for uninstallation of custom compomnent

Returns:
newly constructed instance of OperationContainer for uninstallation of custom compomnent

getSupport

public Support getSupport()
Returns:
either OperationSupport or InstallSupport depending on type parameter of OperationContainer<Support>

See the difference between createForInstall() and createForDirectInstall() for example


canBeAdded

public boolean canBeAdded(UpdateUnit updateUnit,
                          UpdateElement updateElement)
Check if updateElement can be added (add(java.util.Collection))

Parameters:
updateUnit -
updateElement - to be inserted.
Returns:
true if chosen operation upon updateElement is allowed

add

public void add(Collection<UpdateElement> elems)
Adds all elems

Parameters:
elems - to be inserted.

add

public void add(Map<UpdateUnit,UpdateElement> elems)
Adds all elems

Parameters:
elems - to be inserted.

add

public OperationContainer.OperationInfo<Support> add(UpdateUnit updateUnit,
                                                     UpdateElement updateElement)
Adds updateElement

Parameters:
updateUnit -
updateElement -
Returns:
instance of OperationContainer.OperationInfo<Support>

add

public OperationContainer.OperationInfo<Support> add(UpdateElement updateElement)
Adds updateElement

Parameters:
updateElement -
Returns:
instance of OperationContainer.OperationInfo<Support>

remove

public void remove(Collection<UpdateElement> elems)
Removes all elems

Parameters:
elems -

remove

public boolean remove(UpdateElement updateElement)
Removes updateElement

Parameters:
updateElement -
Returns:
true if succesfully added

contains

public boolean contains(UpdateElement updateElement)
Parameters:
updateElement -
Returns:
true if this instance of OperationContainer contains the specified updateElement.

listAll

public List<OperationContainer.OperationInfo<Support>> listAll()
Returns:
all instances of OperationContainer.OperationInfo<Support> from this instance of OperationContainer

listInvalid

public List<OperationContainer.OperationInfo<Support>> listInvalid()
Returns:
all invalid instances of OperationContainer.OperationInfo<Support> from this instance of OperationContainer

remove

public void remove(OperationContainer.OperationInfo<Support> op)
Removes op

Parameters:
op -

removeAll

public void removeAll()
Removes all content


org.netbeans.modules.autoupdate.services 1.3.1

Built on January 29 2008.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.