001package jmri.server.json.signalmast; 002 003import com.fasterxml.jackson.databind.ObjectMapper; 004import jmri.server.json.JsonConnection; 005import jmri.spi.JsonServiceFactory; 006 007import static jmri.server.json.signalmast.JsonSignalMast.SIGNAL_MAST; 008import static jmri.server.json.signalmast.JsonSignalMast.SIGNAL_MASTS; 009 010import org.openide.util.lookup.ServiceProvider; 011 012/** 013 * 014 * @author Randall Wood (C) 2016 015 */ 016@ServiceProvider(service = JsonServiceFactory.class) 017public class JsonSignalMastServiceFactory implements JsonServiceFactory<JsonSignalMastHttpService, JsonSignalMastSocketService> { 018 019 @Override 020 public String[] getTypes(String version) { 021 return new String[]{SIGNAL_MAST, SIGNAL_MASTS}; 022 } 023 024 @Override 025 public JsonSignalMastSocketService getSocketService(JsonConnection connection, String version) { 026 return new JsonSignalMastSocketService(connection); 027 } 028 029 @Override 030 public JsonSignalMastHttpService getHttpService(ObjectMapper mapper, String version) { 031 return new JsonSignalMastHttpService(mapper); 032 } 033 034}