001package jmri.server.json.reporter; 002 003import static jmri.server.json.reporter.JsonReporter.REPORTER; 004import static jmri.server.json.reporter.JsonReporter.REPORTERS; 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 (C) 2016 014 */ 015@ServiceProvider(service = JsonServiceFactory.class) 016public class JsonReporterServiceFactory implements JsonServiceFactory<JsonReporterHttpService, JsonReporterSocketService> { 017 018 @Override 019 public String[] getTypes(String version) { 020 return new String[]{REPORTER, REPORTERS}; 021 } 022 023 @Override 024 public JsonReporterSocketService getSocketService(JsonConnection connection, String version) { 025 return new JsonReporterSocketService(connection); 026 } 027 028 @Override 029 public JsonReporterHttpService getHttpService(ObjectMapper mapper, String version) { 030 return new JsonReporterHttpService(mapper); 031 } 032 033}