org.apache.karaf.shell.config
Class ConfigPropertyCommandSupport

java.lang.Object
  extended by org.apache.karaf.shell.console.AbstractAction
      extended by org.apache.karaf.shell.console.OsgiCommandSupport
          extended by org.apache.karaf.shell.config.ConfigCommandSupport
              extended by org.apache.karaf.shell.config.ConfigPropertyCommandSupport
All Implemented Interfaces:
org.apache.felix.gogo.commands.Action, org.apache.karaf.shell.console.BundleContextAware
Direct Known Subclasses:
PropAppendCommand, PropDelCommand, PropListCommand, PropSetCommand

public abstract class ConfigPropertyCommandSupport
extends ConfigCommandSupport

Abstract class which commands that are related to property processing should extend.


Field Summary
protected  boolean bypassStorage
           
protected  String pid
           
 
Fields inherited from class org.apache.karaf.shell.config.ConfigCommandSupport
PROPERTY_CONFIG_PID, PROPERTY_CONFIG_PROPS, storage
 
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
ConfigPropertyCommandSupport()
           
 
Method Summary
protected  void doExecute(org.osgi.service.cm.ConfigurationAdmin admin)
           
protected  Dictionary getEditedProps()
          Retrieves confguration from the pid, if used or delegates to session from getting the configuration.
protected abstract  void propertyAction(Dictionary props)
          Perform an action on the properties.
protected  boolean requiresUpdate(String pid)
          Checks if the configuration requires to be updated.
 
Methods inherited from class org.apache.karaf.shell.config.ConfigCommandSupport
deleteStorage, doExecute, findConfigurationByFileName, getConfigurationAdmin, getStorage, parsePid, persistConfiguration, setArtifactInstallers, setStorage, update, updateConfiguration
 
Methods inherited from class org.apache.karaf.shell.console.OsgiCommandSupport
execute, getAllServices, getBundleContext, getService, setBundleContext, ungetServices
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pid

protected String pid

bypassStorage

protected boolean bypassStorage
Constructor Detail

ConfigPropertyCommandSupport

public ConfigPropertyCommandSupport()
Method Detail

doExecute

protected void doExecute(org.osgi.service.cm.ConfigurationAdmin admin)
                  throws Exception
Specified by:
doExecute in class ConfigCommandSupport
Throws:
Exception

propertyAction

protected abstract void propertyAction(Dictionary props)
Perform an action on the properties.

Parameters:
props -

requiresUpdate

protected boolean requiresUpdate(String pid)
Checks if the configuration requires to be updated. The default behavior is to update if a valid pid has been passed to the method.

Parameters:
pid -
Returns:

getEditedProps

protected Dictionary getEditedProps()
                             throws Exception
Retrieves confguration from the pid, if used or delegates to session from getting the configuration.

Overrides:
getEditedProps in class ConfigCommandSupport
Returns:
Throws:
Exception


Copyright © 2007-2012 FuseSource, Corp.. All Rights Reserved.