Package org.apache.nifi.components
Interface ValidationContext
- All Superinterfaces:
PropertyContext
-
Method Summary
Modifier and TypeMethodDescriptiongetControllerServiceValidationContext(ControllerService controllerService) Returns the identifier of the ProcessGroup that the component being validated lives ingetReferencedParameters(String propertyName) Returns a Collection containing the names of all Parameters that are referenced by the property with the given namebooleanisDependencySatisfied(PropertyDescriptor propertyDescriptor, Function<String, PropertyDescriptor> propertyDescriptorLookup) Determines whether or not the dependencies of the given Property Descriptor are satisfied.booleanbooleanisExpressionLanguageSupported(String propertyName) booleanisParameterDefined(String parameterName) booleanisParameterSet(String parameterName) Returnstrueif a Parameter with the given name is defined and has a non-null value,falseif either the Parameter is not defined or the Parameter is defined but has a value ofnull.default booleanDetermines whether or not incoming and outgoing connections should be validated.booleanisValidationRequired(ControllerService service) There are times when the framework needs to consider a component valid, even if it references an invalid ControllerService.newPropertyValue(String value) Methods inherited from interface org.apache.nifi.context.PropertyContext
getAllProperties, getProperty
-
Method Details
-
getControllerServiceLookup
ControllerServiceLookup getControllerServiceLookup()- Returns:
- the
ControllerServiceLookupwhich can be used to obtain Controller Services
-
getControllerServiceValidationContext
- Parameters:
controllerService- to lookup the validation context of- Returns:
- a ValidationContext that is appropriate for validating the given
ControllerService
-
newExpressionLanguageCompiler
ExpressionLanguageCompiler newExpressionLanguageCompiler()- Returns:
- a new
ExpressionLanguageCompilerthat can be used to compile invalid input: '&' evaluate Attribute Expressions
-
newPropertyValue
- Parameters:
value- to make a PropertyValue object for- Returns:
- a PropertyValue that represents the given value
-
getProperties
Map<PropertyDescriptor,String> getProperties()- Returns:
- a Map of all configured Properties
-
getAnnotationData
String getAnnotationData()- Returns:
- the currently configured Annotation Data
-
isValidationRequired
There are times when the framework needs to consider a component valid, even if it references an invalid ControllerService. This method will returnfalseif the component is to be considered valid even if the given Controller Service is referenced and is invalid.- Parameters:
service- to check if validation is required- Returns:
falseif the component is to be considered valid even if the given Controller Service is referenced and is invalid
-
isExpressionLanguagePresent
- Parameters:
value- to test whether expression language is present- Returns:
trueif the given value contains a NiFi Expression Language expression,falseif it does not
-
isExpressionLanguageSupported
- Parameters:
propertyName- to test whether expression language is supported- Returns:
trueif the property with the given name supports the NiFi Expression Language,falseif the property does not support the Expression Language or is not a valid property name
-
getProcessGroupIdentifier
String getProcessGroupIdentifier()Returns the identifier of the ProcessGroup that the component being validated lives in- Returns:
- the identifier of the ProcessGroup that the component being validated lives in
-
getReferencedParameters
Returns a Collection containing the names of all Parameters that are referenced by the property with the given name- Returns:
- a Collection containing the names of all Parameters that are referenced by the property with the given name
-
isParameterDefined
- Parameters:
parameterName- the name of the Parameter- Returns:
trueif a Parameter with the given name is defined in the currently selected Parameter Context
-
isParameterSet
Returnstrueif a Parameter with the given name is defined and has a non-null value,falseif either the Parameter is not defined or the Parameter is defined but has a value ofnull.- Parameters:
parameterName- the name of the parameter- Returns:
trueif the Parameter is defined and has a non-null value, false otherwise
-
isDependencySatisfied
boolean isDependencySatisfied(PropertyDescriptor propertyDescriptor, Function<String, PropertyDescriptor> propertyDescriptorLookup) Determines whether or not the dependencies of the given Property Descriptor are satisfied. If the given Property Descriptor has no dependency on another property, then the dependency is satisfied. If there is at least one dependency, then all dependencies must be satisfied. In order for a dependency to be considered satisfied, all of the following must be true:- The property that is depended upon has all of its dependencies satisfied.
- If the given Property Descriptor depends on a given AllowableValue, then the property that is depended upon has a value that falls within the given range of Allowable Values for the dependency.
- Parameters:
propertyDescriptor- the property descriptorpropertyDescriptorLookup- a lookup for converting from a property name to the property descriptor with that name- Returns:
trueif all dependencies of the given property descriptor are satisfied,falseotherwise
-
isValidateConnections
default boolean isValidateConnections()Determines whether or not incoming and outgoing connections should be validated. Iftrue, then the validation should verify that all Relationships either have one or more connections that include the Relationship, or that the Relationship is auto-terminated. Additionally, iftrue, then any Processor with anInputRequirementofInputRequirement.Requirement.INPUT_REQUIREDshould be invalid unless it has an incoming (non-looping) connection, and any Processor with anInputRequirementofInputRequirement.Requirement.INPUT_FORBIDDENshould be invalid if it does have any incoming connection.- Returns:
trueif Connections should be validated,falseif Connections should be ignored
-