Class AbstractAWSGatewayApiProcessor
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.aws.AbstractAWSCredentialsProviderProcessor<GenericApiGatewayClient>
org.apache.nifi.processors.aws.wag.AbstractAWSGatewayApiProcessor
- All Implemented Interfaces:
ConfigurableComponent,Processor,VerifiableProcessor
public abstract class AbstractAWSGatewayApiProcessor
extends AbstractAWSCredentialsProviderProcessor<GenericApiGatewayClient>
This class is the base class for invoking aws gateway api endpoints
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final PropertyDescriptorstatic final PropertyDescriptorstatic final PropertyDescriptorstatic final PropertyDescriptorstatic final PropertyDescriptorstatic final PropertyDescriptorstatic final PropertyDescriptorstatic final PropertyDescriptorstatic final PropertyDescriptorstatic final PropertyDescriptorstatic final PropertyDescriptorstatic final PropertyDescriptorstatic final PropertyDescriptorprivate com.amazonaws.http.AmazonHttpClientprivate Patternprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.apache.nifi.processors.aws.AbstractAWSCredentialsProviderProcessor
AWS_CREDENTIALS_PROVIDER_SERVICE, ENDPOINT_OVERRIDE, PROXY_CONFIGURATION_SERVICE, REGION, REL_FAILURE, REL_SUCCESS, relationships, SSL_CONTEXT_SERVICE, TIMEOUT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected GenericApiGatewayRequestconfigureRequest(ProcessContext context, ProcessSession session, String resourcePath, FlowFile requestFlowFile, com.amazonaws.http.HttpMethodName methodName, Map<String, String> attributes) protected GenericApiGatewayRequestconfigureRequest(ProcessContext context, ProcessSession session, String resourcePath, FlowFile requestFlowFile, Map<String, String> attributes) convertAttributesFromHeaders(GenericApiGatewayResponse responseHttp) Returns a Map of flowfile attributes from the response http headers.protected GenericApiGatewayClientcreateClient(ProcessContext context, com.amazonaws.auth.AWSCredentialsProvider credentialsProvider, com.amazonaws.regions.Region region, com.amazonaws.ClientConfiguration config, com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration endpointConfiguration) Abstract method to create AWS client using credentials provider.protected Collection<ValidationResult> customValidate(ValidationContext validationContext) protected StringgetLogString(Map<String, ?> map) getParameters(ProcessContext context, Map<String, String> flowFileAttributes) Returns a map of Query Parameter Name to Valuesprotected RelationshipgetRelationshipForName(String name, Set<Relationship> relationships) protected InputStreamgetRequestBodyToSend(ProcessSession session, ProcessContext context, FlowFile requestFlowFile) protected PropertyDescriptorgetSupportedDynamicPropertyDescriptor(String propertyDescriptorName) protected booleanisSuccess(int statusCode) protected voidlogRequest(ComponentLog logger, URI endpoint, GenericApiGatewayRequest request) protected voidlogResponse(ComponentLog logger, GenericApiGatewayResponse response) voidonPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue) protected voidroute(FlowFile request, FlowFile response, ProcessSession session, ProcessContext context, int statusCode, Set<Relationship> relationships) protected GenericApiGatewayRequestBuildersetHeaderProperties(ProcessContext context, GenericApiGatewayRequestBuilder requestBuilder, com.amazonaws.http.HttpMethodName methodName, Map<String, String> requestAttributes) Methods inherited from class org.apache.nifi.processors.aws.AbstractAWSCredentialsProviderProcessor
createAllowableValue, createClient, createClient, createConfiguration, createConfiguration, getAvailableRegions, getClient, getClient, getCredentialsProvider, getEndpointConfiguration, getRegion, getRelationships, migrateProperties, onScheduled, onStopped, verifyMethods inherited from class org.apache.nifi.processor.AbstractProcessor
onTrigger, 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, getSupportedPropertyDescriptors, 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
-
dynamicPropertyNames
-
regexAttributesToSend
-
providedClient
private volatile com.amazonaws.http.AmazonHttpClient providedClient -
STATUS_CODE
- See Also:
-
STATUS_MESSAGE
- See Also:
-
RESPONSE_BODY
- See Also:
-
RESOURCE_NAME_ATTR
- See Also:
-
ENDPOINT_ATTR
- See Also:
-
TRANSACTION_ID
- See Also:
-
EXCEPTION_CLASS
- See Also:
-
EXCEPTION_MESSAGE
- See Also:
-
REL_RESPONSE_NAME
- See Also:
-
REL_SUCCESS_REQ_NAME
- See Also:
-
REL_RETRY_NAME
- See Also:
-
REL_NO_RETRY_NAME
- See Also:
-
REL_FAILURE_NAME
- See Also:
-
DEFAULT_CONTENT_TYPE
- See Also:
-
IGNORED_ATTRIBUTES
-
PROP_METHOD
-
PROP_AWS_API_KEY
-
PROP_AWS_GATEWAY_API_ENDPOINT
-
PROP_RESOURCE_NAME
-
PROP_QUERY_PARAMS
-
PROP_ATTRIBUTES_TO_SEND
-
PROP_PUT_OUTPUT_IN_ATTRIBUTE
-
PROP_OUTPUT_RESPONSE_REGARDLESS
-
PROP_PENALIZE_NO_RETRY
-
PROP_PUT_ATTRIBUTE_MAX_LENGTH
-
PROP_CONTENT_TYPE
-
PROP_SEND_BODY
-
PROP_ADD_HEADERS_TO_REQUEST
-
-
Constructor Details
-
AbstractAWSGatewayApiProcessor
public AbstractAWSGatewayApiProcessor() -
AbstractAWSGatewayApiProcessor
public AbstractAWSGatewayApiProcessor(com.amazonaws.http.AmazonHttpClient client)
-
-
Method Details
-
getSupportedDynamicPropertyDescriptor
- Overrides:
getSupportedDynamicPropertyDescriptorin classAbstractConfigurableComponent
-
onPropertyModified
- Specified by:
onPropertyModifiedin interfaceConfigurableComponent- Overrides:
onPropertyModifiedin classAbstractConfigurableComponent
-
customValidate
- Overrides:
customValidatein classAbstractConfigurableComponent
-
createClient
protected GenericApiGatewayClient createClient(ProcessContext context, com.amazonaws.auth.AWSCredentialsProvider credentialsProvider, com.amazonaws.regions.Region region, com.amazonaws.ClientConfiguration config, com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration endpointConfiguration) Description copied from class:AbstractAWSCredentialsProviderProcessorAbstract method to create AWS client using credentials provider. This is the preferred method for creating AWS clients- Specified by:
createClientin classAbstractAWSCredentialsProviderProcessor<GenericApiGatewayClient>- Parameters:
context- process contextcredentialsProvider- AWS credentials providerconfig- AWS client configuration- Returns:
- ClientType the client
-
configureRequest
protected GenericApiGatewayRequest configureRequest(ProcessContext context, ProcessSession session, String resourcePath, FlowFile requestFlowFile, Map<String, String> attributes) -
configureRequest
protected GenericApiGatewayRequest configureRequest(ProcessContext context, ProcessSession session, String resourcePath, FlowFile requestFlowFile, com.amazonaws.http.HttpMethodName methodName, Map<String, String> attributes) -
getRequestBodyToSend
protected InputStream getRequestBodyToSend(ProcessSession session, ProcessContext context, FlowFile requestFlowFile) -
setHeaderProperties
protected GenericApiGatewayRequestBuilder setHeaderProperties(ProcessContext context, GenericApiGatewayRequestBuilder requestBuilder, com.amazonaws.http.HttpMethodName methodName, Map<String, String> requestAttributes) -
getParameters
protected Map<String,List<String>> getParameters(ProcessContext context, Map<String, String> flowFileAttributes) Returns a map of Query Parameter Name to Values- Parameters:
context- ProcessContextflowFileAttributes- map of FlowFile attributes used for EL evaluation- Returns:
- Map of names and values
-
convertAttributesFromHeaders
Returns a Map of flowfile attributes from the response http headers. Multivalue headers are naively converted to comma separated strings. -
getRelationshipForName
-
route
protected void route(FlowFile request, FlowFile response, ProcessSession session, ProcessContext context, int statusCode, Set<Relationship> relationships) -
isSuccess
protected boolean isSuccess(int statusCode) -
logRequest
-
logResponse
-
getLogString
-