public void setProperty(String name, String value) { // TODO Look at fake attributes if (name.equals("className")) { return; } // Determine the validity of the input property boolean validProperty = false; for (String gemfireProperty : AbstractDistributionConfig._getAttNames()) { if (name.equals(gemfireProperty)) { validProperty = true; break; } } // If it is a valid GemFire property, add it to the the GemFire properties. // Otherwise, log a warning. if (validProperty) { this.gemfireProperties.put(name, value); } else { getLogger().warn("The input property named " + name + " is not a valid GemFire property. It is being ignored."); } }
@Override public Class getAttributeType(String attName) { checkAttributeName(attName); return _getAttributeType(attName); }
@Override public boolean isAttributeModifiable(String name) { checkAttributeName(name); if (getModifiableAttributes().contains(name)) { return true; } if (getUnModifiableAttributes().contains(name)) { return false; } // otherwise, return the default return _modifiableDefault(); }
@Override public void setAttributeObject(String attName, Object attValue, ConfigSource source) { Class validValueClass = getAttributeType(attName); if (attValue != null) { setSecurity(attName, attValue.toString()); setSSLProperty(attName, attValue.toString()); getAttSourceMap().put(attName, source); return; checkAttribute(attName, attValue); try { setter.invoke(this, attValue); getAttSourceMap().put(attName, source);
if (getClusterSSLEnabled() || getJmxManagerSSLEnabled() || getHttpServiceSSLEnabled() || getServerSSLEnabled() || getGatewaySSLEnabled()) { throw new IllegalArgumentException( "When using ssl-enabled-components one cannot use any other SSL properties other than cluster-ssl-* or the corresponding aliases");
@Test public void testGetAttributeNames() { String[] attNames = AbstractDistributionConfig._getAttNames(); assertThat(attNames.length).isEqualTo(165); List otherList = new ArrayList(); for (String attName : attNames) { Class clazz = AbstractDistributionConfig._getAttributeType(attName); if (clazz.equals(Boolean.class)) { boolList.add(attName);
@Override public Object getAttributeObject(String attName) { checkAttributeName(attName); return LogWriterImpl.levelToString(getLogLevel()); return LogWriterImpl.levelToString(getSecurityLogLevel()); if (getter == null) { if (attName.startsWith(SECURITY_PREFIX)) { return getSecurity(attName);
Object checkAttribute(String attName, Object value) { if (!isAttributeModifiable(attName)) { throw new UnmodifiableException(_getUnmodifiableMsg(attName)); minMaxCheck(attName, intValue, attribute.min(), attribute.max());
@ConfigAttributeChecker(name = TCP_PORT) protected int checkTcpPort(int value) { if (getClusterSSLEnabled() && value != 0) { throw new IllegalArgumentException( String.format("Could not set %s to %s because its value must be 0 when %s is true.", TCP_PORT, value, CLUSTER_SSL_ENABLED)); } return value; }
@ConfigAttributeChecker(name = MCAST_PORT) protected int checkMcastPort(int value) { if (getClusterSSLEnabled() && value != 0) { throw new IllegalArgumentException( String.format("Could not set %s to %s because its value must be 0 when %s is true.", MCAST_PORT, value, CLUSTER_SSL_ENABLED)); } return value; }
@Test public void testAttributeDesc() { String[] attNames = AbstractDistributionConfig._getAttNames(); for (String attName : attNames) { assertTrue("Does not contain description for attribute " + attName, AbstractDistributionConfig.dcAttDescriptions.containsKey(attName)); } List<String> attList = Arrays.asList(attNames); for (Object attName : AbstractDistributionConfig.dcAttDescriptions.keySet()) { if (!attList.contains(attName)) { System.out.println("Has unused description for " + attName.toString()); } } }
public void setProperty(String name, String value) { // TODO Look at fake attributes if (name.equals("className")) { return; } // Determine the validity of the input property boolean validProperty = false; for (String gemfireProperty : AbstractDistributionConfig._getAttNames()) { if (name.equals(gemfireProperty)) { validProperty = true; break; } } // If it is a valid GemFire property, add it to the the GemFire properties. // Otherwise, log a warning. if (validProperty) { this.gemfireProperties.put(name, value); } else { getLogger().warn("The input property named " + name + " is not a valid GemFire property. It is being ignored."); } }