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