001package jmri.server.json.turnout; 002 003import com.fasterxml.jackson.databind.ObjectMapper; 004import jmri.server.json.JsonConnection; 005import jmri.spi.JsonServiceFactory; 006import org.openide.util.lookup.ServiceProvider; 007 008/** 009 * 010 * @author Randall Wood 011 */ 012@ServiceProvider(service = JsonServiceFactory.class) 013public class JsonTurnoutServiceFactory implements JsonServiceFactory<JsonTurnoutHttpService, JsonTurnoutSocketService> { 014 015 @Override 016 public String[] getTypes(String version) { 017 return new String[]{JsonTurnout.TURNOUT, JsonTurnout.TURNOUTS}; 018 } 019 020 @Override 021 public JsonTurnoutSocketService getSocketService(JsonConnection connection, String version) { 022 return new JsonTurnoutSocketService(connection); 023 } 024 025 @Override 026 public JsonTurnoutHttpService getHttpService(ObjectMapper mapper, String version) { 027 return new JsonTurnoutHttpService(mapper); 028 } 029 030}