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