Class HttpServletNetworkRequestEvent
- java.lang.Object
-
- software.amazon.disco.agent.event.AbstractEvent
-
- software.amazon.disco.agent.event.AbstractProtocolEvent
-
- software.amazon.disco.agent.event.AbstractProtocolRequestEvent
-
- software.amazon.disco.agent.event.AbstractNetworkProtocolRequestEvent
-
- software.amazon.disco.agent.event.HttpServletNetworkRequestEvent
-
- All Implemented Interfaces:
Event,HttpNetworkProtocolRequestEvent,NetworkProtocolEvent,NetworkProtocolRequestEvent,ProtocolEvent,ProtocolRequestEvent
public class HttpServletNetworkRequestEvent extends AbstractNetworkProtocolRequestEvent implements HttpNetworkProtocolRequestEvent
A concrete implementation of the HttpNetworkProtocolRequestEvent to express when an HTTP Servlet has been intercepted. This event occurs prior to the request being served.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface software.amazon.disco.agent.event.NetworkProtocolEvent
NetworkProtocolEvent.NetworkType
-
Nested classes/interfaces inherited from interface software.amazon.disco.agent.event.ProtocolEvent
ProtocolEvent.Type
-
-
Field Summary
-
Fields inherited from class software.amazon.disco.agent.event.AbstractEvent
data, origin
-
-
Constructor Summary
Constructors Constructor Description HttpServletNetworkRequestEvent(java.lang.String origin, int srcPort, int dstPort, java.lang.String srcIP, java.lang.String dstIP)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDate()Common HTTP metadata: return the date entry from the header.java.lang.StringgetHeaderData(java.lang.String key)Get the value of header information tied to this event.java.lang.StringgetHost()Common HTTP metadata: return the host entry from the header.java.lang.StringgetHTTPOrigin()Common HTTP metadata: return the origin entry from the header.java.lang.StringgetLocalIPAddress()Retrieve the IP address of the interface on which the request was received.java.lang.StringgetMethod()Get the http verb/method used from the incoming request.NetworkProtocolEvent.NetworkTypegetNetworkType()Get the network type of this ProtocolNetworkEventjava.lang.StringgetReferer()Common HTTP metadata: return the referer entry from the header.java.lang.StringgetRemoteIPAddress()Retrieve the IP address of the client that sent the request.java.lang.StringgetURL()Get the URL associated with the incoming requestjava.lang.StringgetUserAgent()Common HTTP metadata: return the user-agent entry from the header.HttpServletNetworkRequestEventwithDate(java.lang.String date)Common HTTP Metadata: Store the date into the header mapHttpServletNetworkRequestEventwithHeaderMap(java.util.Map<java.lang.String,java.lang.String> inputMap)Populate the contents of the inputMap into the header map.HttpServletNetworkRequestEventwithHost(java.lang.String host)Common HTTP Metadata: Store the host into the header mapHttpServletNetworkRequestEventwithHTTPOrigin(java.lang.String origin)Common HTTP Metadata: Store the origin into the header mapHttpServletNetworkRequestEventwithMethod(java.lang.String method)Store the HTTP method/verb into this eventHttpServletNetworkRequestEventwithReferer(java.lang.String referer)Common HTTP Metadata: Store the referer into the header mapHttpServletNetworkRequestEventwithRequest(java.lang.Object request)Store the literal HTTP request object into this event.HttpServletNetworkRequestEventwithURL(java.lang.String url)Store the HTTP URL from the incoming request into this event.HttpServletNetworkRequestEventwithUserAgent(java.lang.String userAgent)Common HTTP Metadata: Store the user-agent into the header map-
Methods inherited from class software.amazon.disco.agent.event.AbstractNetworkProtocolRequestEvent
getDestinationIP, getDestinationPort, getSourceIP, getSourcePort, getType
-
Methods inherited from class software.amazon.disco.agent.event.AbstractProtocolRequestEvent
getDestinationAddress, getRequest, getSourceAddress
-
Methods inherited from class software.amazon.disco.agent.event.AbstractProtocolEvent
getHeaderMap, withHeaderData
-
Methods inherited from class software.amazon.disco.agent.event.AbstractEvent
getData, getOrigin, withData
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface software.amazon.disco.agent.event.NetworkProtocolRequestEvent
getDestinationIP, getDestinationPort, getSourceIP, getSourcePort
-
Methods inherited from interface software.amazon.disco.agent.event.ProtocolEvent
getType
-
Methods inherited from interface software.amazon.disco.agent.event.ProtocolRequestEvent
getDestinationAddress, getRequest, getSourceAddress
-
-
-
-
Method Detail
-
withDate
public HttpServletNetworkRequestEvent withDate(java.lang.String date)
Common HTTP Metadata: Store the date into the header map- Parameters:
date- the date value- Returns:
- "This" for method chaining.
-
withHost
public HttpServletNetworkRequestEvent withHost(java.lang.String host)
Common HTTP Metadata: Store the host into the header map- Parameters:
host- the host value- Returns:
- "This" for method chaining.
-
withHTTPOrigin
public HttpServletNetworkRequestEvent withHTTPOrigin(java.lang.String origin)
Common HTTP Metadata: Store the origin into the header map- Parameters:
origin- the Origin value- Returns:
- "This" for method chaining.
-
withReferer
public HttpServletNetworkRequestEvent withReferer(java.lang.String referer)
Common HTTP Metadata: Store the referer into the header map- Parameters:
referer- the referer value- Returns:
- "This" for method chaining.
-
withUserAgent
public HttpServletNetworkRequestEvent withUserAgent(java.lang.String userAgent)
Common HTTP Metadata: Store the user-agent into the header map- Parameters:
userAgent- the user-agent value- Returns:
- "This" for method chaining.
-
withHeaderMap
public HttpServletNetworkRequestEvent withHeaderMap(java.util.Map<java.lang.String,java.lang.String> inputMap)
Populate the contents of the inputMap into the header map.- Overrides:
withHeaderMapin classAbstractProtocolEvent- Parameters:
inputMap- the input map to add onto the header map.- Returns:
- the 'this' for method chaining
-
withMethod
public HttpServletNetworkRequestEvent withMethod(java.lang.String method)
Store the HTTP method/verb into this event- Parameters:
method- The HTTP method/verb. Can be "POST", "GET", "PUT", etc- Returns:
- "This" for method chaining.
-
withURL
public HttpServletNetworkRequestEvent withURL(java.lang.String url)
Store the HTTP URL from the incoming request into this event.- Parameters:
url- the URL from the request.- Returns:
- "This" for method chaining.
-
withRequest
public HttpServletNetworkRequestEvent withRequest(java.lang.Object request)
Store the literal HTTP request object into this event.- Overrides:
withRequestin classAbstractProtocolRequestEvent- Parameters:
request- the HTTP request object. Most commonly the ServletRequest object.- Returns:
- "This" for method chaining.
-
getHeaderData
public java.lang.String getHeaderData(java.lang.String key)
Get the value of header information tied to this event.- Specified by:
getHeaderDatain interfaceProtocolEvent- Overrides:
getHeaderDatain classAbstractProtocolEvent- Parameters:
key- the name of the header- Returns:
- the header value associated with the key.
-
getDate
public java.lang.String getDate()
Common HTTP metadata: return the date entry from the header.- Specified by:
getDatein interfaceHttpNetworkProtocolRequestEvent- Returns:
- The date value
-
getHost
public java.lang.String getHost()
Common HTTP metadata: return the host entry from the header.- Specified by:
getHostin interfaceHttpNetworkProtocolRequestEvent- Returns:
- The host value
-
getHTTPOrigin
public java.lang.String getHTTPOrigin()
Common HTTP metadata: return the origin entry from the header.- Specified by:
getHTTPOriginin interfaceHttpNetworkProtocolRequestEvent- Returns:
- The origin value
-
getReferer
public java.lang.String getReferer()
Common HTTP metadata: return the referer entry from the header. (Please note the word "referer" vs "referrer")- Specified by:
getRefererin interfaceHttpNetworkProtocolRequestEvent- Returns:
- The referer value
-
getUserAgent
public java.lang.String getUserAgent()
Common HTTP metadata: return the user-agent entry from the header.- Specified by:
getUserAgentin interfaceHttpNetworkProtocolRequestEvent- Returns:
- The user-agent value
-
getMethod
public java.lang.String getMethod()
Get the http verb/method used from the incoming request.- Specified by:
getMethodin interfaceHttpNetworkProtocolRequestEvent- Returns:
- The method value (POST, GET, PUT, etc)
-
getURL
public java.lang.String getURL()
Get the URL associated with the incoming request- Specified by:
getURLin interfaceHttpNetworkProtocolRequestEvent- Returns:
- The incoming URL request
-
getRemoteIPAddress
public java.lang.String getRemoteIPAddress()
Retrieve the IP address of the client that sent the request.- Specified by:
getRemoteIPAddressin interfaceHttpNetworkProtocolRequestEvent- Returns:
- The remote IP address
-
getLocalIPAddress
public java.lang.String getLocalIPAddress()
Retrieve the IP address of the interface on which the request was received.- Specified by:
getLocalIPAddressin interfaceHttpNetworkProtocolRequestEvent- Returns:
- The local IP address
-
getNetworkType
public NetworkProtocolEvent.NetworkType getNetworkType()
Get the network type of this ProtocolNetworkEvent- Specified by:
getNetworkTypein interfaceNetworkProtocolEvent- Returns:
- return either TCP or UDP.
-
-