001package jmri.server.json.block; 002 003import static jmri.server.json.block.JsonBlock.BLOCK; 004import static jmri.server.json.block.JsonBlock.BLOCKS; 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 JsonBlockServiceFactory implements JsonServiceFactory<JsonBlockHttpService, JsonBlockSocketService> { 018 019 020 @Override 021 public String[] getTypes(String version) { 022 return new String[]{BLOCK, BLOCKS}; 023 } 024 025 @Override 026 public JsonBlockSocketService getSocketService(JsonConnection connection, String version) { 027 return new JsonBlockSocketService(connection); 028 } 029 030 @Override 031 public JsonBlockHttpService getHttpService(ObjectMapper mapper, String version) { 032 return new JsonBlockHttpService(mapper); 033 } 034 035}