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