}
@Override
protected void mergeChilds(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));
}
if (hl7Ext == null)
return;
for (HL7Application hl7app : hl7Ext.getHL7Applications()) {
String appName = hl7app.getApplicationName();
if (prevHL7Ext == null || !prevHL7Ext.containsHL7Application(appName)) {
String appDN = hl7appDN(hl7app.getApplicationName(), deviceDN);
config.createSubcontext(appDN,
storeTo(hl7app, deviceDN, new BasicAttributes(true)));