use of org.jumpmind.symmetric.web.rest.model.EngineList in project symmetric-ds by JumpMind.
the class RestService method getEngineList.
/**
* Provides a list of {@link Engine} that are configured on the node.
*
* @return {@link EngineList} - Engines configured on the node <br>
*
* <pre>
* Example xml reponse is as follows:<br><br>
* {@code
* <enginelist>
* <engines>
* <name>RootSugarDB-root</name>
* </engines>
* </enginelist>
* }
* <br>
* Example json response is as follows:<br><br>
* {"engines":[{"name":"RootSugarDB-root"}]}
* </pre>
*/
@ApiOperation(value = "Obtain a list of configured Engines")
@RequestMapping(value = "/enginelist", method = RequestMethod.GET)
@ResponseStatus(HttpStatus.OK)
@ResponseBody
public final EngineList getEngineList() {
EngineList list = new EngineList();
Collection<ServerSymmetricEngine> engines = getSymmetricEngineHolder().getEngines().values();
for (ISymmetricEngine engine : engines) {
if (engine.getParameterService().is(ParameterConstants.REST_API_ENABLED)) {
list.addEngine(new Engine(engine.getEngineName()));
}
}
return list;
}
Aggregations