Package org.apache.nifi.remote
Class StandardRemoteProcessGroup
java.lang.Object
org.apache.nifi.remote.StandardRemoteProcessGroup
- All Implemented Interfaces:
Authorizable,ComponentAuthorizable,VersionedComponent,Positionable,RemoteProcessGroup
Represents the Root Process Group of a remote NiFi Instance. Holds
information about that remote instance, as well as Incoming Ports and
Outgoing Ports for communicating with the remote instance.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate final ScheduledExecutorServiceprivate final AtomicReference<String> private Stringprivate final AtomicBooleanprivate RemoteProcessGroupCountsprivate Booleanprivate final EventReporterprivate static final intprivate final Stringprivate booleanprivate final Map<String, StandardRemoteGroupPort> private Integerprivate Integerprivate InetAddressprivate static final org.slf4j.Loggerprivate final AtomicReference<String> private Stringprivate ValidationResultprivate final Map<String, StandardRemoteGroupPort> private final AtomicReference<Position> private final AtomicReference<ProcessGroup> private Stringprivate Stringprivate Integerprivate Stringprivate final Lockprivate Longprivate final longprivate final ReadWriteLockprivate final ProcessSchedulerprivate final SSLContextprivate final StateManagerprivate Stringprivate Stringprivate final AtomicBooleanprivate SiteToSiteTransportProtocolprivate static final intprivate final AtomicReference<String> private final Lockprivate String -
Constructor Summary
ConstructorsConstructorDescriptionStandardRemoteProcessGroup(String id, String targetUris, ProcessGroup processGroup, ProcessScheduler processScheduler, BulletinRepository bulletinRepository, SSLContext sslContext, StateManager stateManager, long remoteContentsCacheExpirationMillis) -
Method Summary
Modifier and TypeMethodDescriptionprivate StandardRemoteGroupPortaddInputPort(RemoteProcessGroupPortDescriptor descriptor) Adds an InputPort to this ProcessGroup that is described by the given DTO.private StandardRemoteGroupPortaddOutputPort(RemoteProcessGroupPortDescriptor descriptor) Adds an Output Port to this Remote Process Group that is described by this DTO.booleanbooleanReturns a boolean indicating whether or not an Output Port exists with the given IDprivate Set<RemoteProcessGroupPortDescriptor> convertRemotePort(Set<PortDTO> ports) Converts a set of ports into a set of remote process group ports.private StringgeneratePortId(String targetId) intgetCommunicationsTimeout(TimeUnit timeUnit) getInputPort(String portIdentifier) intgetName()getOutputPort(String portIdentifier) intprivate SiteToSiteRestApiClientvoidbooleanprivate booleanReturns true if the exception indicates the root cause is a connection timeout error.booleanisSecure()booleanbooleanvoidonRemove()voidvoidreinitialize(boolean isClustered) voidShuts down and removes the given portvoidsetComments(String comments) voidsetCommunicationsTimeout(String timePeriod) private voidsetCounts(RemoteProcessGroupCounts counts) voidsetInputPorts(Set<RemoteProcessGroupPortDescriptor> ports, boolean pruneUnusedPorts) Changes the currently configured input ports to the ports described in the given set.voidvoidsetNetworkInterface(String interfaceName) voidsetOutputPorts(Set<RemoteProcessGroupPortDescriptor> ports, boolean pruneUnusedPorts) Changes the currently configured output ports to the ports described in the given set.voidsetPosition(Position position) voidsetProcessGroup(ProcessGroup group) voidsetProxyHost(String proxyHost) voidsetProxyPassword(String proxyPassword) voidsetProxyPort(Integer proxyPort) voidsetProxyUser(String proxyUser) voidsetTargetId(String targetId) voidsetTargetUris(String targetUris) voidsetTransportProtocol(SiteToSiteTransportProtocol transportProtocol) voidsetVersionedComponentId(String versionedComponentId) voidsetYieldDuration(String yieldDuration) voidshutdown()voidvoidFuture<?> voidtoString()validate()voidvoidverifyCanDelete(boolean ignoreConnections) voidvoidvoidprivate voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.authorization.resource.Authorizable
authorize, authorize, checkAuthorization, checkAuthorization, getRequestedResource, isAuthorized
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
UNAUTHORIZED_STATUS_CODE
private static final int UNAUTHORIZED_STATUS_CODE -
FORBIDDEN_STATUS_CODE
private static final int FORBIDDEN_STATUS_CODE -
id
-
targetUris
-
scheduler
-
eventReporter
-
stateManager
-
remoteContentsCacheExpiration
private final long remoteContentsCacheExpiration -
initialized
private volatile boolean initialized -
name
-
position
-
comments
-
processGroup
-
transmitting
-
configuredToTransmit
-
versionedComponentId
-
sslContext
-
communicationsTimeout
-
targetId
-
yieldDuration
-
transportProtocol
-
proxyHost
-
proxyPort
-
proxyUser
-
proxyPassword
-
networkInterfaceName
-
localAddress
-
nicValidationResult
-
rwLock
-
readLock
-
writeLock
-
inputPorts
-
outputPorts
-
counts
-
refreshContentsTimestamp
-
destinationSecure
-
listeningPort
-
listeningHttpPort
-
authorizationIssue
-
backgroundThreadExecutor
-
-
Constructor Details
-
StandardRemoteProcessGroup
public StandardRemoteProcessGroup(String id, String targetUris, ProcessGroup processGroup, ProcessScheduler processScheduler, BulletinRepository bulletinRepository, SSLContext sslContext, StateManager stateManager, long remoteContentsCacheExpirationMillis)
-
-
Method Details
-
initialize
public void initialize()- Specified by:
initializein interfaceRemoteProcessGroup
-
isConnectionTimeoutError
Returns true if the exception indicates the root cause is a connection timeout error.- Parameters:
e- the exception thrown connecting to the remote instance- Returns:
- true if the error is due to a connection timeout
-
setTargetUris
- Specified by:
setTargetUrisin interfaceRemoteProcessGroup
-
reinitialize
public void reinitialize(boolean isClustered) - Specified by:
reinitializein interfaceRemoteProcessGroup
-
onRemove
public void onRemove()- Specified by:
onRemovein interfaceRemoteProcessGroup
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceRemoteProcessGroup
-
getIdentifier
- Specified by:
getIdentifierin interfaceComponentAuthorizable- Specified by:
getIdentifierin interfaceRemoteProcessGroup
-
getProcessGroupIdentifier
- Specified by:
getProcessGroupIdentifierin interfaceComponentAuthorizable
-
getParentAuthorizable
- Specified by:
getParentAuthorizablein interfaceAuthorizable
-
getResource
- Specified by:
getResourcein interfaceAuthorizable
-
getProcessGroup
- Specified by:
getProcessGroupin interfaceRemoteProcessGroup
-
setProcessGroup
- Specified by:
setProcessGroupin interfaceRemoteProcessGroup
-
setTargetId
-
setTransportProtocol
- Specified by:
setTransportProtocolin interfaceRemoteProcessGroup
-
getTransportProtocol
- Specified by:
getTransportProtocolin interfaceRemoteProcessGroup
-
getProxyHost
- Specified by:
getProxyHostin interfaceRemoteProcessGroup
-
setProxyHost
- Specified by:
setProxyHostin interfaceRemoteProcessGroup
-
getProxyPort
- Specified by:
getProxyPortin interfaceRemoteProcessGroup
-
setProxyPort
- Specified by:
setProxyPortin interfaceRemoteProcessGroup
-
getProxyUser
- Specified by:
getProxyUserin interfaceRemoteProcessGroup
-
setProxyUser
- Specified by:
setProxyUserin interfaceRemoteProcessGroup
-
getProxyPassword
- Specified by:
getProxyPasswordin interfaceRemoteProcessGroup
-
setProxyPassword
- Specified by:
setProxyPasswordin interfaceRemoteProcessGroup
-
getTargetId
- Returns:
- the ID of the Root Group on the remote instance
-
getName
- Specified by:
getNamein interfaceRemoteProcessGroup
-
setName
- Specified by:
setNamein interfaceRemoteProcessGroup
-
getCommunicationsTimeout
- Specified by:
getCommunicationsTimeoutin interfaceRemoteProcessGroup
-
setCommunicationsTimeout
- Specified by:
setCommunicationsTimeoutin interfaceRemoteProcessGroup- Throws:
IllegalArgumentException
-
getCommunicationsTimeout
- Specified by:
getCommunicationsTimeoutin interfaceRemoteProcessGroup
-
getComments
- Specified by:
getCommentsin interfaceRemoteProcessGroup
-
setComments
- Specified by:
setCommentsin interfaceRemoteProcessGroup
-
getPosition
- Specified by:
getPositionin interfacePositionable
-
setPosition
- Specified by:
setPositionin interfacePositionable
-
getTargetUri
- Specified by:
getTargetUriin interfaceRemoteProcessGroup
-
getTargetUris
- Specified by:
getTargetUrisin interfaceRemoteProcessGroup
-
getAuthorizationIssue
- Specified by:
getAuthorizationIssuein interfaceRemoteProcessGroup
-
validate
- Specified by:
validatein interfaceRemoteProcessGroup
-
getInputPortCount
public int getInputPortCount() -
getOutputPortCount
public int getOutputPortCount() -
containsInputPort
-
setInputPorts
Changes the currently configured input ports to the ports described in the given set. If any port is currently configured that is not in the set given, that port will be shutdown and removed. If any port is currently not configured and is in the set given, that port will be instantiated and started.- Specified by:
setInputPortsin interfaceRemoteProcessGroup- Parameters:
ports- the new portspruneUnusedPorts- if true, any ports that are not included in the given set of ports and that do not have any incoming connections will be removed.- Throws:
NullPointerException- if the given argument is null
-
containsOutputPort
Returns a boolean indicating whether or not an Output Port exists with the given ID- Parameters:
id- identifier of port- Returns:
trueif an Output Port exists with the given ID,falseotherwise.
-
setOutputPorts
Changes the currently configured output ports to the ports described in the given set. If any port is currently configured that is not in the set given, that port will be shutdown and removed. If any port is currently not configured and is in the set given, that port will be instantiated and started.- Specified by:
setOutputPortsin interfaceRemoteProcessGroup- Parameters:
ports- the new portspruneUnusedPorts- if true, will remove any ports that are not in the given list and that have no outgoing connections- Throws:
NullPointerException- if the given argument is null
-
removeNonExistentPort
Shuts down and removes the given port- Specified by:
removeNonExistentPortin interfaceRemoteProcessGroup- Throws:
NullPointerException- if the given output Port is nullIllegalStateException- if the port does not belong to this remote process group
-
addOutputPort
Adds an Output Port to this Remote Process Group that is described by this DTO.- Parameters:
descriptor- the RPG port descriptor- Throws:
IllegalStateException- if an Output Port already exists with the ID given by dto.getId()
-
getInputPort
- Specified by:
getInputPortin interfaceRemoteProcessGroup- Parameters:
portIdentifier- the ID of the Port to send FlowFiles to- Returns:
RemoteGroupPortthat can be used to send FlowFiles to the port whose ID is given on the remote instance
-
getInputPorts
- Specified by:
getInputPortsin interfaceRemoteProcessGroup- Returns:
- a set of Outgoing Ports used for transmitting FlowFiles to the remote instance
-
addInputPort
Adds an InputPort to this ProcessGroup that is described by the given DTO.- Parameters:
descriptor- port descriptor- Throws:
IllegalStateException- if an Input Port already exists with the ID given by the ID of the DTO.
-
generatePortId
-
getOutputPort
- Specified by:
getOutputPortin interfaceRemoteProcessGroup
-
getOutputPorts
- Specified by:
getOutputPortsin interfaceRemoteProcessGroup- Returns:
- a set of
RemoteGroupPorts used for receiving FlowFiles from the remote instance
-
toString
-
getCounts
- Specified by:
getCountsin interfaceRemoteProcessGroup
-
setCounts
-
getLastRefreshTime
- Specified by:
getLastRefreshTimein interfaceRemoteProcessGroup
-
refreshFlowContents
- Specified by:
refreshFlowContentsin interfaceRemoteProcessGroup- Throws:
CommunicationsException
-
getNetworkInterface
- Specified by:
getNetworkInterfacein interfaceRemoteProcessGroup
-
setNetworkInterface
- Specified by:
setNetworkInterfacein interfaceRemoteProcessGroup
-
getLocalAddress
- Specified by:
getLocalAddressin interfaceRemoteProcessGroup
-
getSiteToSiteRestApiClient
-
convertRemotePort
Converts a set of ports into a set of remote process group ports.- Parameters:
ports- to convert- Returns:
- descriptors of ports
-
isTransmitting
public boolean isTransmitting()- Specified by:
isTransmittingin interfaceRemoteProcessGroup
-
isConfiguredToTransmit
public boolean isConfiguredToTransmit()- Specified by:
isConfiguredToTransmitin interfaceRemoteProcessGroup
-
startTransmitting
public void startTransmitting()- Specified by:
startTransmittingin interfaceRemoteProcessGroup
-
startTransmitting
- Specified by:
startTransmittingin interfaceRemoteProcessGroup
-
stopTransmitting
- Specified by:
stopTransmittingin interfaceRemoteProcessGroup
-
waitForPortShutdown
private void waitForPortShutdown() -
stopTransmitting
- Specified by:
stopTransmittingin interfaceRemoteProcessGroup
-
isSecure
- Specified by:
isSecurein interfaceRemoteProcessGroup- Throws:
CommunicationsException
-
getSecureFlag
- Specified by:
getSecureFlagin interfaceRemoteProcessGroup
-
isSiteToSiteEnabled
public boolean isSiteToSiteEnabled()- Specified by:
isSiteToSiteEnabledin interfaceRemoteProcessGroup
-
getEventReporter
- Specified by:
getEventReporterin interfaceRemoteProcessGroup
-
setYieldDuration
- Specified by:
setYieldDurationin interfaceRemoteProcessGroup
-
getYieldDuration
- Specified by:
getYieldDurationin interfaceRemoteProcessGroup
-
verifyCanDelete
public void verifyCanDelete()- Specified by:
verifyCanDeletein interfaceRemoteProcessGroup
-
verifyCanDelete
public void verifyCanDelete(boolean ignoreConnections) - Specified by:
verifyCanDeletein interfaceRemoteProcessGroup
-
verifyCanStartTransmitting
public void verifyCanStartTransmitting()- Specified by:
verifyCanStartTransmittingin interfaceRemoteProcessGroup
-
verifyCanStopTransmitting
public void verifyCanStopTransmitting()- Specified by:
verifyCanStopTransmittingin interfaceRemoteProcessGroup
-
verifyCanUpdate
public void verifyCanUpdate()- Specified by:
verifyCanUpdatein interfaceRemoteProcessGroup
-
getVersionedComponentId
- Specified by:
getVersionedComponentIdin interfaceVersionedComponent
-
setVersionedComponentId
- Specified by:
setVersionedComponentIdin interfaceVersionedComponent
-
getStateManager
- Specified by:
getStateManagerin interfaceRemoteProcessGroup
-