Class ListableEndpointRestrictionsService
java.lang.Object
de.hybris.platform.webservicescommons.api.restrictions.services.impl.ListableEndpointRestrictionsService
- All Implemented Interfaces:
EndpointRestrictionsService
public class ListableEndpointRestrictionsService
extends Object
implements EndpointRestrictionsService
Implementation of the
EndpointRestrictionsService service used for restricting REST controller endpoints.It uses the list of identification strategies to identify endpoint IDs.
It uses configuration strategy with the list of disabled endpoint IDs to determine whether the endpoint is disabled.
The service do not affect the endpoint availability if the list of disabled endpoint IDs is empty.
-
Constructor Summary
ConstructorsConstructorDescriptionListableEndpointRestrictionsService(EndpointRestrictionsConfigStrategy endpointRestrictionsConfigStrategy, List<EndpointIdentificationStrategy> endpointIdentificationStrategies) Service constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected List<EndpointIdentificationStrategy>protected EndpointRestrictionsConfigStrategybooleanisEndpointDisabled(String configPrefix, EndpointContextData endpointContextData) Specifies whether the endpoint is disabled, based on given endpoint's context data and configuration prefix.protected booleanisEndpointIdDisabled(String endpointId, String configPrefix) Verifies whether the endpoint identifier is disabled by using endpoint restriction config strategy.protected booleanisServiceEnabled(String configPrefix) Verifies whether the service is enabled for given configuration prefix.
-
Constructor Details
-
ListableEndpointRestrictionsService
public ListableEndpointRestrictionsService(EndpointRestrictionsConfigStrategy endpointRestrictionsConfigStrategy, List<EndpointIdentificationStrategy> endpointIdentificationStrategies) Service constructor- Parameters:
endpointRestrictionsConfigStrategy- restriction strategy, used to determine if an endpoint identifier is disabled by configurationendpointIdentificationStrategies- list of identification strategies used to create endpoint identifiers
-
-
Method Details
-
isEndpointDisabled
Specifies whether the endpoint is disabled, based on given endpoint's context data and configuration prefix.Configuration prefix is used to build property key, which is used to get disabled endpoints array.
- Specified by:
isEndpointDisabledin interfaceEndpointRestrictionsService- Parameters:
configPrefix- configuration prefixendpointContextData- endpoint's context data- Returns:
true- means the endpoint is disabled
-
isServiceEnabled
Verifies whether the service is enabled for given configuration prefix.- Parameters:
configPrefix- configuration prefix- Returns:
trueservice enabled
-
isEndpointIdDisabled
Verifies whether the endpoint identifier is disabled by using endpoint restriction config strategy.- Parameters:
endpointId- endpoint identifierconfigPrefix- configuration prefix used to create verification property key- Returns:
true- means the endpoint identifier is disabled
-
getEndpointRestrictionsConfigStrategy
-
getEndpointIdentificationStrategies
-