Package org.apache.karaf.config.core
Interface ConfigMBean
-
- All Known Implementing Classes:
ConfigMBeanImpl
public interface ConfigMBeanMBean to manipulate the Config layer.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidappend(String pid, Map<String,String> properties)Add new properties or update existing ones (without removing others) in a given configuration.voidappendProperty(String pid, String key, String value)Append (or add) a value for the given configuration key.voidcreate(String pid)Create a new configuration for the given PID.StringcreateFactoryConfiguration(String factoryPid)StringcreateFactoryConfiguration(String factoryPid, String alias)StringcreateFactoryConfiguration(String factoryPid, String alias, Map<String,String> properties)StringcreateFactoryConfiguration(String factoryPid, Map<String,String> properties)Create a factory based configuration.voiddelete(String pid)Delete a configuration identified by the given PID.voiddelete(String pid, List<String> properties)Delete properties from a configuration.voiddeleteProperty(String pid, String key)Remove the configuration property identified by the given key.booleanexists(String pid)Check if a configuration identified by the given PID exists.List<String>getConfigs()Get the list of all configuration PIDs.StringgetProperty(String pid, String key)Get a configuration property.voidinstall(String url, String finalname, boolean override)Install a cfg file.Map<String,String>listProperties(String pid)Get the list of properties for a configuration PID.voidsetProperty(String pid, String key, String value)Set a configuration property.voidupdate(String pid, Map<String,String> properties)Update a complete configuration.
-
-
-
Method Detail
-
getConfigs
List<String> getConfigs() throws MBeanException
Get the list of all configuration PIDs.- Returns:
- the list of all configuration PIDs.
- Throws:
MBeanException- in case of MBean failure.
-
create
void create(String pid) throws MBeanException
Create a new configuration for the given PID.- Parameters:
pid- the configuration PID.- Throws:
MBeanException- in case of MBean failure.
-
install
void install(String url, String finalname, boolean override) throws MBeanException
Install a cfg file.- Parameters:
url- The location of the cfg file.finalname- The final name of the cfg file in the etc folder.override- True to override the cfg file if it already exists, false else.- Throws:
MBeanException- in case of MBean failure.
-
delete
void delete(String pid) throws MBeanException
Delete a configuration identified by the given PID.- Parameters:
pid- the configuration PID to delete.- Throws:
MBeanException- in case of MBean failure.
-
exists
boolean exists(String pid) throws MBeanException
Check if a configuration identified by the given PID exists.- Parameters:
pid- The configuration PID to check.- Returns:
- true if the configuration exists, false else.
- Throws:
MBeanException- in case of MBean failure.
-
listProperties
Map<String,String> listProperties(String pid) throws MBeanException
Get the list of properties for a configuration PID.- Parameters:
pid- the configuration PID.- Returns:
- the list of properties.
- Throws:
MBeanException- in case of MBean failure.
-
deleteProperty
void deleteProperty(String pid, String key) throws MBeanException
Remove the configuration property identified by the given key.- Parameters:
pid- the configuration PID.key- the property key.- Throws:
MBeanException- in case of MBean failure.
-
appendProperty
void appendProperty(String pid, String key, String value) throws MBeanException
Append (or add) a value for the given configuration key.- Parameters:
pid- the configuration PID.key- the property key.value- the value to append to the current property value.- Throws:
MBeanException- in case of MBean failure.
-
setProperty
void setProperty(String pid, String key, String value) throws MBeanException
Set a configuration property.- Parameters:
pid- the configuration PID.key- the property key.value- the property value.- Throws:
MBeanException- in case of MBean failure.
-
getProperty
String getProperty(String pid, String key) throws MBeanException
Get a configuration property.- Parameters:
pid- the configuration PID.key- the property key.- Throws:
MBeanException- in case of MBean failure.
-
update
void update(String pid, Map<String,String> properties) throws MBeanException
Update a complete configuration.- Parameters:
pid- the configuration PID.properties- the new properties to set in the configuration.- Throws:
MBeanException- in case of MBean failure.
-
append
void append(String pid, Map<String,String> properties) throws MBeanException
Add new properties or update existing ones (without removing others) in a given configuration.- Parameters:
pid- the configuration PID.properties- the properties to add/update.- Throws:
MBeanException- in case of MBean failure.
-
delete
void delete(String pid, List<String> properties) throws MBeanException
Delete properties from a configuration.- Parameters:
pid- the configuration PID.properties- the properties to delete from the configuration.- Throws:
MBeanException- in case of MBean failure.
-
createFactoryConfiguration
String createFactoryConfiguration(String factoryPid) throws MBeanException
- Throws:
MBeanException
-
createFactoryConfiguration
String createFactoryConfiguration(String factoryPid, String alias) throws MBeanException
- Throws:
MBeanException
-
createFactoryConfiguration
String createFactoryConfiguration(String factoryPid, String alias, Map<String,String> properties) throws MBeanException
- Throws:
MBeanException
-
createFactoryConfiguration
String createFactoryConfiguration(String factoryPid, Map<String,String> properties) throws MBeanException
Create a factory based configuration.- Parameters:
factoryPid- the configuration factory PID.properties- the new properties to set in the configuration.- Returns:
- the created PID.
- Throws:
MBeanException- in case of MBean failure.
-
-