public class IpExtractor extends Object implements CredentialsExtractor<TokenCredentials>
enhanced for
iteration over arrays.
By default, if no proxy ip is setted (setProxyIp(String)
), only request from proxy IP will be accepted.Constructor and Description |
---|
IpExtractor(String clientName) |
IpExtractor(String clientName,
String... alternateIpHeaders) |
Modifier and Type | Method and Description |
---|---|
TokenCredentials |
extract(WebContext context) |
String |
getAlternateIpHeader()
Deprecated.
Use
getAlternateIpHeaders() instead. |
List |
getAlternateIpHeaders() |
String |
getProxyIp() |
void |
setAlternateIpHeader(String alternateIpHeader)
Deprecated.
Use
setAlternateIpHeaders(String...) instead. |
void |
setAlternateIpHeaders(String... alternateIpHeaders) |
void |
setProxyIp(String proxyIp) |
String |
toString() |
public IpExtractor(String clientName)
public TokenCredentials extract(WebContext context) throws HttpAction
extract
in interface CredentialsExtractor<TokenCredentials>
HttpAction
@Deprecated public String getAlternateIpHeader()
getAlternateIpHeaders()
instead.@Deprecated public void setAlternateIpHeader(String alternateIpHeader)
setAlternateIpHeaders(String...)
instead.alternateIpHeader
- The alternate header to search for IP.public String getProxyIp()
public void setProxyIp(String proxyIp)
proxyIp
- Set the IP to verify the proxy request source.
Setting null
or ""
(empty string) disabled the proxy IP check.public List getAlternateIpHeaders()
Collections.unmodifiableList(List)
public void setAlternateIpHeaders(String... alternateIpHeaders)
alternateIpHeaders
- Sets alternate headers to search for IP.
The first match will be returned as specified for enhanced for
iteration over arrays.Copyright © 2017. All Rights Reserved.