public class IPRangeAccessControl extends AbstractIdentifiableInitializableComponent implements AccessControl
| Modifier and Type | Field and Description |
|---|---|
private java.util.Collection<IPRange> |
allowedRanges
List of CIDR blocks allowed to access this servlet.
|
private org.slf4j.Logger |
log
Class logger.
|
| Constructor and Description |
|---|
IPRangeAccessControl()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkAccess(javax.servlet.ServletRequest request,
java.lang.String operation,
java.lang.String resource)
Determine whether the request to the resource should be granted.
|
private java.lang.String |
getLogPrefix()
Get logging prefix.
|
void |
setAllowedRanges(java.util.Collection<IPRange> ranges)
Set the CIDR address ranges to allow.
|
setIddoInitialize, getIddestroy, doDestroy, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetId@Nonnull private final org.slf4j.Logger log
@Nonnull @NonnullElements private java.util.Collection<IPRange> allowedRanges
public void setAllowedRanges(@Nonnull @NonnullElements java.util.Collection<IPRange> ranges)
ranges - ranges to allowpublic boolean checkAccess(@Nonnull
javax.servlet.ServletRequest request,
@Nullable
java.lang.String operation,
@Nullable
java.lang.String resource)
checkAccess in interface AccessControlrequest - request to checkoperation - operation being performedresource - target resource@Nonnull private java.lang.String getLogPrefix()