use of org.olat.search.SearchServiceStatus 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();
}
use of org.olat.search.SearchServiceStatus in project OpenOLAT by OpenOLAT.
the class IndexerWebService method getPlainTextStatus.
/**
* Return the status of the indexer: running, stopped
* @response.representation.200.mediaType text/plain
* @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.TEXT_PLAIN })
public Response getPlainTextStatus() {
String status;
SearchServiceStatus serviceStatus = SearchServiceFactory.getService().getStatus();
if (serviceStatus instanceof SearchServiceStatusImpl) {
status = serviceStatus.getStatus();
} else {
status = "disabled";
}
return Response.ok(status).build();
}
use of org.olat.search.SearchServiceStatus in project openolat by klemens.
the class SearchServiceImpl method stop.
@Override
public void stop() {
SearchServiceStatus status = getStatus();
String statusStr = status.getStatus();
if (statusStr.equals(FullIndexerStatus.STATUS_RUNNING)) {
stopIndexing();
}
try {
if (indexSearcherRefMgr != null) {
indexSearcherRefMgr.close();
indexSearcherRefMgr = null;
}
} catch (Exception e) {
log.error("", e);
}
}
use of org.olat.search.SearchServiceStatus in project openolat by klemens.
the class IndexerWebService method getIndexerStatistics.
protected IndexerStatisticsVO getIndexerStatistics() {
IndexerStatisticsVO stats = new IndexerStatisticsVO();
SearchServiceStatus status = SearchServiceFactory.getService().getStatus();
if (status instanceof SearchServiceStatusImpl) {
SearchServiceStatusImpl statusImpl = (SearchServiceStatusImpl) status;
FullIndexerStatus fStatus = statusImpl.getFullIndexerStatus();
stats.setIndexedDocumentCount(fStatus.getDocumentCount());
stats.setExcludedDocumentCount(fStatus.getExcludedDocumentCount());
stats.setIndexSize(fStatus.getIndexSize());
stats.setIndexingTime(fStatus.getIndexingTime());
stats.setFullIndexStartedAt(fStatus.getFullIndexStartedAt());
stats.setDocumentQueueSize(fStatus.getDocumentQueueSize());
stats.setRunningFolderIndexerCount(fStatus.getNumberRunningFolderIndexer());
stats.setAvailableFolderIndexerCount(fStatus.getNumberAvailableFolderIndexer());
stats.setLastFullIndexTime(fStatus.getLastFullIndexDateString());
stats.setStatus(status.getStatus());
} else {
stats.setStatus("disabled");
}
return stats;
}
use of org.olat.search.SearchServiceStatus in project OpenOLAT by OpenOLAT.
the class MonitoringService method getStatistics.
public Statistics getStatistics() {
Statistics statistics = new Statistics();
SessionsVO sessionsVo = new OpenOLATStatisticsWebService().getSessionsVO();
statistics.setSessionsVo(sessionsVo);
SearchServiceStatus status = SearchServiceFactory.getService().getStatus();
if (status instanceof SearchServiceStatusImpl) {
SearchServiceStatusImpl statusImpl = (SearchServiceStatusImpl) status;
FullIndexerStatus fStatus = statusImpl.getFullIndexerStatus();
statistics.setLastFullIndexTime(fStatus.getLastFullIndexDateString());
}
// activeUserCount="88" // registered and activated identities, same as in GUI
if (start < 1 || (System.currentTimeMillis() - start) > RENEW_RATE) {
start = System.currentTimeMillis();
activeUserCount = securityManager.countIdentitiesByPowerSearch(null, null, false, null, null, null, null, null, null, null, Constants.USERSTATUS_ACTIVE);
totalGroupCount = businessGroupService.countBusinessGroups(null, null);
publishedCourses = repositoryManager.countPublished(CourseModule.ORES_TYPE_COURSE);
}
statistics.setActiveUserCount(activeUserCount);
statistics.setTotalGroupCount(totalGroupCount);
statistics.setPublishedCourses(publishedCourses);
DatabaseConnectionVO connections = databaseStatsManager.getConnectionInfos();
if (connections != null) {
statistics.setActiveConnectionCount(connections.getActiveConnectionCount());
statistics.setCurrentConnectionCount(connections.getCurrentConnectionCount());
}
return statistics;
}
Aggregations