001package jmri.server.json.layoutblock;
002
003import static jmri.server.json.layoutblock.JsonLayoutBlock.LAYOUTBLOCK;
004import static jmri.server.json.layoutblock.JsonLayoutBlock.LAYOUTBLOCKS;
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 mstevetodd Copyright (C) 2018
014 * @author Randall Wood Copyright 2018
015 */
016@ServiceProvider(service = JsonServiceFactory.class)
017public class JsonLayoutBlockServiceFactory implements JsonServiceFactory<JsonLayoutBlockHttpService, JsonLayoutBlockSocketService> {
018
019
020    @Override
021    public String[] getTypes(String version) {
022        return new String[]{LAYOUTBLOCK, LAYOUTBLOCKS};
023    }
024
025    @Override
026    public JsonLayoutBlockSocketService getSocketService(JsonConnection connection, String version) {
027        return new JsonLayoutBlockSocketService(connection);
028    }
029
030    @Override
031    public JsonLayoutBlockHttpService getHttpService(ObjectMapper mapper, String version) {
032        return new JsonLayoutBlockHttpService(mapper);
033    }
034
035}