use of org.codice.ddf.ui.admin.api.ConfigurationAdminMBean in project admin-console-beta by connexta.
the class ManagedServiceOperation method readState.
@Override
public Map<String, Map<String, Object>> readState() throws ConfiguratorException {
try {
String[][] configurations = getConfigAdmin().getConfigurations(String.format("(service.factoryPid=%s)", factoryPid));
if (configurations == null || configurations.length == 0) {
return Collections.emptyMap();
}
HashMap<String, Map<String, Object>> retVal = new HashMap<>();
ConfigurationAdminMBean configAdminMBean = getConfigAdminMBean();
for (String[] configuration : configurations) {
String configPid = configuration[0];
retVal.put(configPid, configAdminMBean.getProperties(configPid));
}
return retVal;
} catch (IOException | MalformedObjectNameException e) {
LOGGER.debug("Error retrieving configurations for factoryPid, {}", factoryPid, e);
throw new ConfiguratorException("Error retrieving configurations");
}
}
Aggregations