Class ListSFTP
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processor.util.list.AbstractListProcessor<FileInfo>
org.apache.nifi.processor.util.file.transfer.ListFileTransfer
org.apache.nifi.processors.standard.ListSFTP
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor,org.apache.nifi.processor.VerifiableProcessor
@PrimaryNodeOnly
@TriggerSerially
@InputRequirement(INPUT_FORBIDDEN)
@Tags({"list","sftp","remote","ingest","source","input","files"})
@CapabilityDescription("Performs a listing of the files residing on an SFTP server. For each file that is found on the remote server, a new FlowFile will be created with the filename attribute set to the name of the file on the remote server. This can then be used in conjunction with FetchSFTP in order to fetch those files.")
@SeeAlso({FetchSFTP.class,GetSFTP.class,PutSFTP.class})
@WritesAttribute(attribute="sftp.remote.host",description="The hostname of the SFTP Server") @WritesAttribute(attribute="sftp.remote.port",description="The port that was connected to on the SFTP Server") @WritesAttribute(attribute="sftp.listing.user",description="The username of the user that performed the SFTP Listing") @WritesAttribute(attribute="file.owner",description="The numeric owner id of the source file") @WritesAttribute(attribute="file.group",description="The numeric group id of the source file") @WritesAttribute(attribute="file.permissions",description="The read/write/execute permissions of the source file") @WritesAttribute(attribute="file.size",description="The number of bytes in the source file") @WritesAttribute(attribute="file.lastModifiedTime",description="The timestamp of when the file in the filesystem waslast modified as \'yyyy-MM-dd\'T\'HH:mm:ssZ\'") @WritesAttribute(attribute="filename",description="The name of the file on the SFTP Server") @WritesAttribute(attribute="path",description="The fully qualified name of the directory on the SFTP Server from which the file was pulled") @WritesAttribute(attribute="mime.type",description="The MIME Type that is provided by the configured Record Writer")
@Stateful(scopes=CLUSTER,
description="After performing a listing of files, the timestamp of the newest file is stored. This allows the Processor to list only files that have been added or modified after this date the next time that the Processor is run. State is stored across the cluster so that this Processor can be run on Primary Node only and if a new Primary Node is selected, the new node will not duplicate the data that was listed by the previous Primary Node.")
@DefaultSchedule(strategy=TIMER_DRIVEN,
period="1 min")
public class ListSFTP
extends ListFileTransfer
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.nifi.processor.util.list.AbstractListProcessor
AbstractListProcessor.ListingMode -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final List<org.apache.nifi.components.PropertyDescriptor> Fields inherited from class org.apache.nifi.processor.util.file.transfer.ListFileTransfer
FILE_TRANSFER_LISTING_STRATEGY, HOSTNAME, REMOTE_PATH, UNDEFAULTED_PORT, USERNAMEFields inherited from class org.apache.nifi.processor.util.list.AbstractListProcessor
BY_ENTITIES, BY_TIME_WINDOW, BY_TIMESTAMPS, LISTING_LAG_MILLIS, LISTING_STRATEGY, NO_TRACKING, PRECISION_AUTO_DETECT, PRECISION_MILLIS, PRECISION_MINUTES, PRECISION_SECONDS, RECORD_WRITER, REL_SUCCESS, TARGET_SYSTEM_TIMESTAMP_PRECISION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateFileFilter(org.apache.nifi.processor.ProcessContext context) protected voidcustomValidate(org.apache.nifi.components.ValidationContext validationContext, Collection<org.apache.nifi.components.ValidationResult> results) protected FileTransfergetFileTransfer(org.apache.nifi.processor.ProcessContext context) protected Stringprotected org.apache.nifi.components.state.ScopegetStateScope(org.apache.nifi.context.PropertyContext context) protected List<org.apache.nifi.components.PropertyDescriptor> voidvoidonScheduled(org.apache.nifi.processor.ProcessContext context) performListing(org.apache.nifi.processor.ProcessContext context, Long minTimestamp, AbstractListProcessor.ListingMode listingMode, boolean applyFilters) Methods inherited from class org.apache.nifi.processor.util.file.transfer.ListFileTransfer
countUnfilteredListing, createAttributes, getListingContainerName, getPath, getRecordSchema, isListingResetNecessary, performListingMethods inherited from class org.apache.nifi.processor.util.list.AbstractListProcessor
createListedEntityTracker, customValidate, getCurrentNanoTime, getCurrentTime, getDefaultTimePrecision, getKey, getRelationships, initListedEntityTracker, listByNoTracking, listByTimeWindow, listByTrackingTimestamps, onPrimaryNodeChange, onPropertyModified, onTrigger, updateState, verifyMethods inherited from class org.apache.nifi.processor.AbstractProcessor
onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful, migrateRelationships
-
Field Details
-
PROPERTY_DESCRIPTORS
-
fileFilter
-
-
Constructor Details
-
ListSFTP
public ListSFTP()
-
-
Method Details
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classorg.apache.nifi.components.AbstractConfigurableComponent
-
migrateProperties
- Specified by:
migratePropertiesin interfaceorg.apache.nifi.processor.Processor- Overrides:
migratePropertiesin classAbstractListProcessor<FileInfo>
-
getFileTransfer
- Specified by:
getFileTransferin classListFileTransfer
-
getProtocolName
- Specified by:
getProtocolNamein classListFileTransfer
-
getStateScope
protected org.apache.nifi.components.state.Scope getStateScope(org.apache.nifi.context.PropertyContext context) - Specified by:
getStateScopein classAbstractListProcessor<FileInfo>
-
customValidate
protected void customValidate(org.apache.nifi.components.ValidationContext validationContext, Collection<org.apache.nifi.components.ValidationResult> results) - Overrides:
customValidatein classAbstractListProcessor<FileInfo>
-
performListing
protected List<FileInfo> performListing(org.apache.nifi.processor.ProcessContext context, Long minTimestamp, AbstractListProcessor.ListingMode listingMode, boolean applyFilters) throws IOException - Overrides:
performListingin classListFileTransfer- Throws:
IOException
-
onScheduled
@OnScheduled public void onScheduled(org.apache.nifi.processor.ProcessContext context) -
createFileFilter
-