@Deprecated @DeprecationNotice(alternatives=InvokeHTTP.class, reason="This processor is deprecated and may be removed in future releases.") @Tags(value={"get","fetch","poll","http","https","ingest","source","input"}) @InputRequirement(value=INPUT_FORBIDDEN) @CapabilityDescription(value="Please be aware this processor is deprecated and may be removed in the near future. Use InvokeHTTP instead. 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.") @DynamicProperties(value=@DynamicProperty(name="Header Name",value="The Expression Language to be used to populate the header value",expressionLanguageScope=VARIABLE_REGISTRY,description="The additional headers to be sent by the processor whenever making a new HTTP request. \n Setting a dynamic property name to XYZ and value to ${attribute} will result in the header \'XYZ: attribute_value\' being sent to the HTTP endpoint")) @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()
Deprecated.
|
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
equals, getPropertyDescriptor, getPropertyDescriptors, 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 String DEFAULT_COOKIE_POLICY_STR
public static final String STANDARD_COOKIE_POLICY_STR
public static final String STRICT_COOKIE_POLICY_STR
public static final String NETSCAPE_COOKIE_POLICY_STR
public static final String IGNORE_COOKIE_POLICY_STR
public static final AllowableValue DEFAULT_COOKIE_POLICY
public static final AllowableValue STANDARD_COOKIE_POLICY
public static final AllowableValue STRICT_COOKIE_POLICY
public static final AllowableValue NETSCAPE_COOKIE_POLICY
public static final AllowableValue IGNORE_COOKIE_POLICY
public static final PropertyDescriptor REDIRECT_COOKIE_POLICY
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 List<PropertyDescriptor> customHeaders
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
protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName)
getSupportedDynamicPropertyDescriptor
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 © 2020 Apache NiFi Project. All rights reserved.