001package jmri.server.json.consist; 002 003import com.fasterxml.jackson.databind.ObjectMapper; 004import jmri.server.json.JsonConnection; 005import jmri.spi.JsonServiceFactory; 006import org.openide.util.lookup.ServiceProvider; 007 008/** 009 * 010 * @author Randall Wood Copyright (C) 2016 011 */ 012@ServiceProvider(service = JsonServiceFactory.class) 013public class JsonConsistServiceFactory implements JsonServiceFactory<JsonConsistHttpService, JsonConsistSocketService> { 014 015 016 @Override 017 public String[] getTypes(String version) { 018 return new String[]{JsonConsist.CONSIST, JsonConsist.CONSISTS}; 019 } 020 021 @Override 022 public JsonConsistSocketService getSocketService(JsonConnection connection, String version) { 023 return new JsonConsistSocketService(connection); 024 } 025 026 @Override 027 public JsonConsistHttpService getHttpService(ObjectMapper mapper, String version) { 028 return new JsonConsistHttpService(mapper); 029 } 030 031}