private boolean isTakeOver(Configuration deploymentConfiguration) { PropertySimple takeOver = deploymentConfiguration.getSimple("takeOver"); if (takeOver == null) { return false; } Boolean value = takeOver.getBooleanValue(); return value != null && value; } }
protected Object getPropertyValueAsType(PropertySimple propSimple, String typeName) { Object value; if (typeName.equals(String.class.getName())) { value = (propSimple == null) ? null : propSimple.getStringValue(); } else if (typeName.equals(Boolean.class.getName()) || typeName.equals(boolean.class.getName())) { value = (propSimple == null) ? null : propSimple.getBooleanValue(); } else if (typeName.equals(Integer.class.getName()) || typeName.equals(int.class.getName())) { value = (propSimple == null) ? null : propSimple.getIntegerValue(); } else if (typeName.equals(Long.class.getName()) || typeName.equals(long.class.getName())) { value = (propSimple == null) ? null : propSimple.getLongValue(); } else if (typeName.equals(Float.class.getName()) || typeName.equals(float.class.getName())) { value = (propSimple == null) ? null : propSimple.getFloatValue(); } else if (typeName.equals(Double.class.getName()) || typeName.equals(double.class.getName())) { value = (propSimple == null) ? null : propSimple.getDoubleValue(); } else { throw new IllegalStateException("Operation parameter maps to MBean parameter with an unsupported type (" + typeName + ")."); } // TODO GH: Handle rest of types. (I think i have a mapper for this in mc4j return value; } }
} else if (expectedReturn.getName().equals(Boolean.class.getName()) || expectedReturn.getName().equals(Boolean.TYPE.getName())) { return simple.getBooleanValue(); } else if (expectedReturn.getName().equals(Integer.class.getName()) || expectedReturn.getName().equals(Integer.TYPE.getName())) { } else if (expectedReturn.getName().equals(Boolean.class.getName()) || expectedReturn.getName().equals(Boolean.TYPE.getName())) { return simple.getBooleanValue();
private boolean shouldUpdateSchedules(MetricTemplate def) { if (importConfiguration == null) { return UPDATE_SCHEDULES_DEFAULT; } String updateAll = importConfiguration.getSimpleValue(UPDATE_ALL_SCHEDULES_PROPERTY, null); if (updateAll != null) { if (Boolean.parseBoolean(updateAll)) { return true; } } PropertyList perMetricOverrides = importConfiguration.getList(METRIC_UPDATE_OVERRIDES_PROPERTY); if (perMetricOverrides == null) { return UPDATE_SCHEDULES_DEFAULT; } PropertySimple override = findOverrideForMetric(def, perMetricOverrides); if (override == null) { return UPDATE_SCHEDULES_DEFAULT; } return override.getBooleanValue(); }
@Override public OperationResult invokeOperation(final String name, final Configuration parameters) throws InterruptedException, Exception { if (OPERATION_RESET.equals(name)) { final Service service = getService(); final Application application = getApplication(); if ((service != null) && (application != null)) { final String serviceName = service.getName().toString(); final String applicationName = application.getName().toString(); execute(new ResetServiceMetrics(applicationName, serviceName), Void.class); clearServiceMetrics(); } } else if (OPERATION_SET_THROTTLING.equals(name)) { final PropertySimple enabled = (PropertySimple) parameters.get(OPERATION_PARAMETER_ENABLED); final PropertySimple maxRequests = (PropertySimple) parameters.get(OPERATION_PARAMETER_MAX_REQUESTS); final Service service = getService(); final Application application = getApplication(); if ((service != null) && (application != null)) { final String serviceName = service.getName().toString(); final String applicationName = application.getName().toString(); execute(new UpdateThrottling(applicationName, serviceName, (enabled != null ? enabled.getBooleanValue() : null), (maxRequests != null ? maxRequests.getIntegerValue() : null)), Void.class); clearApplications(); } } else if (LOG.isDebugEnabled()) { LOG.warn("Unknown Service operation " + name); } return null; }
if (managedRuntimeProp != null && managedRuntimeProp.getBooleanValue() != null && managedRuntimeProp.getBooleanValue()) {
if (managedRuntimeProp != null && managedRuntimeProp.getBooleanValue() != null && managedRuntimeProp.getBooleanValue()) {
if ((null == explodeOnDeployProp) || (null == explodeOnDeployProp.getBooleanValue())) { CreateResourceHelper.setErrorOnReport(report, "Explode On Deploy property is required."); return; boolean explodeOnDeploy = (isUnpackWars() || explodeOnDeployProp.getBooleanValue());
/** * Return the object representation of the passed PropertySimple for the passed type * @param prop Property to evaluate * @param type Type to convert into * @return Converted object -- if no valid type is found, a String-value is returned. */ private Object getObjectForProperty(PropertySimple prop, PropertySimpleType type) { switch (type) { case STRING: return prop.getStringValue(); case INTEGER: return prop.getIntegerValue(); case BOOLEAN: return prop.getBooleanValue(); case LONG: return prop.getLongValue(); case FLOAT: return prop.getFloatValue(); case DOUBLE: return prop.getDoubleValue(); default: return prop.getStringValue(); } }
if (remoteProp != null && remoteProp.getBooleanValue() != null && remoteProp.getBooleanValue()) { result .setErrorMessage("This is a manually added server. This operation can not be used to install a management user. Use the server's 'bin/add-user.sh'");
if (simple != null && simple.getBooleanValue() != null) enabled = simple.getBooleanValue();
boolean enabledNew = mapNew.getSimple("enabled").getBooleanValue(); PropertyMap mapCurrent = assignedCurrent.remove(key); if (mapCurrent == null) { needDiscovery = true; } else { boolean enabledCurrent = mapCurrent.getSimple("enabled").getBooleanValue(); if (enabledCurrent != enabledNew) {
PropertySimple configManagementEnabled = getResourceContext().getPluginConfiguration().getSimple( "configManagementEnabled"); if (configManagementEnabled == null || !configManagementEnabled.getBooleanValue()) { log.info("Configuration management is currently disabled for the " + getResourceContext().getResourceType() + " Resource with key ["
} else { boolean runRepair = parameters.getSimple(RUN_REPAIR_PROPERTY).getBooleanValue(); PropertyList seedsList = parameters.getList(SEEDS_LIST).deepCopy(false); Subject subject = getSubject(resourceOperationHistory);
if (supportsPatching.getBooleanValue() == null || !supportsPatching.getBooleanValue()) { return Result.error("The target resource does not support patching.");
unannounceStorageNode(getSubject(operationHistory), removedStorageNode); } else { boolean runRepair = parameters.getSimple(RUN_REPAIR_PROPERTY).getBooleanValue(); PropertyList seedsList = parameters.getList(SEEDS_LIST).deepCopy(false); Subject subject = getSubject(operationHistory);
attribute.setValue(property.getBooleanValue()); break;
Boolean enableDatasource = enabledProperty == null ? TRUE : enabledProperty.getBooleanValue();