001package jmri.server.json.audioicon; 002 003import com.fasterxml.jackson.databind.ObjectMapper; 004 005import jmri.server.json.JsonConnection; 006import jmri.spi.JsonServiceFactory; 007 008import org.openide.util.lookup.ServiceProvider; 009 010/** 011 * Factory for JSON service providers for handling {@link jmri.jmrit.display.AudioIcon}s. 012 * 013 * @author Randall Wood 014 * @author Daniel Bergqvist (C) 2023 015 */ 016@ServiceProvider(service = JsonServiceFactory.class) 017public class JsonAudioIconServiceFactory implements JsonServiceFactory<JsonAudioIconHttpService, JsonAudioIconSocketService> { 018 019 public static final String AUDIO_ICON = "audioicon"; // NOI18N 020 021 @Override 022 public String[] getTypes(String version) { 023 return new String[]{AUDIO_ICON}; 024 } 025 026 @Override 027 public JsonAudioIconSocketService getSocketService(JsonConnection connection, String version) { 028 return new JsonAudioIconSocketService(connection); 029 } 030 031 @Override 032 public JsonAudioIconHttpService getHttpService(ObjectMapper mapper, String version) { 033 return new JsonAudioIconHttpService(mapper); 034 } 035 036}