Class AbstractConstantRestrictor
java.lang.Object
org.jolokia.server.core.restrictor.AbstractConstantRestrictor
- All Implemented Interfaces:
Restrictor
- Direct Known Subclasses:
AllowAllRestrictor,DenyAllRestrictor
Base restrictor which alway returns the constant given
at construction time
- Since:
- 06.10.11
- Author:
- roland
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractConstantRestrictor(boolean pAllowed) Create restrictor which always returns the given value on every check method. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisAttributeReadAllowed(ObjectName pName, String pAttribute) Check whether reading of an attribute is allowedbooleanisAttributeWriteAllowed(ObjectName pName, String pAttribute) Check whether writing of an attribute is allowedbooleanisHttpMethodAllowed(HttpMethod pMethod) Check whether the HTTP method with which the request was sent is allowed.booleanisOperationAllowed(ObjectName pName, String pOperation) Check whether execution of an operation is allowedbooleanisOriginAllowed(String pOrigin, boolean pOnlyWhenStrictCheckingIsEnabled) Check whether cross browser access via CORS is allowed.booleanisRemoteAccessAllowed(String... pHostOrAddress) Check whether access from the connected client is allowed.booleanisTypeAllowed(RequestType pType) Check whether the provided command type is allowed in principal
-
Constructor Details
-
AbstractConstantRestrictor
protected AbstractConstantRestrictor(boolean pAllowed) Create restrictor which always returns the given value on every check method.- Parameters:
pAllowed- whether access is allowed or denied
-
-
Method Details
-
isHttpMethodAllowed
Check whether the HTTP method with which the request was sent is allowed.- Specified by:
isHttpMethodAllowedin interfaceRestrictor- Parameters:
pMethod- method to check- Returns:
- true if there is no restriction on the method with which the request was sent, false otherwise
-
isTypeAllowed
Check whether the provided command type is allowed in principal- Specified by:
isTypeAllowedin interfaceRestrictor- Parameters:
pType- type to check- Returns:
- true, if the type is allowed, false otherwise
-
isAttributeReadAllowed
Check whether reading of an attribute is allowed- Specified by:
isAttributeReadAllowedin interfaceRestrictor- Parameters:
pName- MBean namepAttribute- attribute to check- Returns:
- true if access is allowed
-
isAttributeWriteAllowed
Check whether writing of an attribute is allowed- Specified by:
isAttributeWriteAllowedin interfaceRestrictor- Parameters:
pName- MBean namepAttribute- attribute to check- Returns:
- true if access is allowed
-
isOperationAllowed
Check whether execution of an operation is allowed- Specified by:
isOperationAllowedin interfaceRestrictor- Parameters:
pName- MBean namepOperation- attribute to check- Returns:
- true if access is allowed
-
isRemoteAccessAllowed
Check whether access from the connected client is allowed. If at least one of the given parameters matches, then this method returns true.- Specified by:
isRemoteAccessAllowedin interfaceRestrictor- Parameters:
pHostOrAddress- one or more host or address names.- Returns:
- true is access is allowed
-
isOriginAllowed
Check whether cross browser access via CORS is allowed. See the CORS specification for details- Specified by:
isOriginAllowedin interfaceRestrictor- Parameters:
pOrigin- the "Origin:" header provided within the requestpOnlyWhenStrictCheckingIsEnabled- whether by-pass check when strict checking is disabled- Returns:
- true if this cross browser request allowed, false otherwise
-