001package jmri.server.json.roster; 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 011 */ 012@ServiceProvider(service = JsonServiceFactory.class) 013public class JsonRosterServiceFactory implements JsonServiceFactory<JsonRosterHttpService, JsonRosterSocketService> { 014 015 @Override 016 public String[] getTypes(String version) { 017 return new String[]{JsonRoster.ROSTER, JsonRoster.ROSTER_ENTRY, JsonRoster.ROSTER_GROUPS, JsonRoster.ROSTER_GROUP}; 018 } 019 020 @Override 021 public JsonRosterSocketService getSocketService(JsonConnection connection, String version) { 022 return new JsonRosterSocketService(connection); 023 } 024 025 @Override 026 public JsonRosterHttpService getHttpService(ObjectMapper mapper, String version) { 027 return new JsonRosterHttpService(mapper); 028 } 029 030}