public void setApplicationName(String name) { if (name.isEmpty()) throw new IllegalArgumentException("name cannot be empty"); HL7DeviceExtension ext = device != null ? device.getDeviceExtension(HL7DeviceExtension.class) : null; if (ext != null) ext.removeHL7Application(this.name); this.name = name; if (ext != null) ext.addHL7Application(this); }
private void reconfigureHL7Applications(HL7DeviceExtension from) { hl7apps.keySet().retainAll(from.hl7apps.keySet()); for (HL7Application src : from.hl7apps.values()) { HL7Application hl7app = hl7apps.get(src.getApplicationName()); if (hl7app == null) addHL7Application(hl7app = new HL7Application(src.getApplicationName())); hl7app.reconfigure(src); } } }
@Override protected void loadChilds(Device device, String deviceDN) throws NamingException, ConfigurationException { NamingEnumeration<SearchResult> ne = config.search(deviceDN, "(objectclass=hl7Application)"); try { if (!ne.hasMore()) return; HL7DeviceExtension hl7Ext = new HL7DeviceExtension(); device.addDeviceExtension(hl7Ext); do { hl7Ext.addHL7Application( loadHL7Application(ne.next(), deviceDN, device)); } while (ne.hasMore()); } finally { LdapUtils.safeClose(ne); } }
public HL7Rcv() throws IOException { conn.setProtocol(Protocol.HL7); device.addDeviceExtension(hl7Ext); device.addConnection(conn); hl7Ext.addHL7Application(hl7App); hl7App.setAcceptedMessageTypes("*"); hl7App.addConnection(conn); hl7App.setHL7MessageListener(handler); }
public HL7Rcv() throws IOException { conn.setProtocol(Protocol.HL7); device.addDeviceExtension(hl7Ext); device.addConnection(conn); hl7Ext.addHL7Application(hl7App); hl7App.setAcceptedMessageTypes("*"); hl7App.addConnection(conn); hl7App.setHL7MessageListener(handler); }
private void loadFrom(HL7DeviceExtension ext, JsonReader reader, Device device, ConfigurationDelegate config) throws ConfigurationException { List<Connection> conns = device.listConnections(); reader.next(); reader.expect(JsonParser.Event.START_ARRAY); while (reader.next() == JsonParser.Event.START_OBJECT) { HL7Application hl7App = new HL7Application(); loadFrom(hl7App, reader, device, conns, config); reader.expect(JsonParser.Event.END_OBJECT); ext.addHL7Application(hl7App); } reader.expect(JsonParser.Event.END_ARRAY); }
private void loadFrom(HL7DeviceExtension ext, JsonReader reader, Device device, ConfigurationDelegate config) throws ConfigurationException { List<Connection> conns = device.listConnections(); reader.next(); reader.expect(JsonParser.Event.START_ARRAY); while (reader.next() == JsonParser.Event.START_OBJECT) { HL7Application hl7App = new HL7Application(); loadFrom(hl7App, reader, device, conns, config); reader.expect(JsonParser.Event.END_OBJECT); ext.addHL7Application(hl7App); } reader.expect(JsonParser.Event.END_ARRAY); }