You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2012/09/17 19:37:37 UTC
svn commit: r1386739 - in
/karaf/branches/karaf-2.3.x/management/mbeans/config/src/main/java/org/apache/karaf/management/mbeans/config:
ConfigMBean.java internal/ConfigMBeanImpl.java
Author: jbonofre
Date: Mon Sep 17 17:37:37 2012
New Revision: 1386739
URL: http://svn.apache.org/viewvc?rev=1386739&view=rev
Log:
[KARAF-1826] ConfigMBean now uses configs attribute and rename operations for migration purpose
Modified:
karaf/branches/karaf-2.3.x/management/mbeans/config/src/main/java/org/apache/karaf/management/mbeans/config/ConfigMBean.java
karaf/branches/karaf-2.3.x/management/mbeans/config/src/main/java/org/apache/karaf/management/mbeans/config/internal/ConfigMBeanImpl.java
Modified: karaf/branches/karaf-2.3.x/management/mbeans/config/src/main/java/org/apache/karaf/management/mbeans/config/ConfigMBean.java
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.3.x/management/mbeans/config/src/main/java/org/apache/karaf/management/mbeans/config/ConfigMBean.java?rev=1386739&r1=1386738&r2=1386739&view=diff
==============================================================================
--- karaf/branches/karaf-2.3.x/management/mbeans/config/src/main/java/org/apache/karaf/management/mbeans/config/ConfigMBean.java (original)
+++ karaf/branches/karaf-2.3.x/management/mbeans/config/src/main/java/org/apache/karaf/management/mbeans/config/ConfigMBean.java Mon Sep 17 17:37:37 2012
@@ -25,9 +25,14 @@ public interface ConfigMBean {
/**
* Get the list of all configuration PIDs.
*
- * @return the list of all configuration PIDs.
+ * @return the list of configuration PIDs.
* @throws Exception
*/
+ List<String> getConfigs() throws Exception;
+
+ /**
+ * @deprecated use getConfigs() instead.
+ */
List<String> list() throws Exception;
/**
@@ -47,21 +52,31 @@ public interface ConfigMBean {
void delete(String pid) throws Exception;
/**
- * Get the list of properties for a configuration PID.
+ * Get the list of properties for a given configuration PID.
*
* @param pid the configuration PID.
- * @return the list of properties.
+ * @return the list of properties associated to the PID.
* @throws Exception
*/
+ Map<String, String> listProperties(String pid) throws Exception;
+
+ /**
+ * @deprecated used listProperties() instead.
+ */
Map<String, String> proplist(String pid) throws Exception;
/**
- * Remove the configuration property identified by the given key.
+ * Delete the configuration property identified by the given key.
*
* @param pid the configuration PID.
* @param key the property key.
* @throws Exception
*/
+ void deleteProperty(String pid, String key) throws Exception;
+
+ /**
+ * @deprecated use deleteProperty() instead.
+ */
void propdel(String pid, String key) throws Exception;
/**
@@ -72,6 +87,11 @@ public interface ConfigMBean {
* @param value the value to append to the current property value.
* @throws Exception
*/
+ void appendProperty(String pid, String key, String value) throws Exception;
+
+ /**
+ * @deprecated use appendProperty() instead.
+ */
void propappend(String pid, String key, String value) throws Exception;
/**
@@ -82,6 +102,11 @@ public interface ConfigMBean {
* @param value the property value.
* @throws Exception
*/
+ void setProperty(String pid, String key, String value) throws Exception;
+
+ /**
+ * @deprecated use setProperty() instead.
+ */
void propset(String pid, String key, String value) throws Exception;
}
Modified: karaf/branches/karaf-2.3.x/management/mbeans/config/src/main/java/org/apache/karaf/management/mbeans/config/internal/ConfigMBeanImpl.java
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.3.x/management/mbeans/config/src/main/java/org/apache/karaf/management/mbeans/config/internal/ConfigMBeanImpl.java?rev=1386739&r1=1386738&r2=1386739&view=diff
==============================================================================
--- karaf/branches/karaf-2.3.x/management/mbeans/config/src/main/java/org/apache/karaf/management/mbeans/config/internal/ConfigMBeanImpl.java (original)
+++ karaf/branches/karaf-2.3.x/management/mbeans/config/src/main/java/org/apache/karaf/management/mbeans/config/internal/ConfigMBeanImpl.java Mon Sep 17 17:37:37 2012
@@ -66,7 +66,7 @@ public class ConfigMBeanImpl extends Sta
super(ConfigMBean.class);
}
- public List<String> list() throws Exception {
+ public List<String> getConfigs() throws Exception {
Configuration[] configurations = configurationAdmin.listConfigurations(null);
List<String> pids = new ArrayList<String>();
for (int i = 0; i < configurations.length; i++) {
@@ -75,6 +75,13 @@ public class ConfigMBeanImpl extends Sta
return pids;
}
+ /**
+ * @deprecated used getConfigs() instead.
+ */
+ public List<String> list() throws Exception {
+ return getConfigs();
+ }
+
public void create(String pid) throws Exception {
store(pid, new Hashtable(), false);
}
@@ -91,7 +98,7 @@ public class ConfigMBeanImpl extends Sta
}
}
- public Map<String, String> proplist(String pid) throws Exception {
+ public Map<String, String> listProperties(String pid) throws Exception {
Configuration configuration = configurationAdmin.getConfiguration(pid);
if (configuration == null) {
throw new IllegalArgumentException("Configuration PID " + pid + " doesn't exist");
@@ -111,7 +118,14 @@ public class ConfigMBeanImpl extends Sta
return propertiesMap;
}
- public void propdel(String pid, String key) throws Exception {
+ /**
+ * @deprecated use listProperties() instead.
+ */
+ public Map<String, String> proplist(String pid) throws Exception {
+ return listProperties(pid);
+ }
+
+ public void deleteProperty(String pid, String key) throws Exception {
Configuration configuration = configurationAdmin.getConfiguration(pid);
if (configuration == null) {
throw new IllegalArgumentException("Configuration PID " + pid + " doesn't exist");
@@ -126,7 +140,14 @@ public class ConfigMBeanImpl extends Sta
store(pid, dictionary, false);
}
- public void propappend(String pid, String key, String value) throws Exception {
+ /**
+ * @deprecated use deleteProperty() instead.
+ */
+ public void propdel(String pid, String key) throws Exception {
+ deleteProperty(pid, key);
+ }
+
+ public void appendProperty(String pid, String key, String value) throws Exception {
Configuration configuration = configurationAdmin.getConfiguration(pid);
if (configuration == null) {
throw new IllegalArgumentException("Configuration PID " + pid + " doesn't exist");
@@ -148,7 +169,14 @@ public class ConfigMBeanImpl extends Sta
store(pid, dictionary, false);
}
- public void propset(String pid, String key, String value) throws Exception {
+ /**
+ * @deprecated use appendProperty() instead.
+ */
+ public void propappend(String pid, String key, String value) throws Exception {
+ appendProperty(pid, key, value);
+ }
+
+ public void setProperty(String pid, String key, String value) throws Exception {
Configuration configuration = configurationAdmin.getConfiguration(pid);
if (configuration == null) {
throw new IllegalArgumentException("Configuration PID " + pid + " doesn't exist");
@@ -164,6 +192,13 @@ public class ConfigMBeanImpl extends Sta
}
/**
+ * @deprecated use setProperty() instead.
+ */
+ public void propset(String pid, String key, String value) throws Exception {
+ setProperty(pid, key, value);
+ }
+
+ /**
* Store/flush a configuration PID into the configuration file.
*
* @param pid the configuration PID.