Class AppConfigurationBusRefreshEndpoint

java.lang.Object
org.springframework.cloud.bus.endpoint.AbstractBusEndpoint
com.azure.spring.cloud.config.web.pushbusrefresh.AppConfigurationBusRefreshEndpoint

@ControllerEndpoint(id="appconfiguration-refresh-bus") public final class AppConfigurationBusRefreshEndpoint extends org.springframework.cloud.bus.endpoint.AbstractBusEndpoint
Endpoint for requesting new configurations to be loaded in all registered instances on the Bus.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AppConfigurationBusRefreshEndpoint(org.springframework.context.ApplicationEventPublisher context, String appId, org.springframework.cloud.bus.event.Destination.Factory destinationFactory, AppConfigurationProperties appConfiguration)
    Endpoint for triggering a refresh check for a single config store, across all registered instances.
  • Method Summary

    Modifier and Type
    Method
    Description
    refresh(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Map<String,String> allRequestParams)
    Checks a HttpServletRequest to see if it is a refresh event.

    Methods inherited from class org.springframework.cloud.bus.endpoint.AbstractBusEndpoint

    getDestination, getDestinationFactory, getInstanceId, publish

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AppConfigurationBusRefreshEndpoint

      public AppConfigurationBusRefreshEndpoint(org.springframework.context.ApplicationEventPublisher context, String appId, org.springframework.cloud.bus.event.Destination.Factory destinationFactory, AppConfigurationProperties appConfiguration)
      Endpoint for triggering a refresh check for a single config store, across all registered instances.
      Parameters:
      context - Service Bus event publisher
      appId - Service Bus app id
      destinationFactory - service bus destination factory
      appConfiguration - properties set for client library.
  • Method Details

    • refresh

      @PostMapping("/") @ResponseBody public String refresh(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, @RequestParam Map<String,String> allRequestParams) throws IOException
      Checks a HttpServletRequest to see if it is a refresh event. Validates token information. If request is a validation request returns validation code.
      Parameters:
      request - Request checked for refresh.
      response - Response for request.
      allRequestParams - request parameters needs to contain validation token.
      Returns:
      200 if refresh event triggered. 500 if invalid for any reason. Validation response if requested.
      Throws:
      IOException - Unable to parse request info for validation.