@Test public void testRecreateIndex() throws Exception { given().log().all().expect().statusCode(SC_OK).when().post(env.host("/recreateIndex")); }
@POST @Path("recreateIndex") @RestQuery(name = "recreateIndex", description = "Repopulates the External Index directly from the Services", returnDescription = "OK if repopulation has started", responses = { @RestResponse(description = "OK if repopulation has started", responseCode = HttpServletResponse.SC_OK) }) public Response recreateIndex() { final SecurityContext securityContext = new SecurityContext(securityService, securityService.getOrganization(), securityService.getUser()); executor.execute(() -> securityContext.runInContext(() -> { try { logger.info("Starting to repopulate the external index"); externalIndex.recreateIndex(); logger.info("Finished repopulating the external index"); } catch (InterruptedException e) { logger.error("Repopulating the external index was interrupted", e); } catch (CancellationException e) { logger.trace("Listening for external index messages has been cancelled."); } catch (ExecutionException e) { logger.error("Repopulating the external index failed to execute", e); } catch (Throwable t) { logger.error("Repopulating the external index failed", t); } })); return R.ok(); }
BaseEndpoint { @POST @Path("recreateIndex") @RestQuery(name = "recreateIndex", description = "Repopulates the External Index directly from the Services", returnDescription = "OK if repopulation has started", responses = { @RestResponse(description = "OK if repopulation has started", responseCode = HttpServletResponse.SC_OK) }) public Response recreateIndex() { final SecurityContext securityContext = new SecurityContext(securityService, securityService.getOrganization(), securityService.getUser()); executor.execute(() -> securityContext.runInContext(() -> { try { logger.info("Starting to repopulate the external index"); externalIndex.recreateIndex(); logger.info("Finished repopulating the external index"); } catch (InterruptedException e) { logger.error("Repopulating the external index was interrupted", e); } catch (CancellationException e) { logger.trace("Listening for external index messages has been cancelled."); } catch (ExecutionException e) { logger.error("Repopulating the external index failed to execute", e); } catch (Throwable t) { logger.error("Repopulating the external index failed", t); } })); return R.ok(); } }
BaseEndpoint { @POST @Path("recreateIndex") @RestQuery(name = "recreateIndex", description = "Repopulates the External Index directly from the Services", returnDescription = "OK if repopulation has started", responses = { @RestResponse(description = "OK if repopulation has started", responseCode = HttpServletResponse.SC_OK) }) public Response recreateIndex() { final SecurityContext securityContext = new SecurityContext(securityService, securityService.getOrganization(), securityService.getUser()); executor.execute(() -> securityContext.runInContext(() -> { try { logger.info("Starting to repopulate the external index"); externalIndex.recreateIndex(); logger.info("Finished repopulating the external index"); } catch (InterruptedException e) { logger.error("Repopulating the external index was interrupted", e); } catch (CancellationException e) { logger.trace("Listening for external index messages has been cancelled."); } catch (ExecutionException e) { logger.error("Repopulating the external index failed to execute", e); } catch (Throwable t) { logger.error("Repopulating the external index failed", t); } })); return R.ok(); }  }
BaseEndpoint { @POST @Path("recreateIndex") @RestQuery(name = "recreateIndex", description = "Repopulates the External Index directly from the Services", returnDescription = "OK if repopulation has started", responses = { @RestResponse(description = "OK if repopulation has started", responseCode = HttpServletResponse.SC_OK) }) public Response recreateIndex() { final SecurityContext securityContext = new SecurityContext(securityService, securityService.getOrganization(), securityService.getUser()); executor.execute(() -> securityContext.runInContext(() -> { try { logger.info("Starting to repopulate the external index"); externalIndex.recreateIndex(); logger.info("Finished repopulating the external index"); } catch (InterruptedException e) { logger.error("Repopulating the external index was interrupted", e); } catch (CancellationException e) { logger.trace("Listening for external index messages has been cancelled."); } catch (ExecutionException e) { logger.error("Repopulating the external index failed to execute", e); } catch (Throwable t) { logger.error("Repopulating the external index failed", t); } })); return R.ok(); }  @GET @Path("") @RestQuery(name = "getendpointinfo", description = "Returns key characteristics of the API such as the server name and the default version.", returnDescription = "", responses = { @RestResponse(description = "The api information is returned.", responseCode = HttpServletResponse.SC_OK) }) Response getEndpointInfo(); @GET @Path("info/me") @RestQuery(name = "getuserinfo", description = "Returns information on the logged in user.", returnDescription = "", responses = { @RestResponse(description = "The user information is returned.", responseCode = HttpServletResponse.SC_OK) }) Response getUserInfo(); @GET @Path("info/me/roles") @RestQuery(name = "getuserroles", description = "Returns current user's roles.", returnDescription = "", responses = { @RestResponse(description = "The set of roles is returned.", responseCode = HttpServletResponse.SC_OK) }) Response getUserRoles(); @GET @Path("info/organization") @RestQuery(name = "getorganizationinfo", description = "Returns the current organization.", returnDescription = "", responses = { @RestResponse(description = "The organization details are returned.", responseCode = HttpServletResponse.SC_OK) }) Response getOrganizationInfo(); @GET @Path("info/organization/properties") @RestQuery(name = "getorganizationproperties", description = "Returns the current organization's properties.", returnDescription = "", responses = { @RestResponse(description = "The organization properties are returned.", responseCode = HttpServletResponse.SC_OK) }) Response getOrganizationProperties(); @GET @Path("info/organization/properties/engageuiurl") @RestQuery(name = "getorganizationpropertiesengageuiurl", description = "Returns the engage ui url property.", returnDescription = "", responses = { @RestResponse(description = "The engage ui url is returned.", responseCode = HttpServletResponse.SC_OK) }) Response getOrganizationPropertiesEngageUiUrl(); @GET @Path("version") @RestQuery(name = "getversion", description = "Returns a list of available version as well as the default version.", returnDescription = "", responses = { @RestResponse(description = "The default version is returned.", responseCode = HttpServletResponse.SC_OK) }) Response getVersion(); @GET @Path("version/default") @RestQuery(name = "getversiondefault", description = "Returns the default version.", returnDescription = "", responses = { @RestResponse(description = "The default version is returned.", responseCode = HttpServletResponse.SC_OK) }) Response getVersionDefault(); @POST @Path("clearIndex") @RestQuery(name = "clearIndex", description = "Clear the External index", returnDescription = "OK if index is cleared", responses = { @RestResponse(description = "Index is cleared", responseCode = HttpServletResponse.SC_OK), @RestResponse(description = "Unable to clear index", responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR) }) Response clearIndex(); @POST @Path("recreateIndex/{service}") @RestQuery(name = "recreateIndexFromService", description = "Repopulates the external Index from an specific service", returnDescription = "OK if repopulation has started", pathParameters = { @RestParameter(name = "service", isRequired = true, description = "The service to recreate index from. " + "The available services are: Groups, Acl, Themes, Series, Scheduler, Workflow, AssetManager and Comments. " + "The service order (see above) is very important! Make sure, you do not run index rebuild for more than one " + "service at a time!", type = RestParameter.Type.STRING) }, responses = { @RestResponse(description = "OK if repopulation has started", responseCode = HttpServletResponse.SC_OK) }) Response recreateIndexFromService(@PathParam("service") final String service); @POST @Path("recreateIndex") @RestQuery(name = "recreateIndex", description = "Repopulates the External Index directly from the Services", returnDescription = "OK if repopulation has started", responses = { @RestResponse(description = "OK if repopulation has started", responseCode = HttpServletResponse.SC_OK) }) Response recreateIndex(); }
BaseEndpoint { @POST @Path("recreateIndex") @RestQuery(name = "recreateIndex", description = "Repopulates the External Index directly from the Services", returnDescription = "OK if repopulation has started", responses = { @RestResponse(description = "OK if repopulation has started", responseCode = HttpServletResponse.SC_OK) }) public Response recreateIndex() { final SecurityContext securityContext = new SecurityContext(securityService, securityService.getOrganization(), securityService.getUser()); executor.execute(() -> securityContext.runInContext(() -> { try { logger.info("Starting to repopulate the external index"); externalIndex.recreateIndex(); logger.info("Finished repopulating the external index"); } catch (InterruptedException e) { logger.error("Repopulating the external index was interrupted", e); } catch (CancellationException e) { logger.trace("Listening for external index messages has been cancelled."); } catch (ExecutionException e) { logger.error("Repopulating the external index failed to execute", e); } catch (Throwable t) { logger.error("Repopulating the external index failed", t); } })); return R.ok(); }  @GET @Path("") @RestQuery(name = "getendpointinfo", description = "Returns key characteristics of the API such as the server name and the default version.", returnDescription = "", responses = { @RestResponse(description = "The api information is returned.", responseCode = HttpServletResponse.SC_OK) }) Response getEndpointInfo(); @GET @Path("info/me") @RestQuery(name = "getuserinfo", description = "Returns information on the logged in user.", returnDescription = "", responses = { @RestResponse(description = "The user information is returned.", responseCode = HttpServletResponse.SC_OK) }) Response getUserInfo(); @GET @Path("info/me/roles") @RestQuery(name = "getuserroles", description = "Returns current user's roles.", returnDescription = "", responses = { @RestResponse(description = "The set of roles is returned.", responseCode = HttpServletResponse.SC_OK) }) Response getUserRoles(); @GET @Path("info/organization") @RestQuery(name = "getorganizationinfo", description = "Returns the current organization.", returnDescription = "", responses = { @RestResponse(description = "The organization details are returned.", responseCode = HttpServletResponse.SC_OK) }) Response getOrganizationInfo(); @GET @Path("info/organization/properties") @RestQuery(name = "getorganizationproperties", description = "Returns the current organization's properties.", returnDescription = "", responses = { @RestResponse(description = "The organization properties are returned.", responseCode = HttpServletResponse.SC_OK) }) Response getOrganizationProperties(); @GET @Path("info/organization/properties/engageuiurl") @RestQuery(name = "getorganizationpropertiesengageuiurl", description = "Returns the engage ui url property.", returnDescription = "", responses = { @RestResponse(description = "The engage ui url is returned.", responseCode = HttpServletResponse.SC_OK) }) Response getOrganizationPropertiesEngageUiUrl(); @GET @Path("version") @RestQuery(name = "getversion", description = "Returns a list of available version as well as the default version.", returnDescription = "", responses = { @RestResponse(description = "The default version is returned.", responseCode = HttpServletResponse.SC_OK) }) Response getVersion(); @GET @Path("version/default") @RestQuery(name = "getversiondefault", description = "Returns the default version.", returnDescription = "", responses = { @RestResponse(description = "The default version is returned.", responseCode = HttpServletResponse.SC_OK) }) Response getVersionDefault(); @POST @Path("clearIndex") @RestQuery(name = "clearIndex", description = "Clear the External index", returnDescription = "OK if index is cleared", responses = { @RestResponse(description = "Index is cleared", responseCode = HttpServletResponse.SC_OK), @RestResponse(description = "Unable to clear index", responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR) }) Response clearIndex(); @POST @Path("recreateIndex/{service}") @RestQuery(name = "recreateIndexFromService", description = "Repopulates the external Index from an specific service", returnDescription = "OK if repopulation has started", pathParameters = { @RestParameter(name = "service", isRequired = true, description = "The service to recreate index from. " + "The available services are: Groups, Acl, Themes, Series, Scheduler, Workflow, AssetManager and Comments. " + "The service order (see above) is very important! Make sure, you do not run index rebuild for more than one " + "service at a time!", type = RestParameter.Type.STRING) }, responses = { @RestResponse(description = "OK if repopulation has started", responseCode = HttpServletResponse.SC_OK) }) Response recreateIndexFromService(@PathParam("service") final String service); @POST @Path("recreateIndex") @RestQuery(name = "recreateIndex", description = "Repopulates the External Index directly from the Services", returnDescription = "OK if repopulation has started", responses = { @RestResponse(description = "OK if repopulation has started", responseCode = HttpServletResponse.SC_OK) }) Response recreateIndex();  }