org.fusesource.fabric.commands.support
Class ContainerUpgradeSupport

java.lang.Object
  extended by org.apache.karaf.shell.console.AbstractAction
      extended by org.apache.karaf.shell.console.OsgiCommandSupport
          extended by org.fusesource.fabric.boot.commands.support.FabricCommand
              extended by org.fusesource.fabric.commands.support.ContainerUpgradeSupport
All Implemented Interfaces:
org.apache.felix.gogo.commands.Action, org.apache.karaf.shell.console.BundleContextAware
Direct Known Subclasses:
ContainerRollback, ContainerUpgrade

public abstract class ContainerUpgradeSupport
extends FabricCommand


Field Summary
 
Fields inherited from class org.fusesource.fabric.boot.commands.support.FabricCommand
AGENT_PID, configurationAdmin, fabricService
 
Fields inherited from class org.apache.karaf.shell.console.OsgiCommandSupport
bundleContext, usedReferences
 
Fields inherited from class org.apache.karaf.shell.console.AbstractAction
log, session
 
Constructor Summary
ContainerUpgradeSupport()
           
 
Method Summary
protected  int canRollback(Version version, Container container)
          Compare the version with the container
protected  int canUpgrade(Version version, Container container)
          Compare the version with the container
protected  Profile[] getProfilesForUpgradeOrRollback(Profile[] existingProfiles, Version targetVersion)
          Gets the profiles for upgrade/rollback
 
Methods inherited from class org.fusesource.fabric.boot.commands.support.FabricCommand
checkFabricAvailable, doesContainerExist, getConfigurationAdmin, getContainer, getFabricService, getProfile, getProfiles, getProfiles, getZooKeeper, percentText, setConfigurationAdmin, setFabricService, setZooKeeper, toString
 
Methods inherited from class org.apache.karaf.shell.console.OsgiCommandSupport
execute, getAllServices, getBundleContext, getService, setBundleContext, ungetServices
 
Methods inherited from class org.apache.karaf.shell.console.AbstractAction
doExecute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainerUpgradeSupport

public ContainerUpgradeSupport()
Method Detail

getProfilesForUpgradeOrRollback

protected Profile[] getProfilesForUpgradeOrRollback(Profile[] existingProfiles,
                                                    Version targetVersion)
Gets the profiles for upgrade/rollback

Parameters:
existingProfiles - the existing profiles
targetVersion - the target version
Returns:
the new profiles to be used

canUpgrade

protected int canUpgrade(Version version,
                         Container container)
Compare the version with the container

Parameters:
version - the version to rollback to
container - the container
Returns:
-1 if cannot rollback, 0 if same version, or 1 if can rollback

canRollback

protected int canRollback(Version version,
                          Container container)
Compare the version with the container

Parameters:
version - the version to rollback to
container - the container
Returns:
-1 if cannot rollback, 0 if same version, or 1 if can rollback


Copyright © 2012 FuseSource. All Rights Reserved.