Search in sources :

Example 1 with IndexerStatus

use of org.olat.restapi.system.vo.IndexerStatus in project OpenOLAT by OpenOLAT.

the class IndexerWebService method getStatus.

/**
 * Return the status of the indexer: running, stopped
 * @response.representation.200.mediaType application/xml, application/json
 * @response.representation.200.doc The status of the indexer
 * @response.representation.401.doc The roles of the authenticated user are not sufficient
 * @return The status of the indexer
 */
@GET
@Path("status")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response getStatus() {
    String status;
    SearchServiceStatus serviceStatus = SearchServiceFactory.getService().getStatus();
    if (serviceStatus instanceof SearchServiceStatusImpl) {
        status = serviceStatus.getStatus();
    } else {
        status = "disabled";
    }
    return Response.ok(new IndexerStatus(status)).build();
}
Also used : IndexerStatus(org.olat.restapi.system.vo.IndexerStatus) FullIndexerStatus(org.olat.search.service.indexer.FullIndexerStatus) SearchServiceStatusImpl(org.olat.search.service.SearchServiceStatusImpl) SearchServiceStatus(org.olat.search.SearchServiceStatus) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 2 with IndexerStatus

use of org.olat.restapi.system.vo.IndexerStatus in project openolat by klemens.

the class IndexerWebService method getStatus.

/**
 * Return the status of the indexer: running, stopped
 * @response.representation.200.mediaType application/xml, application/json
 * @response.representation.200.doc The status of the indexer
 * @response.representation.401.doc The roles of the authenticated user are not sufficient
 * @return The status of the indexer
 */
@GET
@Path("status")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response getStatus() {
    String status;
    SearchServiceStatus serviceStatus = SearchServiceFactory.getService().getStatus();
    if (serviceStatus instanceof SearchServiceStatusImpl) {
        status = serviceStatus.getStatus();
    } else {
        status = "disabled";
    }
    return Response.ok(new IndexerStatus(status)).build();
}
Also used : IndexerStatus(org.olat.restapi.system.vo.IndexerStatus) FullIndexerStatus(org.olat.search.service.indexer.FullIndexerStatus) SearchServiceStatusImpl(org.olat.search.service.SearchServiceStatusImpl) SearchServiceStatus(org.olat.search.SearchServiceStatus) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 IndexerStatus (org.olat.restapi.system.vo.IndexerStatus)2 SearchServiceStatus (org.olat.search.SearchServiceStatus)2 SearchServiceStatusImpl (org.olat.search.service.SearchServiceStatusImpl)2 FullIndexerStatus (org.olat.search.service.indexer.FullIndexerStatus)2