001package jmri.server.json.oblock;
002
003import com.fasterxml.jackson.databind.ObjectMapper;
004import jmri.server.json.JsonConnection;
005import jmri.spi.JsonServiceFactory;
006import org.openide.util.lookup.ServiceProvider;
007
008import static jmri.server.json.oblock.JsonOblock.OBLOCK;
009import static jmri.server.json.oblock.JsonOblock.OBLOCKS;
010
011/**
012 * Copied from jmri/server/json/blocks.java
013 *
014 * @author mstevetodd Copyright (C) 2018
015 * @author Randall Wood Copyright 2018
016 * @author Egbert Broerse Copyright 2020
017 */
018@ServiceProvider(service = JsonServiceFactory.class)
019public class JsonOblockServiceFactory implements JsonServiceFactory<JsonOblockHttpService, JsonOblockSocketService> {
020
021
022    @Override
023    public String[] getTypes(String version) {
024        return new String[]{OBLOCK, OBLOCKS};
025    }
026
027    @Override
028    public JsonOblockSocketService getSocketService(JsonConnection connection, String version) {
029        return new JsonOblockSocketService(connection);
030    }
031
032    @Override
033    public JsonOblockHttpService getHttpService(ObjectMapper mapper, String version) {
034        return new JsonOblockHttpService(mapper);
035    }
036
037}