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 nameboolean
isDependencySatisfied
(PropertyDescriptor propertyDescriptor, Function<String, PropertyDescriptor> propertyDescriptorLookup) Determines whether or not the dependencies of the given Property Descriptor are satisfied.boolean
boolean
isExpressionLanguageSupported
(String propertyName) boolean
isParameterDefined
(String parameterName) boolean
isParameterSet
(String parameterName) Returnstrue
if a Parameter with the given name is defined and has a non-null value,false
if either the Parameter is not defined or the Parameter is defined but has a value ofnull
.default boolean
Determines whether or not incoming and outgoing connections should be validated.boolean
isValidationRequired
(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
ControllerServiceLookup
which 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
ExpressionLanguageCompiler
that 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 returnfalse
if 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:
false
if 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:
true
if the given value contains a NiFi Expression Language expression,false
if it does not
-
isExpressionLanguageSupported
- Parameters:
propertyName
- to test whether expression language is supported- Returns:
true
if the property with the given name supports the NiFi Expression Language,false
if 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:
true
if a Parameter with the given name is defined in the currently selected Parameter Context
-
isParameterSet
Returnstrue
if a Parameter with the given name is defined and has a non-null value,false
if either the Parameter is not defined or the Parameter is defined but has a value ofnull
.- Parameters:
parameterName
- the name of the parameter- Returns:
true
if 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:
true
if all dependencies of the given property descriptor are satisfied,false
otherwise
-
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 anInputRequirement
ofInputRequirement.Requirement.INPUT_REQUIRED
should be invalid unless it has an incoming (non-looping) connection, and any Processor with anInputRequirement
ofInputRequirement.Requirement.INPUT_FORBIDDEN
should be invalid if it does have any incoming connection.- Returns:
true
if Connections should be validated,false
if Connections should be ignored
-