class CredentialsCacheBean {

    @GET
    @Path("/flushAll")
    @JmxManaged
    public String flushAll() {
        try {
            // Remove principals from the Wildfly cached authentication manager, if we have one in use.
            authManager.flushCache();
            if (!cachedDatawaveUserServiceInstance.isUnsatisfied()) {
                cachedDatawaveUserServiceInstance.get().evictAll();
            }
            return "All credentials caches cleared.";
        } catch (Exception e) {
            GenericResponse<String> response = new GenericResponse<>();
            response.addException(new QueryException(UNKNOWN_SERVER_ERROR, e));
            throw new DatawaveWebApplicationException(e, response);
        }
    }

}