Class AdminResource
java.lang.Object
org.apache.juneau.rest.server.servlet.RestResource
org.apache.juneau.rest.server.ops.AdminResource
Child-resource flavor of the
AdminMixin mixin.
Mounts as a routed child via @Rest(children=AdminResource.class) under
a parent at the subtree /admin and serves the same operational endpoints (/threads,
/heap, /cache/flush, /ratelimit) as the mixin by delegating to a shared
flavor-neutral AdminProvider worker bean — so the forms cannot drift.
Whereas the AdminMixin mixin pins its ops at /admin/<endpoint> for composition into a
host at /, this child declares the subtree at the class level
(@Rest(path="/admin")) and pins the ops at the bare endpoint names
(e.g. /threads).
Default-deny security posture:
Like the mixin and servlet flavors, this child is annotated
@Rest(guards=DenyAllGuard.class), so every admin path returns
403 Forbidden until the importer registers a RestGuardList factory.
See Also:
- Since:
- 10.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.juneau.rest.server.servlet.RestResource
RestResource.Builder<R extends RestResource,SELF extends RestResource.Builder<R, SELF>>, RestResource.DefaultBuilder<R extends RestResource> -
Constructor Summary
ConstructorsModifierConstructorDescriptionNo-arg constructor — uses a defaultAdminProviderworker.protectedAdminResource(AdminProvider worker) Worker constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidgetHeap(RestResponse res) [GET /heap] — emit JVM heap and non-heap memory statistics.voidgetRateLimit(RestRequest req, RestResponse res) [GET /ratelimit] — emit registeredRateLimitGuardbean configuration.voidgetThreads(RestResponse res) [GET /threads] — emit a JSON list of currently-live threads.voidpostCacheFlush(RestRequest req, RestResponse res) [POST /cache/flush] — run all registered cache-flush hooks (or a subset).Methods inherited from class org.apache.juneau.rest.server.servlet.RestResource
builder, doLog, getContext, getPaths, getRequest, getResponse, getRestBuilder, log, log, setContext
-
Constructor Details
-
AdminResource
public AdminResource()No-arg constructor — uses a defaultAdminProviderworker. -
AdminResource
Worker constructor.- Parameters:
worker- The shared flavor-neutral admin worker this child delegates to. Must not benull.
-
-
Method Details
-
getThreads
[GET /threads] — emit a JSON list of currently-live threads.- Parameters:
res- The current REST response.- Throws:
IOException- If an I/O error occurs while writing the response.
-
getHeap
[GET /heap] — emit JVM heap and non-heap memory statistics.- Parameters:
res- The current REST response.- Throws:
IOException- If an I/O error occurs while writing the response.
-
postCacheFlush
[POST /cache/flush] — run all registered cache-flush hooks (or a subset).- Parameters:
req- The current REST request —namesquery parameter is read off it.res- The current REST response.- Throws:
IOException- If an I/O error occurs while writing the response.
-
getRateLimit
[GET /ratelimit] — emit registeredRateLimitGuardbean configuration.- Parameters:
req- The current REST request — supplies the bean store for guard lookup.res- The current REST response.- Throws:
IOException- If an I/O error occurs while writing the response.NotFound- If noRateLimitGuardbean is registered on the importer's bean store.
-