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 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 configuration
      endpointIdentificationStrategies - list of identification strategies used to create endpoint identifiers
  • Method Details

    • isEndpointDisabled

      public boolean isEndpointDisabled(String configPrefix, EndpointContextData endpointContextData)
      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:
      isEndpointDisabled in interface EndpointRestrictionsService
      Parameters:
      configPrefix - configuration prefix
      endpointContextData - endpoint's context data
      Returns:
      true - means the endpoint is disabled
    • isServiceEnabled

      protected boolean isServiceEnabled(String configPrefix)
      Verifies whether the service is enabled for given configuration prefix.
      Parameters:
      configPrefix - configuration prefix
      Returns:
      true service enabled
    • isEndpointIdDisabled

      protected boolean isEndpointIdDisabled(String endpointId, String configPrefix)
      Verifies whether the endpoint identifier is disabled by using endpoint restriction config strategy.
      Parameters:
      endpointId - endpoint identifier
      configPrefix - configuration prefix used to create verification property key
      Returns:
      true - means the endpoint identifier is disabled
    • getEndpointRestrictionsConfigStrategy

      protected EndpointRestrictionsConfigStrategy getEndpointRestrictionsConfigStrategy()
    • getEndpointIdentificationStrategies

      protected List<EndpointIdentificationStrategy> getEndpointIdentificationStrategies()