001package jmri.server.json.schema;
002
003import com.fasterxml.jackson.databind.ObjectMapper;
004import jmri.server.json.JSON;
005import jmri.server.json.JsonConnection;
006import jmri.spi.JsonServiceFactory;
007import org.openide.util.lookup.ServiceProvider;
008
009/**
010 * Factory for JSON service providers for handling {@link jmri.Route}s.
011 *
012 * @author Randall Wood
013 */
014@ServiceProvider(service = JsonServiceFactory.class)
015public class JsonSchemaServiceFactory implements JsonServiceFactory<JsonSchemaHttpService, JsonSchemaSocketService> {
016
017    @Override
018    public String[] getTypes(String version) {
019        return new String[]{JSON.JSON, JSON.SCHEMA, JSON.TYPE};
020    }
021
022    @Override
023    public JsonSchemaSocketService getSocketService(JsonConnection connection, String version) {
024        return new JsonSchemaSocketService(connection);
025    }
026
027    @Override
028    public JsonSchemaHttpService getHttpService(ObjectMapper mapper, String version) {
029        return new JsonSchemaHttpService(mapper);
030    }
031
032}