001package jmri.server.json.throttle;
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 JsonThrottleServiceFactory implements JsonServiceFactory<JsonThrottleHttpService, JsonThrottleSocketService> {
014
015    @Override
016    public String[] getTypes(String version) {
017        String[] types = {JsonThrottle.THROTTLE};
018        return types;
019    }
020
021    @Override
022    public JsonThrottleSocketService getSocketService(JsonConnection connection, String version) {
023        return new JsonThrottleSocketService(connection);
024    }
025
026    @Override
027    public JsonThrottleHttpService getHttpService(ObjectMapper mapper, String version) {
028        return new JsonThrottleHttpService(mapper);
029    }
030
031}