public NamingEnumeration<SearchResult> search(String deviceName, String[] attrsArray, String filter) throws NamingException { return deviceName != null ? search(deviceRef(deviceName), filter, attrsArray) : ctx.search(devicesDN, filter, searchControlSubtreeScope(0, attrsArray, true)); }
@Override public synchronized Device findDevice(String name) throws ConfigurationException { if (!configurationExists()) throw new ConfigurationNotFoundException(); return loadDevice(deviceRef(name)); }
@Override public synchronized Device findDevice(String name) throws ConfigurationException { if (!configurationExists()) throw new ConfigurationNotFoundException(); return loadDevice(deviceRef(name)); }
public NamingEnumeration<SearchResult> search(String deviceName, String[] attrsArray, String filter) throws NamingException { return deviceName != null ? search(deviceRef(deviceName), filter, attrsArray) : ctx.search(devicesDN, filter, searchControlSubtreeScope(0, attrsArray, true)); }
@Override public synchronized ConfigurationChanges removeDevice(String name, EnumSet<Option> options) throws ConfigurationException { if (!configurationExists()) throw new ConfigurationNotFoundException(); String dn = deviceRef(name); removeDeviceWithDN(dn, options != null && options.contains(Option.REGISTER)); ConfigurationChanges diffs = new ConfigurationChanges(false); ConfigurationChanges.addModifiedObject(diffs, dn, ConfigurationChanges.ChangeType.D); return diffs; }
@Override public synchronized ConfigurationChanges removeDevice(String name, EnumSet<Option> options) throws ConfigurationException { if (!configurationExists()) throw new ConfigurationNotFoundException(); String dn = deviceRef(name); removeDeviceWithDN(dn, options != null && options.contains(Option.REGISTER)); ConfigurationChanges diffs = new ConfigurationChanges(false); ConfigurationChanges.addModifiedObject(diffs, dn, ConfigurationChanges.ChangeType.D); return diffs; }
@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); } }
throw new ConfigurationNotFoundException(); String deviceDN = deviceRef(device.getDeviceName()); Device prev = loadDevice(deviceDN); ArrayList<String> destroyDNs = new ArrayList<>();
@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; }
throw new ConfigurationNotFoundException(); String deviceDN = deviceRef(device.getDeviceName()); Device prev = loadDevice(deviceDN); ArrayList<String> destroyDNs = new ArrayList<>();
@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; }
ensureConfigurationExists(); String deviceName = device.getDeviceName(); String deviceDN = deviceRef(deviceName); boolean rollback = false; ArrayList<String> destroyDNs = new ArrayList<>();
ensureConfigurationExists(); String deviceName = device.getDeviceName(); String deviceDN = deviceRef(deviceName); boolean rollback = false; ArrayList<String> destroyDNs = new ArrayList<>();
deviceDN); LdapUtils.storeDiffObject(ldapObj, mods, "dcmAuditRecordRepositoryDeviceReference", config.deviceRef(a.getAuditRecordRepositoryDeviceNameNotNull()), config.deviceRef(b.getAuditRecordRepositoryDeviceNameNotNull()), null); LdapUtils.storeDiff(ldapObj, mods, "dcmAuditIncludeInstanceUID", a.isIncludeInstanceUID(),
deviceDN); LdapUtils.storeDiffObject(ldapObj, mods, "dcmAuditRecordRepositoryDeviceReference", config.deviceRef(a.getAuditRecordRepositoryDeviceNameNotNull()), config.deviceRef(b.getAuditRecordRepositoryDeviceNameNotNull()), null); LdapUtils.storeDiff(ldapObj, mods, "dcmAuditIncludeInstanceUID", a.isIncludeInstanceUID(),
LdapUtils.storeConnRefs(ldapObj, attrs, logger.getConnections(), deviceDN); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dcmAuditRecordRepositoryDeviceReference", config.deviceRef(logger.getAuditRecordRepositoryDeviceNameNotNull()), null); LdapUtils.storeNotDef(ldapObj, attrs, "dcmAuditIncludeInstanceUID", logger.isIncludeInstanceUID(), false);
LdapUtils.storeConnRefs(ldapObj, attrs, logger.getConnections(), deviceDN); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dcmAuditRecordRepositoryDeviceReference", config.deviceRef(logger.getAuditRecordRepositoryDeviceNameNotNull()), null); LdapUtils.storeNotDef(ldapObj, attrs, "dcmAuditIncludeInstanceUID", logger.isIncludeInstanceUID(), false);