}
private OperationDefinition validateOperationNameAndParameters(ResourceType resourceType, String operationName,
Configuration parameters) {
Set<OperationDefinition> operationDefinitions = resourceType.getOperationDefinitions();
OperationDefinition matchingOperationDefinition = null;
for (OperationDefinition operationDefinition : operationDefinitions) {
if (operationDefinition.getName().equals(operationName)) {
matchingOperationDefinition = operationDefinition;
break;
}
}
if (matchingOperationDefinition == null) {
throw new IllegalArgumentException("[" + operationName
+ "] is not a valid operation name for Resources of type [" + resourceType.getName() + "].");
}
ConfigurationDefinition parametersDefinition = matchingOperationDefinition
.getParametersConfigurationDefinition();
List<String> errors = ConfigurationUtility.validateConfiguration(parameters, parametersDefinition);
if (!errors.isEmpty()) {
throw new IllegalArgumentException("Parameters for [" + operationName + "] on Resource of type ["
+ resourceType.getName() + "] are not valid: " + errors);