Package org.apache.nifi.web
Interface NiFiWebConfigurationContext
public interface NiFiWebConfigurationContext
NiFi web context providing limited access to dataflow configuration for
component custom UIs.
-
Method Summary
Modifier and TypeMethodDescriptiongetComponentDetails
(NiFiWebRequestContext requestContext) Gets the details for the underlying component (including configuration, validation errors, and annotation data).getControllerService
(String serviceIdentifier, String componentId) void
saveActions
(NiFiWebRequestContext requestContext, Collection<ConfigurationAction> actions) Provides a mechanism for custom UIs to save actions to appear in NiFi configuration history.updateComponent
(NiFiWebConfigurationRequestContext configurationContext, String annotationData, Map<String, String> properties) Sets the annotation data for the underlying component.
-
Method Details
-
getControllerService
- Parameters:
serviceIdentifier
- of the controller servicecomponentId
- the id of the component that is referencing the controller service- Returns:
- the ControllerService for the specified identifier. If a corresponding service cannot be found, null is returned. If this NiFi is clustered, the only services available will be those those availability is NCM only
-
saveActions
Provides a mechanism for custom UIs to save actions to appear in NiFi configuration history. Note all fields within each Action must be populated. Null values will result in a failure to insert the audit record. Since the saving to these actions is separate from the actual configuration change, a failure to insert here will just generate a warning log message. The recording of these actions typically happens after a configuration change is applied. Since those changes have already been applied to the flow, we cannot revert them because of a failure to insert an audit record.- Parameters:
requestContext
- context of the requestactions
- to save- Throws:
IllegalArgumentException
- When the requestContext isn't fully populated or isn't appropriate for the given request
-
getCurrentUserIdentity
String getCurrentUserIdentity()- Returns:
- the current user identity. The value may be a DN, an email, a username, or any string that identities the user. Returns null if no user is found
-
updateComponent
ComponentDetails updateComponent(NiFiWebConfigurationRequestContext configurationContext, String annotationData, Map<String, String> properties) throws ResourceNotFoundException, InvalidRevisionException, ClusterRequestExceptionSets the annotation data for the underlying component.- Parameters:
configurationContext
- config contextannotationData
- the dataproperties
- component properties- Returns:
- the configuration for the underlying component
- Throws:
ResourceNotFoundException
- if the underlying component does not exitInvalidRevisionException
- if a revision other than the current revision is givenClusterRequestException
- if the annotation data was unable to be set for the underlying component. This exception will only be thrown when operating in a cluster.IllegalArgumentException
- When the requestContext isn't fully populated or isn't appropriate for the given request
-
getComponentDetails
ComponentDetails getComponentDetails(NiFiWebRequestContext requestContext) throws ResourceNotFoundException, ClusterRequestException Gets the details for the underlying component (including configuration, validation errors, and annotation data).- Parameters:
requestContext
- context of request- Returns:
- the configuration for the underlying component
- Throws:
ResourceNotFoundException
- if the underlying component does not exitClusterRequestException
- if the underlying component was unable to be retrieved from the cluster. This exception will only be thrown when operating in a cluster.IllegalArgumentException
- When the requestContext isn't fully populated or isn't appropriate for the given request
-