From 3b33d41cc3c98ea3d48afe28e4f5b679c2a8e6e7 Mon Sep 17 00:00:00 2001 From: danbress Date: Wed, 18 Mar 2015 16:37:11 -0400 Subject: [PATCH] NIFI-309 cleaning up HandleHttpRequest/HandleHttpResponse docs --- .../standard/HandleHttpRequest.java | 19 ++++ .../standard/HandleHttpResponse.java | 4 + .../additionalDetails.html | 86 +------------------ .../additionalDetails.html | 13 --- 4 files changed, 24 insertions(+), 98 deletions(-) diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java index 4386100515..37c504ad2f 100644 --- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java +++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java @@ -45,7 +45,10 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; import org.apache.nifi.annotation.documentation.CapabilityDescription; +import org.apache.nifi.annotation.documentation.SeeAlso; import org.apache.nifi.annotation.documentation.Tags; +import org.apache.nifi.annotation.documentation.WritesAttribute; +import org.apache.nifi.annotation.documentation.WritesAttributes; import org.apache.nifi.annotation.lifecycle.OnScheduled; import org.apache.nifi.annotation.lifecycle.OnStopped; import org.apache.nifi.components.AllowableValue; @@ -74,6 +77,22 @@ import com.sun.jersey.api.client.ClientResponse.Status; @Tags({"http", "https", "request", "listen", "ingress", "web service"}) @CapabilityDescription("Starts an HTTP Server and listens for HTTP Requests. For each request, creates a FlowFile and transfers to 'success'. This Processor is designed to be used in conjunction with the HandleHttpResponse Processor in order to create a Web Service") +@WritesAttributes({@WritesAttribute(attribute = "http.context.identifier", description="An identifier that allows the HandleHttpRequest and HandleHttpResponse to coordinate which FlowFile belongs to which HTTP Request/Response."), + @WritesAttribute(attribute = "mime.type", description="The MIME Type of the data, according to the HTTP Header \"Content-Type\""), + @WritesAttribute(attribute = "http.servlet.path", description="The part of the request URL that is considered the Servlet Path"), + @WritesAttribute(attribute = "http.context.path", description="The part of the request URL that is considered to be the Context Path"), + @WritesAttribute(attribute = "http.method", description="The HTTP Method that was used for the request, such as GET or POST"), + @WritesAttribute(attribute = "http.query.string", description="The query string portion of hte Request URL"), + @WritesAttribute(attribute = "http.remote.host", description="The hostname of the requestor"), + @WritesAttribute(attribute = "http.remote.addr", description="The hostname:port combination of the requestor"), + @WritesAttribute(attribute = "http.remote.user", description="The username of the requestor"), + @WritesAttribute(attribute = "http.request.uri", description="The full Request URL"), + @WritesAttribute(attribute = "http.auth.type", description="The type of HTTP Authorization used"), + @WritesAttribute(attribute = "http.principal.name", description="The name of the authenticated user making the request"), + @WritesAttribute(attribute = "http.subject.dn", description="The Distinguished Name of the requestor. This value will not be populated unless the Processor is configured to use an SSLContext Service"), + @WritesAttribute(attribute = "http.issuer.dn", description="The Distinguished Name of the entity that issued the Subject's certificate. This value will not be populated unless the Processor is configured to use an SSLContext Service"), + @WritesAttribute(attribute = "http.headers.XXX", description="Each of the HTTP Headers that is received in the request will be added as an attribute, prefixed with \"http.headers.\" For example, if the request contains an HTTP Header named \"x-my-header\", then the value will be added to an attribute named \"http.headers.x-my-header\"")}) +@SeeAlso(value={HandleHttpResponse.class}, classNames={"org.apache.nifi.http.StandardHttpContextMap", "org.apache.nifi.ssl.StandardSSLContextService"}) public class HandleHttpRequest extends AbstractProcessor { public static final String HTTP_CONTEXT_ID = "http.context.identifier"; private static final Pattern URL_QUERY_PARAM_DELIMITER = Pattern.compile("&"); diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpResponse.java b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpResponse.java index 9c7cfaf36f..cd0aebc5df 100644 --- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpResponse.java +++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpResponse.java @@ -28,6 +28,8 @@ import javax.servlet.http.HttpServletResponse; import org.apache.nifi.annotation.behavior.DynamicProperty; import org.apache.nifi.annotation.documentation.CapabilityDescription; +import org.apache.nifi.annotation.documentation.ReadsAttribute; +import org.apache.nifi.annotation.documentation.SeeAlso; import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; @@ -42,6 +44,8 @@ import org.apache.nifi.processor.util.StandardValidators; @Tags({"http", "https", "response", "egress", "web service"}) @CapabilityDescription("Sends an HTTP Response to the Requestor that generated a FlowFile. This Processor is designed to be used in conjunction with the HandleHttpRequest in order to create a web service.") @DynamicProperty(name="An HTTP header name", value="An HTTP header value", description="These HTTPHeaders are set in the HTTP Response") +@ReadsAttribute(attribute="http.context.identifier", description="The value of this attribute is used to lookup the HTTP Response so that the proper message can be sent back to the requestor. If this attribute is missing, the FlowFile will be routed to 'failure.'") +@SeeAlso(value={HandleHttpRequest.class}, classNames={"org.apache.nifi.http.StandardHttpContextMap", "org.apache.nifi.ssl.StandardSSLContextService"}) public class HandleHttpResponse extends AbstractProcessor { public static final Pattern NUMBER_PATTERN = Pattern.compile("[0-9]+"); public static final String HTTP_CONTEXT_ID = "http.context.identifier"; diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/resources/docs/org.apache.nifi.processors.standard.HandleHttpRequest/additionalDetails.html b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/resources/docs/org.apache.nifi.processors.standard.HandleHttpRequest/additionalDetails.html index 17378fb3cc..72aa1e1f1f 100644 --- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/resources/docs/org.apache.nifi.processors.standard.HandleHttpRequest/additionalDetails.html +++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/resources/docs/org.apache.nifi.processors.standard.HandleHttpRequest/additionalDetails.html @@ -37,91 +37,7 @@

The HandleHttpRequest Processor provides several Properties to configure which methods are supported, the paths that are - supported, and SSL configuration. The FlowFiles that are generated by this Processor have the following attributes added to - them, providing powerful routing capabilities and traceability of all data: + supported, and SSL configuration.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Attribute NameAttribute Description
http.context.identifierAn identifier that allows the HandleHttpRequest and HandleHttpResponse to coordinate which FlowFile belongs - to which HTTP Request/Response.
mime.typeThe MIME Type of the data, according to the HTTP Header "Content-Type"
http.servlet.pathThe part of the request URL that is considered the Servlet Path
http.context.pathThe part of the request URL that is considered to be the Context Path
http.methodThe HTTP Method that was used for the request, such as GET or POST
http.query.stringThe query string portion of hte Request URL
http.remote.hostThe hostname of the requestor
http.remote.addrThe hostname:port combination of the requestor
http.remote.userThe username of the requestor
http.request.uriThe full Request URL
http.auth.typeThe type of HTTP Authorization used
http.principal.nameThe name of the authenticated user making the request
http.subject.dnThe Distinguished Name of the requestor. This value will not be populated unless the Processor is - configured to use an SSLContext Service
http.issuer.dnThe Distinguished Name of the entity that issued the Subject's certificate. This value will not be - populated unless the Processor is configured to use an SSLContext Service
http.headers.XXXEach of the HTTP Headers that is received in the request will be added as an attribute, prefixed - with "http.headers." For example, if the request contains an HTTP Header named "x-my-header", - then the value will be added to an attribute named "http.headers.x-my-header"
-

- See Also:
- HandleHttpResponse
- StandardHttpContextMap
- StandardSSLContextService
-

- diff --git a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/resources/docs/org.apache.nifi.processors.standard.HandleHttpResponse/additionalDetails.html b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/resources/docs/org.apache.nifi.processors.standard.HandleHttpResponse/additionalDetails.html index 5d8993e6c7..1924101427 100644 --- a/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/resources/docs/org.apache.nifi.processors.standard.HandleHttpResponse/additionalDetails.html +++ b/nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/resources/docs/org.apache.nifi.processors.standard.HandleHttpResponse/additionalDetails.html @@ -40,18 +40,5 @@ This Processor must be configured with the same <HTTP Context Map> service as the corresponding HandleHttpRequest Processor. Otherwise, all FlowFiles will be routed to the 'failure' relationship.

- -

- All FlowFiles must have an attribute named http.context.identifier. The value of this attribute is used to lookup - the HTTP Response so that the proper message can be sent back to the requestor. If this attribute is missing, the FlowFile - will be routed to 'failure.' -

-

- See Also:
- HandleHttpRequest
- StandardHttpContextMap
- StandardSSLContextService
-

-