public HL7Application getHL7Application(String name, boolean matchOtherAppNames) { HL7Application app = hl7apps.get(name); if (app == null) app = hl7apps.get("*"); if (app == null && matchOtherAppNames) for (HL7Application app1 : getHL7Applications()) if (app1.isOtherApplicationName(name)) return app1; return app; }
@Override protected void storeChilds(ConfigurationChanges diffs, String deviceDN, Device device) throws NamingException { HL7DeviceExtension hl7Ext = device.getDeviceExtension(HL7DeviceExtension.class); if (hl7Ext == null) return; for (HL7Application hl7App : hl7Ext.getHL7Applications()) store(diffs, hl7App, deviceDN); }
@Override protected void storeTo(Device device, JsonWriter writer) { HL7DeviceExtension ext = device.getDeviceExtension(HL7DeviceExtension.class); if (ext == null) return; writer.writeStartArray("hl7Application"); for (HL7Application hl7App : ext.getHL7Applications()) writeTo(device, hl7App, writer); writer.writeEnd(); }
@Override protected void storeTo(Device device, JsonWriter writer) { HL7DeviceExtension ext = device.getDeviceExtension(HL7DeviceExtension.class); if (ext == null) return; writer.writeStartArray("hl7Application"); for (HL7Application hl7App : ext.getHL7Applications()) writeTo(device, hl7App, writer); writer.writeEnd(); }
@Override protected void mergeChilds(ConfigurationChanges diffs, Device prev, Device device, String deviceDN) throws NamingException { HL7DeviceExtension prevHL7Ext = prev.getDeviceExtension(HL7DeviceExtension.class); HL7DeviceExtension hl7Ext = device.getDeviceExtension(HL7DeviceExtension.class); if (prevHL7Ext != null) for (String appName : prevHL7Ext.getHL7ApplicationNames()) { if (hl7Ext == null || !hl7Ext.containsHL7Application(appName)) { config.destroySubcontextWithChilds(hl7appDN(appName, deviceDN)); ConfigurationChanges.addModifiedObject(diffs, hl7appDN(appName, deviceDN), ConfigurationChanges.ChangeType.D); } } if (hl7Ext == null) return; for (HL7Application hl7app : hl7Ext.getHL7Applications()) { String appName = hl7app.getApplicationName(); if (prevHL7Ext == null || !prevHL7Ext.containsHL7Application(appName)) { store(diffs, hl7app, deviceDN); } else merge(diffs, prevHL7Ext.getHL7Application(appName), hl7app, deviceDN); } }