1. Domino REST
  2. Configuration
  3. Resource locators

Resource locators

Resource locators let you split a request factory into smaller sub-resources while keeping the full path intact. Use locator methods to hand off a path segment to another interface and keep your endpoints organized by feature.

			@RequestFactory
@Path("library")
public interface LibraryResource {

    @Path("movies")
    MoviesResource movies();
}

@RequestFactory
public interface MoviesResource {

    @GET
    @Path(":id")
    Movie getMovie(@PathParam("id") String id);

    @POST
    @Path(":id/reviews")
    void addReview(@PathParam("id") String id, @RequestBody Review review);
}

// Calling libraryResource.movies().getMovie("123") targets /library/movies/:id

		

Each locator contributes its path segment to the final URL. The generated client keeps all annotations (headers, params, consumes/produces) on the target interface, while the locator method only supplies the segment that routes to it.

We are a group of passionate people who love what we do

Donate & Support Us