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

    • deprecated

      public RestHandler.Route.RouteBuilder deprecated(String deprecationMessage, org.elasticsearch.core.RestApiVersion deprecatedInVersion)
      Marks that the route being built has been deprecated (for some reason -- the deprecationMessage), and notes the major version in which that deprecation occurred.

      For example:

       
       Route.builder(GET, "_upgrade")
        .deprecated("The _upgrade API is no longer useful and will be removed.", RestApiVersion.V_7)
        .build()
      Parameters:
      deprecationMessage - the user-visible explanation of this deprecation
      deprecatedInVersion - the major version in which the deprecation occurred
      Returns:
      a reference to this object.
    • replaces

      public RestHandler.Route.RouteBuilder replaces(RestRequest.Method method, String path, org.elasticsearch.core.RestApiVersion replacedInVersion)
      Marks that the route being built replaces another route, and notes the major version in which that replacement occurred.

      For example:

       
       Route.builder(GET, "/_security/user/")
         .replaces(GET, "/_xpack/security/user/", RestApiVersion.V_7).build()
      Parameters:
      method - the method being replaced
      path - the path being replaced
      replacedInVersion - the major version in which the replacement occurred
      Returns:
      a reference to this object.
    • build

      public RestHandler.Route build()