Class RestHandler.Route.RouteBuilder

java.lang.Object
org.elasticsearch.rest.RestHandler.Route.RouteBuilder
Enclosing class:
RestHandler.Route

public static class RestHandler.Route.RouteBuilder extends Object
  • Method Details

    • deprecatedForRemoval

      public RestHandler.Route.RouteBuilder deprecatedForRemoval(String deprecationMessage, RestApiVersion lastFullySupportedVersion)
      Marks that the route being built has been deprecated (for some reason -- the deprecationMessage) for removal. Notes the last major version in which the path is fully supported without compatibility headers. If this path is being replaced by another then use replaces(Method, String, RestApiVersion) instead.

      For example:

       
       Route.builder(GET, "_upgrade")
        .deprecatedForRemoval("The _upgrade API is no longer useful and will be removed.", RestApiVersion.V_7)
        .build()
      Parameters:
      deprecationMessage - the user-visible explanation of this deprecation
      lastFullySupportedVersion - the last RestApiVersion (i.e. 7) for which this route is fully supported. The next major version (i.e. 8) will require compatibility header(s). (;compatible-with=7) The next major version (i.e. 9) will have no support whatsoever for this route.
      Returns:
      a reference to this object.
    • replaces

      public RestHandler.Route.RouteBuilder replaces(RestRequest.Method replacedMethod, String replacedPath, RestApiVersion lastFullySupportedVersion)
      Marks that the route being built replaces another route, and notes the last major version in which the path is fully supported without compatibility headers.

      For example:

       
       Route.builder(GET, "/_security/user/")
         .replaces(GET, "/_xpack/security/user/", RestApiVersion.V_7).build()
      Parameters:
      replacedMethod - the method being replaced
      replacedPath - the path being replaced
      lastFullySupportedVersion - the last RestApiVersion (i.e. 7) for which this route is fully supported. The next major version (i.e. 8) will require compatibility header(s). (;compatible-with=7) The next major version (i.e. 9) will have no support whatsoever for this route.
      Returns:
      a reference to this object.
    • deprecateAndKeep

      public RestHandler.Route.RouteBuilder deprecateAndKeep(String deprecationMessage)
      Marks that the route being built has been deprecated (for some reason -- the deprecationMessage), but will not be removed.

      For example:

       
       Route.builder(GET, "_upgrade")
        .deprecateAndKeep("The _upgrade API is no longer useful but will not be removed.")
        .build()
      Parameters:
      deprecationMessage - the user-visible explanation of this deprecation
      Returns:
      a reference to this object.
    • build

      public RestHandler.Route build()