@PrimaryNodeOnly @TriggerSerially @InputRequirement(value=INPUT_FORBIDDEN) @Tags(value={"list","sftp","remote","ingest","source","input","files"}) @CapabilityDescription(value="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(value={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") @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.") public class ListSFTP extends ListFileTransfer
Modifier and Type | Field and Description |
---|---|
private Predicate<FileInfo> |
fileFilter |
HOSTNAME, REMOTE_PATH, UNDEFAULTED_PORT, USERNAME
BY_ENTITIES, BY_TIMESTAMPS, DISTRIBUTED_CACHE_SERVICE, LISTING_LAG_MILLIS, LISTING_STRATEGY, PRECISION_AUTO_DETECT, PRECISION_MILLIS, PRECISION_MINUTES, PRECISION_SECONDS, RECORD_WRITER, REL_SUCCESS, TARGET_SYSTEM_TIMESTAMP_PRECISION
Constructor and Description |
---|
ListSFTP() |
Modifier and Type | Method and Description |
---|---|
private Predicate<FileInfo> |
createFileFilter(ProcessContext context) |
protected void |
customValidate(ValidationContext validationContext,
Collection<ValidationResult> results) |
protected FileTransfer |
getFileTransfer(ProcessContext context) |
protected String |
getProtocolName() |
protected Scope |
getStateScope(PropertyContext context) |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
void |
onScheduled(ProcessContext context) |
protected List<FileInfo> |
performListing(ProcessContext context,
Long minTimestamp) |
createAttributes, getPath, getRecordSchema, isListingResetNecessary
createListedEntityTracker, customValidate, getDefaultTimePrecision, getKey, getPersistenceFile, getRelationships, initListedEntityTracker, listByTrackingTimestamps, onPrimaryNodeChange, onPropertyModified, onTrigger, updateState
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, validate
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
protected FileTransfer getFileTransfer(ProcessContext context)
getFileTransfer
in class ListFileTransfer
protected String getProtocolName()
getProtocolName
in class ListFileTransfer
protected Scope getStateScope(PropertyContext context)
getStateScope
in class AbstractListProcessor<FileInfo>
protected void customValidate(ValidationContext validationContext, Collection<ValidationResult> results)
customValidate
in class AbstractListProcessor<FileInfo>
protected List<FileInfo> performListing(ProcessContext context, Long minTimestamp) throws IOException
performListing
in class ListFileTransfer
IOException
@OnScheduled public void onScheduled(ProcessContext context)
private Predicate<FileInfo> createFileFilter(ProcessContext context)
Copyright © 2020 Apache NiFi Project. All rights reserved.