@Tags(value={"get","fetch","poll","http","https","ingest","source","input"}) @InputRequirement(value=INPUT_FORBIDDEN) @CapabilityDescription(value="Fetches data from an HTTP or HTTPS URL and writes the data to the content of a FlowFile. Once the content has been fetched, the ETag and Last Modified dates are remembered (if the web server supports these concepts). This allows the Processor to fetch new data only if the remote data has changed or until the state is cleared. That is, once the content has been fetched from the given URL, it will not be fetched again until the content on the remote server changes. Note that due to limitations on state management, stored \"last modified\" and etag fields never expire. If the URL in GetHttp uses Expression Language that is unbounded, there is the potential for Out of Memory Errors to occur.") @WritesAttribute(attribute="filename",description="The filename is set to the name of the file on the remote server") @WritesAttribute(attribute="mime.type",description="The MIME Type of the FlowFile, as reported by the HTTP Content-Type header") @Stateful(scopes=LOCAL, description="Stores Last Modified Time and ETag headers returned by server so that the same data will not be fetched multiple times.") public class GetHTTP extends AbstractSessionFactoryProcessor
Constructor and Description |
---|
GetHTTP() |
Modifier and Type | Method and Description |
---|---|
private SSLContext |
createSSLContext(SSLContextService service) |
protected Collection<ValidationResult> |
customValidate(ValidationContext context) |
Set<Relationship> |
getRelationships() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
protected void |
init(ProcessorInitializationContext context) |
void |
onPropertyModified(PropertyDescriptor descriptor,
String oldValue,
String newValue) |
void |
onScheduled(ProcessContext context) |
void |
onTrigger(ProcessContext context,
ProcessSessionFactory sessionFactory) |
protected static Tuple<String,String> |
parseStateValue(String mapValue) |
private void |
updateStateMap(ProcessContext context,
org.apache.http.HttpResponse response,
StateMap beforeStateMap,
String url) |
getControllerServiceLookup, getIdentifier, getLogger, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, validate
static final int PERSISTENCE_INTERVAL_MSEC
public static final String HEADER_IF_NONE_MATCH
public static final String HEADER_IF_MODIFIED_SINCE
public static final String HEADER_ACCEPT
public static final String HEADER_LAST_MODIFIED
public static final String HEADER_ETAG
public static final int NOT_MODIFIED
public static final PropertyDescriptor URL
public static final PropertyDescriptor FOLLOW_REDIRECTS
public static final PropertyDescriptor CONNECTION_TIMEOUT
public static final PropertyDescriptor ACCEPT_CONTENT_TYPE
public static final PropertyDescriptor DATA_TIMEOUT
public static final PropertyDescriptor FILENAME
public static final PropertyDescriptor USERNAME
public static final PropertyDescriptor PASSWORD
public static final PropertyDescriptor USER_AGENT
public static final PropertyDescriptor SSL_CONTEXT_SERVICE
public static final PropertyDescriptor PROXY_HOST
public static final PropertyDescriptor PROXY_PORT
public static final Relationship REL_SUCCESS
public static final String LAST_MODIFIED_DATE_PATTERN_RFC1123
static final String ETAG
static final String LAST_MODIFIED
private Set<Relationship> relationships
private List<PropertyDescriptor> properties
private final AtomicBoolean clearState
protected void init(ProcessorInitializationContext context)
init
in class AbstractSessionFactoryProcessor
public Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
public void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue)
onPropertyModified
in interface ConfigurableComponent
onPropertyModified
in class AbstractConfigurableComponent
@OnScheduled public void onScheduled(ProcessContext context) throws IOException
IOException
protected Collection<ValidationResult> customValidate(ValidationContext context)
customValidate
in class AbstractConfigurableComponent
private SSLContext createSSLContext(SSLContextService service) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, KeyManagementException, UnrecoverableKeyException
public void onTrigger(ProcessContext context, ProcessSessionFactory sessionFactory) throws ProcessException
ProcessException
private void updateStateMap(ProcessContext context, org.apache.http.HttpResponse response, StateMap beforeStateMap, String url)
Copyright © 2016 Apache NiFi Project. All rights reserved.