public class IPRangeAccessControl extends AbstractIdentifiableInitializableComponent implements AccessControl
Modifier and Type | Field and Description |
---|---|
private 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,
String operation,
String resource)
Determine whether the request to the resource should be granted.
|
private String |
getLogPrefix()
Get logging prefix.
|
void |
setAllowedRanges(Collection<IPRange> ranges)
Set the CIDR address ranges to allow.
|
setId
doInitialize, getId
destroy, doDestroy, initialize, isDestroyed, isInitialized
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getId
@Nonnull private final org.slf4j.Logger log
@Nonnull @NonnullElements private Collection<IPRange> allowedRanges
public void setAllowedRanges(@Nonnull @NonnullElements Collection<IPRange> ranges)
ranges
- ranges to allowpublic boolean checkAccess(@Nonnull javax.servlet.ServletRequest request, @Nullable String operation, @Nullable String resource)
checkAccess
in interface AccessControl
request
- request to checkoperation
- operation being performedresource
- target resourceCopyright © 1999–2018. All rights reserved.