Search in sources :

Example 1 with IndexTimestamp

use of org.opengrok.indexer.configuration.IndexTimestamp in project OpenGrok by OpenGrok.

the class SystemController method getIndexTime.

@GET
@Path("/indextime")
@Produces(MediaType.APPLICATION_JSON)
public String getIndexTime() throws JsonProcessingException {
    Date date = new IndexTimestamp().getDateForLastIndexRun();
    ObjectMapper mapper = new ObjectMapper();
    // StdDateFormat is ISO8601 since jackson 2.9
    mapper.setDateFormat(new StdDateFormat().withColonInTimeZone(true));
    return mapper.writeValueAsString(date);
}
Also used : IndexTimestamp(org.opengrok.indexer.configuration.IndexTimestamp) StdDateFormat(com.fasterxml.jackson.databind.util.StdDateFormat) Date(java.util.Date) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Path(jakarta.ws.rs.Path) Produces(jakarta.ws.rs.Produces) GET(jakarta.ws.rs.GET)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 StdDateFormat (com.fasterxml.jackson.databind.util.StdDateFormat)1 GET (jakarta.ws.rs.GET)1 Path (jakarta.ws.rs.Path)1 Produces (jakarta.ws.rs.Produces)1 Date (java.util.Date)1 IndexTimestamp (org.opengrok.indexer.configuration.IndexTimestamp)1