Attributes attrs = getAttributes(deviceDN); Device device = new Device(LdapUtils.stringValue(attrs.get("dicomDeviceName"), null));
Attributes attrs = getAttributes(deviceDN); Device device = new Device(LdapUtils.stringValue(attrs.get("dicomDeviceName"), null));
@Override public byte[][] loadDeviceVendorData(String deviceName) throws ConfigurationException { if (!configurationExists()) throw new ConfigurationNotFoundException(); try { Attributes attrs = getAttributes(deviceRef(deviceName), new String[]{ "dicomVendorData" }); return byteArrays(attrs.get("dicomVendorData")); } catch (NameNotFoundException e) { throw new ConfigurationNotFoundException("Device with specified name not found", e); } catch (NamingException e) { throw new ConfigurationException(e); } }
@Override public byte[][] loadDeviceVendorData(String deviceName) throws ConfigurationException { if (!configurationExists()) throw new ConfigurationNotFoundException(); try { Attributes attrs = getAttributes(deviceRef(deviceName), new String[]{ "dicomVendorData" }); return byteArrays(attrs.get("dicomVendorData")); } catch (NameNotFoundException e) { throw new ConfigurationNotFoundException("Device with specified name not found", e); } catch (NamingException e) { throw new ConfigurationException(e); } }
String imageReadersDN = CN_IMAGE_READER_FACTORY + deviceDN; try { config.getAttributes(imageReadersDN); } catch (NameNotFoundException e) { return;
String imageWritersDN = CN_IMAGE_WRITER_FACTORY + deviceDN; try { config.getAttributes(imageWritersDN); } catch (NameNotFoundException e) { return;
@Override protected void loadChilds(Device device, String deviceDN) throws NamingException { Attributes attrs; try { attrs = config.getAttributes(CN_AUDIT_RECORD_REPOSITORY + deviceDN); } catch (NameNotFoundException e) { return; } AuditRecordRepository arr = new AuditRecordRepository(); loadFrom(arr, attrs); for (String connDN : LdapUtils.stringArray( attrs.get("dicomNetworkConnectionReference"))) arr.addConnection( LdapUtils.findConnection(connDN, deviceDN, device)); device.addDeviceExtension(arr); }
@Override protected void loadChilds(Device device, String deviceDN) throws NamingException { Attributes attrs; try { attrs = config.getAttributes(CN_AUDIT_RECORD_REPOSITORY + deviceDN); } catch (NameNotFoundException e) { return; } AuditRecordRepository arr = new AuditRecordRepository(); loadFrom(arr, attrs); for (String connDN : LdapUtils.stringArray( attrs.get("dicomNetworkConnectionReference"))) arr.addConnection( LdapUtils.findConnection(connDN, deviceDN, device)); device.addDeviceExtension(arr); }
@Override public ConfigurationChanges updateDeviceVendorData(String deviceName, byte[]... vendorData) throws ConfigurationException { String deviceRef = deviceRef(deviceName); if (!configurationExists()) throw new ConfigurationNotFoundException(); ConfigurationChanges diffs = new ConfigurationChanges(false); try { Attributes attrs = getAttributes(deviceRef, new String[]{"dicomVendorData"}); byte[][] prev = byteArrays(attrs.get("dicomVendorData")); ConfigurationChanges.ModifiedObject ldapObj = ConfigurationChanges.addModifiedObject(diffs, deviceRef, ConfigurationChanges.ChangeType.C); List<ModificationItem> mods = new ArrayList<>(1); storeDiff(ldapObj, mods, "dicomVendorData", prev, vendorData); modifyAttributes(deviceRef, mods); } catch (NameNotFoundException e) { throw new ConfigurationNotFoundException("Device with specified name not found", e); } catch (NamingException e) { throw new ConfigurationException(e); } return diffs; }
@Override public ConfigurationChanges updateDeviceVendorData(String deviceName, byte[]... vendorData) throws ConfigurationException { String deviceRef = deviceRef(deviceName); if (!configurationExists()) throw new ConfigurationNotFoundException(); ConfigurationChanges diffs = new ConfigurationChanges(false); try { Attributes attrs = getAttributes(deviceRef, new String[]{"dicomVendorData"}); byte[][] prev = byteArrays(attrs.get("dicomVendorData")); ConfigurationChanges.ModifiedObject ldapObj = ConfigurationChanges.addModifiedObject(diffs, deviceRef, ConfigurationChanges.ChangeType.C); List<ModificationItem> mods = new ArrayList<>(1); storeDiff(ldapObj, mods, "dicomVendorData", prev, vendorData); modifyAttributes(deviceRef, mods); } catch (NameNotFoundException e) { throw new ConfigurationNotFoundException("Device with specified name not found", e); } catch (NamingException e) { throw new ConfigurationException(e); } return diffs; }