Class StandardControllerServiceNode
java.lang.Object
org.apache.nifi.controller.AbstractComponentNode
org.apache.nifi.controller.service.StandardControllerServiceNode
- All Implemented Interfaces:
Authorizable,ComponentAuthorizable,VersionedComponent,ComponentNode,ControllerServiceNode,GroupedComponent
public class StandardControllerServiceNode
extends AbstractComponentNode
implements ControllerServiceNode
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicBooleanprivate LogLevelprivate Stringprivate final AtomicReference<ControllerServiceDetails> private static final org.slf4j.Loggerprivate ProcessGroupprivate final Lockprivate final Set<Tuple<ComponentNode, PropertyDescriptor>> private final ReadWriteLockprivate final ControllerServiceProviderprivate final ServiceStateTransitionprivate final AtomicReference<String> private final Lock -
Constructor Summary
ConstructorsConstructorDescriptionStandardControllerServiceNode(LoggableComponent<ControllerService> implementation, LoggableComponent<ControllerService> proxiedControllerService, ControllerServiceInvocationHandler invocationHandler, String id, ValidationContextFactory validationContextFactory, ControllerServiceProvider serviceProvider, String componentType, String componentCanonicalClass, ReloadComponent reloadComponent, ExtensionManager extensionManager, ValidationTrigger validationTrigger, boolean isExtensionMissing) StandardControllerServiceNode(LoggableComponent<ControllerService> implementation, LoggableComponent<ControllerService> proxiedControllerService, ControllerServiceInvocationHandler invocationHandler, String id, ValidationContextFactory validationContextFactory, ControllerServiceProvider serviceProvider, ReloadComponent reloadComponent, ExtensionManager extensionManager, ValidationTrigger validationTrigger) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReference(ComponentNode referencingComponent, PropertyDescriptor propertyDescriptor) booleanawaitDisabled(long timePeriod, TimeUnit timeUnit) booleanawaitEnabled(long timePeriod, TimeUnit timeUnit) disable(ScheduledExecutorService scheduler) Will atomically disable this service by invoking its @OnDisabled operation.enable(ScheduledExecutorService scheduler, long administrativeYieldMillis) Will atomically enable this service by invoking its @OnEnabled operation.Class<?> protected ParameterContextgetState()private voidinvokeDisable(ConfigurationContext configContext) booleanisActive()booleanbooleanbooleanvoidmigrateConfiguration(Map<String, String> originalPropertyValues, ControllerServiceFactory serviceFactory) voidnotifyPrimaryNodeChanged(org.apache.nifi.annotation.notification.PrimaryNodeState nodeState) protected voidperformValidation(ValidationContext validationContext) voidvoidremoveReference(ComponentNode referencingComponent, PropertyDescriptor propertyDescriptor) voidsetBulletinLevel(LogLevel level) voidsetComments(String comment) voidsetControllerServiceAndProxy(LoggableComponent<ControllerService> implementation, LoggableComponent<ControllerService> proxiedControllerService, ControllerServiceInvocationHandler invocationHandler) voidsetProcessGroup(ProcessGroup group) voidsetProperties(Map<String, String> properties, boolean allowRemovalOfRequiredProperties, Set<String> sensitiveDynamicPropertyNames) voidsetVersionedComponentId(String versionedComponentId) toString()voidupdateReference(ComponentNode referencingComponent, PropertyDescriptor propertyDescriptor) protected List<ValidationResult> voidvoidvoidvoidverifyCanDisable(Set<ControllerServiceNode> ignoreReferences) voidvoidverifyCanEnable(Set<ControllerServiceNode> ignoredReferences) voidvoidverifyConfiguration(ConfigurationContext context, ComponentLog logger, Map<String, String> variables, ExtensionManager extensionManager) voidMethods inherited from class org.apache.nifi.controller.AbstractComponentNode
computeValidationErrors, decrementReferenceCounts, determineClasloaderIsolationKey, equals, getAdditionalClasspathResources, getAdditionalClasspathResources, getAdditionalClasspathResources, getAnnotationData, getCanonicalClassName, getComponentType, getEffectivePropertyValue, getEffectivePropertyValues, getExtensionManager, getIdentifier, getName, getProperties, getProperty, getPropertyDescriptor, getPropertyDescriptors, getRawPropertyValue, getRawPropertyValues, getReferencedAttributeNames, getReferencedParameterNames, getReloadComponent, getValidationContext, getValidationContextFactory, getValidationErrors, getValidationErrors, getValidationState, getValidationStatus, getValidationStatus, hashCode, incrementReferenceCounts, isClasspathDifferent, isExtensionMissing, isReferencingParameter, isReferencingParameter, isReloadAdditionalResourcesNecessary, isSensitiveDynamicProperty, mapRawValueToEffectiveValue, onParametersModified, onPropertyModified, overwriteProperties, pauseValidationTrigger, performValidation, performValidation, refreshProperties, reloadAdditionalResourcesIfNecessary, resetValidationState, resumeValidationTrigger, setAdditionalResourcesFingerprint, setAnnotationData, setExtensionMissing, setName, validateReferencedControllerServices, verifyCanUpdateBundle, verifyCanUpdateProperties, verifyConfigMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.authorization.resource.Authorizable
authorize, checkAuthorization, getRequestedResource, isAuthorizedMethods inherited from interface org.apache.nifi.controller.ComponentNode
authorize, checkAuthorization, getAdditionalClasspathResources, getAnnotationData, getCanonicalClassName, getClassLoaderIsolationKey, getComponentType, getEffectivePropertyValue, getEffectivePropertyValues, getIdentifier, getName, getProperties, getProperty, getPropertyDescriptor, getPropertyDescriptors, getRawPropertyValue, getRawPropertyValues, getReferencedAttributeNames, getReferencedParameterNames, getValidationErrors, getValidationStatus, getValidationStatus, isExtensionMissing, isReferencingParameter, isReferencingParameter, isReloadAdditionalResourcesNecessary, isSensitiveDynamicProperty, isSupportsSensitiveDynamicProperties, onParametersModified, pauseValidationTrigger, performValidation, performValidation, refreshProperties, reloadAdditionalResourcesIfNecessary, resetValidationState, resumeValidationTrigger, setAnnotationData, setExtensionMissing, setName, setProperties, verifyCanUpdateBundle, verifyCanUpdateProperties
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
controllerServiceHolder
-
serviceProvider
-
stateTransition
-
versionedComponentId
-
rwLock
-
readLock
-
writeLock
-
referencingComponents
-
comment
-
processGroup
-
bulletinLevel
-
active
-
-
Constructor Details
-
StandardControllerServiceNode
public StandardControllerServiceNode(LoggableComponent<ControllerService> implementation, LoggableComponent<ControllerService> proxiedControllerService, ControllerServiceInvocationHandler invocationHandler, String id, ValidationContextFactory validationContextFactory, ControllerServiceProvider serviceProvider, ReloadComponent reloadComponent, ExtensionManager extensionManager, ValidationTrigger validationTrigger) -
StandardControllerServiceNode
public StandardControllerServiceNode(LoggableComponent<ControllerService> implementation, LoggableComponent<ControllerService> proxiedControllerService, ControllerServiceInvocationHandler invocationHandler, String id, ValidationContextFactory validationContextFactory, ControllerServiceProvider serviceProvider, String componentType, String componentCanonicalClass, ReloadComponent reloadComponent, ExtensionManager extensionManager, ValidationTrigger validationTrigger, boolean isExtensionMissing)
-
-
Method Details
-
getComponent
- Specified by:
getComponentin interfaceComponentNode
-
getLogger
- Specified by:
getLoggerin interfaceComponentNode
-
getBundleCoordinate
- Specified by:
getBundleCoordinatein interfaceComponentNode
-
getParentAuthorizable
- Specified by:
getParentAuthorizablein interfaceAuthorizable
-
getResource
- Specified by:
getResourcein interfaceAuthorizable
-
isRestricted
public boolean isRestricted()- Specified by:
isRestrictedin interfaceComponentNode
-
getComponentClass
- Specified by:
getComponentClassin interfaceComponentNode
-
isDeprecated
public boolean isDeprecated()- Specified by:
isDeprecatedin interfaceComponentNode
-
getControllerServiceImplementation
- Specified by:
getControllerServiceImplementationin interfaceControllerServiceNode
-
getProxiedControllerService
- Specified by:
getProxiedControllerServicein interfaceControllerServiceNode
-
getInvocationHandler
- Specified by:
getInvocationHandlerin interfaceControllerServiceNode
-
setControllerServiceAndProxy
public void setControllerServiceAndProxy(LoggableComponent<ControllerService> implementation, LoggableComponent<ControllerService> proxiedControllerService, ControllerServiceInvocationHandler invocationHandler) - Specified by:
setControllerServiceAndProxyin interfaceControllerServiceNode
-
reload
- Specified by:
reloadin interfaceComponentNode- Throws:
ControllerServiceInstantiationException
-
setProperties
public void setProperties(Map<String, String> properties, boolean allowRemovalOfRequiredProperties, Set<String> sensitiveDynamicPropertyNames) - Specified by:
setPropertiesin interfaceComponentNode- Overrides:
setPropertiesin classAbstractComponentNode
-
getProcessGroup
- Specified by:
getProcessGroupin interfaceControllerServiceNode- Specified by:
getProcessGroupin interfaceGroupedComponent
-
getParentProcessGroup
- Specified by:
getParentProcessGroupin interfaceComponentNode
-
setProcessGroup
- Specified by:
setProcessGroupin interfaceControllerServiceNode
-
getReferences
- Specified by:
getReferencesin interfaceControllerServiceNode
-
addReference
- Specified by:
addReferencein interfaceControllerServiceNode
-
updateReference
public void updateReference(ComponentNode referencingComponent, PropertyDescriptor propertyDescriptor) - Specified by:
updateReferencein interfaceControllerServiceNode
-
getParameterContext
- Specified by:
getParameterContextin classAbstractComponentNode
-
getRequiredControllerServices
- Specified by:
getRequiredControllerServicesin interfaceControllerServiceNode
-
removeReference
public void removeReference(ComponentNode referencingComponent, PropertyDescriptor propertyDescriptor) - Specified by:
removeReferencein interfaceControllerServiceNode
-
verifyModifiable
- Specified by:
verifyModifiablein classAbstractComponentNode- Throws:
IllegalStateException
-
verifyCanDelete
public void verifyCanDelete()- Specified by:
verifyCanDeletein interfaceControllerServiceNode
-
verifyCanDisable
public void verifyCanDisable()- Specified by:
verifyCanDisablein interfaceControllerServiceNode
-
verifyCanDisable
- Specified by:
verifyCanDisablein interfaceControllerServiceNode
-
verifyCanEnable
public void verifyCanEnable()- Specified by:
verifyCanEnablein interfaceControllerServiceNode
-
verifyCanEnable
- Specified by:
verifyCanEnablein interfaceControllerServiceNode
-
verifyCanUpdate
public void verifyCanUpdate()- Specified by:
verifyCanUpdatein interfaceControllerServiceNode
-
verifyCanClearState
public void verifyCanClearState()- Specified by:
verifyCanClearStatein interfaceControllerServiceNode
-
getComments
- Specified by:
getCommentsin interfaceControllerServiceNode
-
setComments
- Specified by:
setCommentsin interfaceControllerServiceNode
-
getState
- Specified by:
getStatein interfaceControllerServiceNode
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceControllerServiceNode
-
awaitEnabled
- Specified by:
awaitEnabledin interfaceControllerServiceNode- Throws:
InterruptedException
-
awaitDisabled
- Specified by:
awaitDisabledin interfaceControllerServiceNode- Throws:
InterruptedException
-
verifyCanPerformVerification
public void verifyCanPerformVerification()- Specified by:
verifyCanPerformVerificationin interfaceControllerServiceNode
-
verifyConfiguration
public List<ConfigVerificationResult> verifyConfiguration(ConfigurationContext context, ComponentLog logger, Map<String, String> variables, ExtensionManager extensionManager) - Specified by:
verifyConfigurationin interfaceControllerServiceNode
-
isValidationNecessary
public boolean isValidationNecessary()- Specified by:
isValidationNecessaryin interfaceComponentNode
-
performValidation
- Specified by:
performValidationin interfaceComponentNode- Overrides:
performValidationin classAbstractComponentNode
-
validateConfig
- Specified by:
validateConfigin classAbstractComponentNode
-
enable
public CompletableFuture<Void> enable(ScheduledExecutorService scheduler, long administrativeYieldMillis) Will atomically enable this service by invoking its @OnEnabled operation. It uses CAS operation onstateTransitionto transition this service from DISABLED to ENABLING state. If such transition succeeds the service will be marked as 'active' (seeControllerServiceNode.isActive()). If such transition doesn't succeed then no enabling logic will be performed and the method will exit. In other words it is safe to invoke this operation multiple times and from multiple threads.
This operation will also perform re-try of service enabling in the event of exception being thrown by previous invocation of @OnEnabled.
Upon successful invocation of @OnEnabled this service will be transitioned to ENABLED state.
In the event where enabling took longer then expected by the user and such user initiated disable operation, this service will be automatically disabled as soon as it reached ENABLED state.- Specified by:
enablein interfaceControllerServiceNode
-
disable
Will atomically disable this service by invoking its @OnDisabled operation. It uses CAS operation onstateTransitionto transition this service from ENABLED to DISABLING state. If such transition succeeds the service will be de-activated (seeControllerServiceNode.isActive()). If such transition doesn't succeed (the service is still in ENABLING state) then the service will still be transitioned to DISABLING state to ensure that no other transition could happen on this service. However in such event (e.g., its @OnEnabled finally succeeded), theenable(ScheduledExecutorService, long)operation will initiate service disabling javadoc for (seeenable(ScheduledExecutorService, long)
Upon successful invocation of @OnDisabled this service will be transitioned to DISABLED state.- Specified by:
disablein interfaceControllerServiceNode
-
invokeDisable
-
getProcessGroupIdentifier
- Specified by:
getProcessGroupIdentifierin interfaceComponentAuthorizable
-
getVersionedComponentId
- Specified by:
getVersionedComponentIdin interfaceVersionedComponent
-
setVersionedComponentId
- Specified by:
setVersionedComponentIdin interfaceVersionedComponent
-
toString
- Overrides:
toStringin classAbstractComponentNode
-
getParameterLookup
- Specified by:
getParameterLookupin interfaceComponentNode
-
getBulletinLevel
- Specified by:
getBulletinLevelin interfaceControllerServiceNode
-
setBulletinLevel
- Specified by:
setBulletinLevelin interfaceControllerServiceNode
-
notifyPrimaryNodeChanged
public void notifyPrimaryNodeChanged(org.apache.nifi.annotation.notification.PrimaryNodeState nodeState) - Specified by:
notifyPrimaryNodeChangedin interfaceControllerServiceNode
-
migrateConfiguration
public void migrateConfiguration(Map<String, String> originalPropertyValues, ControllerServiceFactory serviceFactory) - Specified by:
migrateConfigurationin interfaceControllerServiceNode
-
performFlowAnalysisOnThis
protected void performFlowAnalysisOnThis()- Overrides:
performFlowAnalysisOnThisin classAbstractComponentNode
-