Search in sources :

Example 1 with EngineList

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;
}
Also used : EngineList(org.jumpmind.symmetric.web.rest.model.EngineList) ISymmetricEngine(org.jumpmind.symmetric.ISymmetricEngine) ISymmetricEngine(org.jumpmind.symmetric.ISymmetricEngine) Engine(org.jumpmind.symmetric.web.rest.model.Engine) ServerSymmetricEngine(org.jumpmind.symmetric.web.ServerSymmetricEngine) ServerSymmetricEngine(org.jumpmind.symmetric.web.ServerSymmetricEngine) ResponseStatus(org.springframework.web.bind.annotation.ResponseStatus) ApiOperation(com.wordnik.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

ApiOperation (com.wordnik.swagger.annotations.ApiOperation)1 ISymmetricEngine (org.jumpmind.symmetric.ISymmetricEngine)1 ServerSymmetricEngine (org.jumpmind.symmetric.web.ServerSymmetricEngine)1 Engine (org.jumpmind.symmetric.web.rest.model.Engine)1 EngineList (org.jumpmind.symmetric.web.rest.model.EngineList)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1 ResponseStatus (org.springframework.web.bind.annotation.ResponseStatus)1