Package org.apache.juneau.rest.server.ops


package org.apache.juneau.rest.server.ops
Ops / introspection mixin pack — composable @Rest(mixins=...) resources that ship the operational surface (request echo, JVM admin, route index) every long-running Juneau service eventually grows.

Three sibling mixins compose into the host @Rest-annotated resource. Each mixin owns its default mount paths, ships secure-by-default (disabled-by-default for echo, deny-all-guard for admin), and is independently mountable; the three together drop in as a pack via @Rest(mixins={EchoMixin.class, AdminMixin.class, RouteIndexMixin.class}).

  • EchoMixin — /echo/* request echo (SVL-configurable mount); sensitive headers (Authorization, Cookie, etc.) are redacted by default.
  • AdminMixin — /admin/threads, /admin/heap, /admin/cache/flush (POST), and /admin/ratelimit; default-deny via DenyAllGuard until the importer registers an @Bean RestGuardList factory.
  • RouteIndexMixin — /options (SVL-configurable mount) returning a JSON list of every @RestOp-annotated method on the host (plus mixins), excluding @OpSwagger(ignore=true) ops.
Composition example:

@Rest( path="/api", mixins={ EchoMixin.class, AdminMixin.class, RouteIndexMixin.class } ) public class ApiResource extends RestServlet { // Required: register an auth guard chain; replaces the deny-all default. @Bean(name="guards") public RestGuardList guards(BeanStore bs) { return RestGuardList.create(bs) .append(new MyAuthGuard()) .build(); } @Bean AdminMixin admin() { return AdminMixin.create() .cacheFlush("primary", () -> primaryCache.invalidateAll()) .build(); } }

All endpoints carry @OpSwagger(ignore=true) — ops endpoints are not API-meaningful and are excluded from any generated Swagger / OpenAPI spec.

See Also:
Since:
10.0.0