001package jmri.server.json.logixngicon;
002
003import com.fasterxml.jackson.databind.ObjectMapper;
004
005import jmri.server.json.JsonConnection;
006import jmri.spi.JsonServiceFactory;
007
008import org.openide.util.lookup.ServiceProvider;
009
010/**
011 * Factory for JSON service providers for handling {@link jmri.jmrit.display.LogixNGIcon}s.
012 *
013 * @author Randall Wood
014 * @author Daniel Bergqvist (C) 2023
015 */
016@ServiceProvider(service = JsonServiceFactory.class)
017public class JsonLogixNGIconServiceFactory implements JsonServiceFactory<JsonLogixNGIconHttpService, JsonLogixNGIconSocketService> {
018
019    public static final String LOGIXNG_ICON = "logixngicon"; // NOI18N
020
021    @Override
022    public String[] getTypes(String version) {
023        return new String[]{LOGIXNG_ICON};
024    }
025
026    @Override
027    public JsonLogixNGIconSocketService getSocketService(JsonConnection connection, String version) {
028        return new JsonLogixNGIconSocketService(connection);
029    }
030
031    @Override
032    public JsonLogixNGIconHttpService getHttpService(ObjectMapper mapper, String version) {
033        return new JsonLogixNGIconHttpService(mapper);
034    }
035
036}