org.apache.karaf.shell.config
Class ConfigCommandSupport
java.lang.Object
org.apache.karaf.shell.console.AbstractAction
org.apache.karaf.shell.console.OsgiCommandSupport
org.apache.karaf.shell.config.ConfigCommandSupport
- All Implemented Interfaces:
- org.apache.felix.gogo.commands.Action, org.apache.karaf.shell.console.BundleContextAware
- Direct Known Subclasses:
- CancelCommand, ConfigPropertyCommandSupport, DeleteCommand, EditCommand, ListCommand, UpdateCommand
public abstract class ConfigCommandSupport
- extends org.apache.karaf.shell.console.OsgiCommandSupport
Abstract class from which all commands related to the ConfigurationAdmin
service should derive.
This command retrieves a reference to the ConfigurationAdmin service before
calling another method to actually process the command.
| Fields inherited from class org.apache.karaf.shell.console.OsgiCommandSupport |
bundleContext, usedReferences |
| Fields inherited from class org.apache.karaf.shell.console.AbstractAction |
log, session |
| 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 |
PROPERTY_CONFIG_PID
public static final String PROPERTY_CONFIG_PID
- See Also:
- Constant Field Values
PROPERTY_CONFIG_PROPS
public static final String PROPERTY_CONFIG_PROPS
- See Also:
- Constant Field Values
storage
protected File storage
ConfigCommandSupport
public ConfigCommandSupport()
doExecute
protected Object doExecute()
throws Exception
- Specified by:
doExecute in class org.apache.karaf.shell.console.AbstractAction
- Throws:
Exception
getEditedProps
protected Dictionary getEditedProps()
throws Exception
- Throws:
Exception
getConfigurationAdmin
protected org.osgi.service.cm.ConfigurationAdmin getConfigurationAdmin()
doExecute
protected abstract void doExecute(org.osgi.service.cm.ConfigurationAdmin admin)
throws Exception
- Throws:
Exception
findConfigurationByFileName
public org.osgi.service.cm.Configuration findConfigurationByFileName(org.osgi.service.cm.ConfigurationAdmin admin,
String fileName)
throws IOException,
org.osgi.framework.InvalidSyntaxException
Returns the Configuration object of the given (felix fileinstall) file name.
- Parameters:
fileName -
- Returns:
-
- Throws:
IOException
org.osgi.framework.InvalidSyntaxException
update
protected void update(org.osgi.service.cm.ConfigurationAdmin admin,
String pid,
Dictionary props,
boolean bypassStorage)
throws IOException
- Saves config to storage or ConfigurationAdmin.
- Parameters:
admin - pid - props - bypassStorage -
- Throws:
IOException
persistConfiguration
protected void persistConfiguration(org.osgi.service.cm.ConfigurationAdmin admin,
String pid,
Dictionary props)
throws IOException
- Persists configuration to storage.
- Parameters:
admin - pid - props -
- Throws:
IOException
updateConfiguration
public void updateConfiguration(org.osgi.service.cm.ConfigurationAdmin admin,
String pid,
Dictionary props)
throws IOException
- Updates the configuration to the
ConfigurationAdmin service.
- Parameters:
admin - pid - props -
- Throws:
IOException
parsePid
protected String[] parsePid(String pid)
deleteStorage
protected void deleteStorage(String pid)
throws Exception
- Throws:
Exception
getStorage
public File getStorage()
setStorage
public void setStorage(File storage)
setArtifactInstallers
public void setArtifactInstallers(List<org.apache.felix.fileinstall.ArtifactInstaller> artifactInstallers)
Copyright © 2007-2012 FuseSource, Corp.. All Rights Reserved.