@Override public AttributeList getAttributes(String[] attributes) { AttributeList list = new AttributeList(); for (ConfigItem item: serverConfigurationService.getConfigData().getItems()) { String name = item.getName(); Object value = item.getValue(); Attribute attribute; if (item.isSecured()) { attribute = new Attribute(name, null); } else { attribute = new Attribute(name, value); } list.add(attribute); } return list; }
break; attributeInfos.add(new MBeanAttributeInfo(item.getName(), type, item.getDescription(), !item.isSecured(), true, false));
if (secured != item.isSecured()) { return false;
if (secured != item.isSecured()) { return false;
if (item.getValue() != null) { hItem.setValue(serializeValue(item.getValue(), item.getType(), item.isSecured())); hItem.setValue(serializeValue(item.getValue(), item.getType(), item.isSecured())); if (item.getDefaultValue() != null) { hItem.setDefaultValue(serializeValue(item.getDefaultValue(), item.getType(), item.isSecured())); hItem.setDefaultValue(serializeValue(item.getDefaultValue(), item.getType(), item.isSecured())); hItem.setSecured(item.isSecured()); hItem.setRegistered(item.isRegistered()); hItem.setSource(item.getSource()); hItem.setRawValue(serializeValue(getRawProperty(hItem.getName()), ServerConfigurationService.TYPE_STRING, item.isSecured())); updatedItem = hItem;
serialValue = serializeValue(item.getValue(), item.getType(), item.isSecured()); serialDefaultValue = serializeValue(item.getDefaultValue(), item.getType(), item.isSecured()); serialRawValue = serializeValue(getRawProperty(item.getName()), ServerConfigurationService.TYPE_STRING, item.isSecured()); } catch (IllegalClassException ice) { log.error("Skip ConfigItem {}, {}", item, ice.getMessage()); item.isRegistered(), item.isDefaulted(), item.isSecured(), item.isDynamic());
/** * Make an impl from something that implements ConfigItem by copying the field values * @param ci a ci object */ @SuppressWarnings("unused") public ConfigItemImpl(ConfigItem ci) { this(ci.getName(), ci.getValue(), ci.getType(), ci.getDescription(), ci.getSource(), ci.getDefaultValue(), ci.getRequested(), ci.getChanged(), null, ci.isRegistered(), ci.isDefaulted(), ci.isSecured(), ci.isDynamic()); if (ci.getHistory() != null) { this.history = Arrays.asList(ci.getHistory()); } else { this.history = new ArrayList<ConfigHistory>(); } }
@Override public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException { ConfigItem configItem = serverConfigurationService.getConfigItem(attribute); if (configItem.isSecured()) { return null; } return configItem.getValue(); }