@Override public void validate() { // how do you validate required attributes? super.validate(); }
@Override public void validate() { // how do you validate required attributes? super.validate(); }
@Override public void validate() { // how do you validate required attributes? super.validate(); }
@Override public void validate() { super.validate(true); } }
@Override public void validate() { super.validate(); boolean manageConnectionFactory = attributes.attribute(MANAGE_CONNECTION_FACTORY).get(); if (manageConnectionFactory && connectionFactory == null) { throw log.missingConnectionFactory(); } else if (!manageConnectionFactory && connectionFactory != null) { throw log.unmanagedConnectionFactory(); } if (connectionFactory != null) { connectionFactory.validate(); } }
@Override public void validate() { super.validate(); if (this.attributes.attribute(SQLStoreConfiguration.RECORD_TRANSFORMER).get() == null) { throw new CacheConfigurationException("An SQL store record transformer class must be specified"); } if (this.attributes.attribute(SQLStoreConfiguration.SQL_DIALECT).get() == null) { throw new CacheConfigurationException("An SQL store dialect must be specified"); } Properties props = this.attributes.attribute(AbstractStoreConfiguration.PROPERTIES).get(); if (props == null || props.isEmpty()) { throw new CacheConfigurationException("Missing SQL store properties, such as jdbcUrl, check the service documentation"); } }
@Override protected void validate(boolean skipClassChecks) { super.validate(skipClassChecks); int minNodeSize = attributes.attribute(MIN_NODE_SIZE).get(); int maxNodeSize = attributes.attribute(MAX_NODE_SIZE).get(); if (maxNodeSize <= 0 || maxNodeSize > Short.MAX_VALUE) { throw log.maxNodeSizeLimitedToShort(maxNodeSize); } else if (minNodeSize < 0 || minNodeSize > maxNodeSize) { throw log.minNodeSizeMustBeLessOrEqualToMax(minNodeSize, maxNodeSize); } double compactionThreshold = attributes.attribute(COMPACTION_THRESHOLD).get(); if (compactionThreshold <= 0 || compactionThreshold > 1) { throw log.invalidCompactionThreshold(compactionThreshold); } }
@Override public void validate() { super.validate(); if (this.attributes.attribute(DynamoDBStoreConfiguration.ITEM_TRANSFORMER).get() == null) { throw new CacheConfigurationException("A DynamoDB store item transformer class must be specified"); } if (this.attributes.attribute(DynamoDBStoreConfiguration.QUERY_EXECUTOR) != null && this.attributes.attribute(DynamoDBStoreConfiguration.INDEXED_ATTRIBUTES) == null) { throw new CacheConfigurationException("The indexed attributes must be specified if a query executor is set"); } if (this.attributes.attribute(DynamoDBStoreConfiguration.QUERY_EXECUTOR) == null && this.attributes.attribute(DynamoDBStoreConfiguration.INDEXED_ATTRIBUTES) != null) { throw new CacheConfigurationException("The query executor must be set if indexed attributes are specified"); } if (this.attributes.attribute(DynamoDBStoreConfiguration.APPLY_RANGE_KEY).get() != null) { if (this.attributes.attribute(DynamoDBStoreConfiguration.RANGE_KEY_VALUE).get() == null) { throw new CacheConfigurationException("A range key value must be specified"); } } }