Skip to content

Commit

Permalink
Add method for evict alla caches
Browse files Browse the repository at this point in the history
  • Loading branch information
mspasiano committed Jun 13, 2023
1 parent 4937c25 commit 8383f0e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,9 @@ public void resetCacheBulkInfo() {
JSONLIST_APPLICATION_ASPECTS,
JSONLIST_APPLICATION_ATTACHMENTS,
JSONLIST_APPLICATION_SCHEDE_ANONIME,
JSONLIST_APPLICATION_FIELDS_NOT_REQUIRED
JSONLIST_APPLICATION_FIELDS_NOT_REQUIRED,
JSONLIST_APPLICATION_PRODOTTI,
JSONLIST_APPLICATION_CURRICULUMS
})
public void resetCacheApplication() {
LOGGER.info("Reset cache of Application");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,56 +111,77 @@ public Response get(@Context HttpServletRequest req) {
}

@GET
@Path("reset-cache-bulkinfo")
@Path("reset-bulkinfo")
public Response resetBulkInfo(@Context HttpServletRequest req) {
if (cmisService.getCMISUserFromSession(req).isAdmin()) {
cacheRepository.resetCacheBulkInfo();
return Response.ok().build();
}
return Response.ok().build();
return Response.status(Response.Status.FORBIDDEN).build();
}

@GET
@Path("reset-cache-application")
@Path("reset-application")
public Response resetApplication(@Context HttpServletRequest req) {
if (cmisService.getCMISUserFromSession(req).isAdmin()) {
cacheRepository.resetCacheApplication();
return Response.ok().build();
}
return Response.ok().build();
return Response.status(Response.Status.FORBIDDEN).build();
}

@GET
@Path("reset-cache-call")
@Path("reset-call")
public Response resetCall(@Context HttpServletRequest req) {
if (cmisService.getCMISUserFromSession(req).isAdmin()) {
cacheRepository.resetCacheCall();
return Response.ok().build();
}
return Response.ok().build();
return Response.status(Response.Status.FORBIDDEN).build();
}

@GET
@Path("reset-cache-jasper")
@Path("reset-jasper")
public Response resetJasperReport(@Context HttpServletRequest req) {
if (cmisService.getCMISUserFromSession(req).isAdmin()) {
cacheRepository.resetCacheJasper();
return Response.ok().build();
}
return Response.ok().build();
return Response.status(Response.Status.FORBIDDEN).build();
}

@GET
@Path("reset-sedi-siper")
public Response resetSediSiper(@Context HttpServletRequest req) {
if (cmisService.getCMISUserFromSession(req).isAdmin()) {
cacheRepository.resetCacheSediSiper();
return Response.ok().build();
}
return Response.ok().build();
return Response.status(Response.Status.FORBIDDEN).build();
}

@GET
@Path("reset-labels")
public Response resetLabels(@Context HttpServletRequest req) {
if (cmisService.getCMISUserFromSession(req).isAdmin()) {
cacheRepository.resetCacheLabels();
return Response.ok().build();
}
return Response.ok().build();
return Response.status(Response.Status.FORBIDDEN).build();
}

@GET
@Path("reset")
public Response reset(@Context HttpServletRequest req) {
if (cmisService.getCMISUserFromSession(req).isAdmin()) {
cacheRepository.resetCacheBulkInfo();
cacheRepository.resetCacheApplication();
cacheRepository.resetCacheCall();
cacheRepository.resetCacheJasper();
cacheRepository.resetCacheSediSiper();
cacheRepository.resetCacheLabels();
return Response.ok().build();
}
return Response.status(Response.Status.FORBIDDEN).build();
}
}

0 comments on commit 8383f0e

Please sign in to comment.