@Override public void validateParameter(String parameterName, ModelNode value) throws OperationFailedException { super.validateParameter(parameterName, value); if (value.isDefined() && value.getType() != ModelType.EXPRESSION) { if (!this.allowedChannelOptTypes.contains(value)) { throw EjbLogger.ROOT_LOGGER.unknownChannelCreationOptionType(value.asString()); } } } }
@Override public PropertiesAttributeDefinition build() { if (this.elementValidator == null) { this.elementValidator = new ModelTypeValidator(ModelType.STRING, this.isAllowNull(), this.isAllowExpression()); } return new PropertiesAttributeDefinition(this); } }
@SuppressWarnings("deprecation") @Override public void validateParameter(String parameterName, ModelNode value) throws OperationFailedException { super.validateParameter(parameterName, value); if (value.isDefined()) { String module = value.asString(); try { org.jboss.modules.ModuleIdentifier.fromString(module); } catch (IllegalArgumentException e) { throw new OperationFailedException(e.getMessage() + ": " + module, e); } } } }
@Override public TimerAttributeDefinition build() { setValidator(new ModelTypeValidator(ModelType.OBJECT)); setStorageRuntime(); return new TimerAttributeDefinition(this); } }
/** * {@inheritDoc} */ @Override public void validateParameter(String parameterName, ModelNode value) throws OperationFailedException { super.validateParameter(parameterName, value); if (value.isDefined() && value.getType() != ModelType.EXPRESSION) { String val = value.asString(); try { PredicateParser.parse(val, getClass().getClassLoader()); } catch (Exception e) { throw new OperationFailedException(UndertowLogger.ROOT_LOGGER.predicateNotValid(val, e.getMessage()), e); } } } }
public Builder(final StringListAttributeDefinition basic) { super(basic); if (validator==null){ validator = new ModelTypeValidator(ModelType.STRING); } }
@Override public void validateParameter(String parameterName, ModelNode parameterValue) throws OperationFailedException { super.validateParameter(parameterName, parameterValue); if (parameterValue.isDefined() && parameterValue.getType() != ModelType.EXPRESSION) { double value = parameterValue.asDouble(); if (this.lowerBound != null) { double bound = this.lowerBound.getValue(); boolean exclusive = this.lowerBound.isExclusive(); if ((value < bound) || (exclusive && (value == bound))) { throw ClusteringLogger.ROOT_LOGGER.parameterValueOutOfBounds(parameterName, value, exclusive ? ">" : ">=", bound); } } if (this.upperBound != null) { double bound = this.upperBound.getValue(); boolean exclusive = this.upperBound.isExclusive(); if ((value > bound) || (exclusive && (value == bound))) { throw ClusteringLogger.ROOT_LOGGER.parameterValueOutOfBounds(parameterName, value, exclusive ? "<" : "<=", bound); } } } } }
public ModelTypeValidatingHandler(final boolean nullable, final boolean allowExpressions, final boolean strict, ModelType firstValidType, ModelType... otherValidTypes) { super(new ModelTypeValidator(nullable, allowExpressions, strict, firstValidType, otherValidTypes)); } }
@Override public void validateParameter( String parameterName, ModelNode value ) throws OperationFailedException { super.validateParameter(parameterName, value); String str = value.asString(); Matcher matcher = pattern.matcher(str); if (!matcher.matches()) { throw new OperationFailedException("The value '" + str + "' must satisfy the regular expression: " + pattern); } }
public Builder(final String name) { super(name, ModelType.STRING); validator = new ModelTypeValidator(ModelType.STRING); }
/** * {@inheritDoc} */ @Override public void validateResolvedParameter(String parameterName, ModelNode value) throws OperationFailedException { validateParameter(parameterName, value.resolve()); }
public ModelTypeValidatingHandler(final boolean nullable, final boolean allowExpressions, final boolean strict, ModelType firstValidType, ModelType... otherValidTypes) { super(new ModelTypeValidator(nullable, allowExpressions, strict, firstValidType, otherValidTypes)); } }
@Override public void validateParameter( String parameterName, ModelNode value ) throws OperationFailedException { super.validateParameter(parameterName, value); String valueString = value.asString(); if (!RepositoryConfiguration.PROJECTION_PATH_EXPRESSION_PATTERN.matcher(valueString).matches()) { throw new OperationFailedException(valueString + " is not a valid projection expression"); } } }
private TimerAttributeDefinition() { super("timers", false, new ModelTypeValidator(ModelType.OBJECT), AttributeAccess.Flag.STORAGE_RUNTIME); }
@Override public void validateParameter( String parameterName, ModelNode value ) throws OperationFailedException { super.validateParameter(parameterName, value); String valueString = value.asString(); if (!RepositoryConfiguration.INDEX_COLUMN_DEFINITIONS_PATTERN.matcher(valueString).matches()) { throw new OperationFailedException(valueString + " is not a valid definition of index columns"); } } }
/** * @param name * @param xmlName * @param allowNull * @deprecated use {@link Builder} */ @Deprecated public PropertiesAttributeDefinition(final String name, final String xmlName, boolean allowNull) { super(name, xmlName, allowNull, 0, Integer.MAX_VALUE, new ModelTypeValidator(ModelType.STRING)); }
/** * {@inheritDoc} */ @Override public void validateResolvedParameter(String parameterName, ModelNode value) throws OperationFailedException { validateParameter(parameterName, value.resolve()); }
@Deprecated protected PrimitiveListAttributeDefinition(final String name, final String xmlName, final boolean allowNull, final boolean allowExpressions, final ModelType valueType, final int minSize, final int maxSize, final String[] alternatives, final String[] requires, final AttributeMarshaller attributeMarshaller, final boolean resourceOnly, final DeprecationData deprecated, final AttributeAccess.Flag... flags) { super(name, xmlName, allowNull, allowExpressions, minSize, maxSize, new ModelTypeValidator(valueType), alternatives, requires, attributeMarshaller, resourceOnly, deprecated, flags); this.valueType = valueType; }
@Override public void validateParameter(String parameterName, ModelNode value) throws OperationFailedException { super.validateParameter(parameterName, value); if (value.isDefined()) { final String stringValue = value.asString(); if (!pattern.matcher(stringValue).matches()) { throw new OperationFailedException("Does not match pattern"); } } } }
/** * * @param name * @param xmlName * @param allowNull * @param expressionAllowed * @deprecated use {@link Builder} */ @Deprecated public SimpleMapAttributeDefinition(final String name, final String xmlName, boolean allowNull, boolean expressionAllowed) { super(name, xmlName, allowNull, expressionAllowed, 0, Integer.MAX_VALUE, null, new ModelTypeValidator(ModelType.STRING, allowNull, expressionAllowed), null, null, null, false, null, AttributeAccess.Flag.RESTART_ALL_SERVICES); }