Class AppConfigurationRefreshEndpoint

java.lang.Object
com.azure.spring.cloud.config.web.pushrefresh.AppConfigurationRefreshEndpoint
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationEventPublisherAware

@ControllerEndpoint(id="appconfiguration-refresh") public final class AppConfigurationRefreshEndpoint extends Object implements org.springframework.context.ApplicationEventPublisherAware
Endpoint for requesting new configurations to be loaded.
  • Constructor Details

    • AppConfigurationRefreshEndpoint

      public AppConfigurationRefreshEndpoint(org.springframework.cloud.context.refresh.ContextRefresher contextRefresher, AppConfigurationProperties appConfiguration)
      Endpoint for triggering a refresh check for a single config store.
      Parameters:
      contextRefresher - Used to verify refresh is available.
      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.
    • setApplicationEventPublisher

      public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
      Specified by:
      setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAware