public class AllowerIP
extends org.restlet.routing.Filter
addCustomIP(java.util.Set)
Allowed IPs are set based on a parameter from the configuration file
Consts.ADMIN_IP_ALLOWER
Modifier and Type | Field and Description |
---|---|
private Set<String> |
allowedAddresses
List of allowed IPs addresses.
|
private boolean |
enabled
Service enabled/disabled.
|
static String |
LOCALHOST_IPV4
Localhost in IPv4.
|
static String |
LOCALHOST_IPV6
Localhost in IPv6.
|
private static org.apache.logging.log4j.Logger |
LOG
Logger.
|
Constructor and Description |
---|
AllowerIP(org.restlet.Context context,
boolean isEnabledIP)
Constructor based on the context and a parameter to make enabled/disabled
the service
|
Modifier and Type | Method and Description |
---|---|
private void |
addCustomIP(Set<String> allowedAddresses)
Adds custom IPs based on the settings.
|
protected int |
beforeHandle(org.restlet.Request request,
org.restlet.Response response)
Before Handler.
|
Set<String> |
getAllowedAddresses()
Returns the allowed addresses.
|
boolean |
isEnabled()
Returns True when the service is enabled otherwise False.
|
afterHandle, doHandle, getNext, handle, hasNext, setNext, setNext, start, stop
private static final org.apache.logging.log4j.Logger LOG
public static final String LOCALHOST_IPV6
public static final String LOCALHOST_IPV4
private final boolean enabled
public AllowerIP(org.restlet.Context context, boolean isEnabledIP)
context
- contextisEnabledIP
- True when the service is enabled otherwise Falseprivate void addCustomIP(Set<String> allowedAddresses)
allowedAddresses
- the new allowed addressesprotected int beforeHandle(org.restlet.Request request, org.restlet.Response response)
beforeHandle
in class org.restlet.routing.Filter
request
- requestresponse
- responsepublic Set<String> getAllowedAddresses()
public boolean isEnabled()
Copyright © 2017–2020 CNES. All rights reserved.