@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); } }
private void loadFrom(ApplicationEntity ae, Attributes attrs) throws NamingException { ae.setDescription(LdapUtils.stringValue(attrs.get("dicomDescription"), null)); ae.setVendorData(byteArrays(attrs.get("dicomVendorData"))); ae.setApplicationClusters(LdapUtils.stringArray(attrs.get("dicomApplicationCluster"))); ae.setPreferredCallingAETitles(LdapUtils.stringArray(attrs.get("dicomPreferredCallingAETitle"))); ae.setPreferredCalledAETitles(LdapUtils.stringArray(attrs.get("dicomPreferredCalledAETitle"))); ae.setAssociationInitiator(LdapUtils.booleanValue(attrs.get("dicomAssociationInitiator"), false)); ae.setAssociationAcceptor(LdapUtils.booleanValue(attrs.get("dicomAssociationAcceptor"), false)); ae.setSupportedCharacterSets(LdapUtils.stringArray(attrs.get("dicomSupportedCharacterSet"))); ae.setInstalled(LdapUtils.booleanValue(attrs.get("dicomInstalled"), null)); if (!LdapUtils.hasObjectClass(attrs, "dcmNetworkAE")) return; ae.setAcceptedCallingAETitles(LdapUtils.stringArray(attrs.get("dcmAcceptedCallingAETitle"))); ae.setPreferredTransferSyntaxes(LdapUtils.removeOrdinalPrefix( LdapUtils.stringArray(attrs.get("dcmPreferredTransferSyntax")))); ae.setOtherAETitles(LdapUtils.stringArray(attrs.get("dcmOtherAETitle"))); ae.setMasqueradeCallingAETitles(LdapUtils.stringArray(attrs.get("dcmMasqueradeCallingAETitle"))); ae.setHl7ApplicationName(LdapUtils.stringValue(attrs.get("hl7ApplicationName"), null)); for (LdapDicomConfigurationExtension ext : extensions) ext.loadFrom(ae, attrs); }
private void loadFrom(ApplicationEntity ae, Attributes attrs) throws NamingException { ae.setDescription(LdapUtils.stringValue(attrs.get("dicomDescription"), null)); ae.setVendorData(byteArrays(attrs.get("dicomVendorData"))); ae.setApplicationClusters(LdapUtils.stringArray(attrs.get("dicomApplicationCluster"))); ae.setPreferredCallingAETitles(LdapUtils.stringArray(attrs.get("dicomPreferredCallingAETitle"))); ae.setPreferredCalledAETitles(LdapUtils.stringArray(attrs.get("dicomPreferredCalledAETitle"))); ae.setAssociationInitiator(LdapUtils.booleanValue(attrs.get("dicomAssociationInitiator"), false)); ae.setAssociationAcceptor(LdapUtils.booleanValue(attrs.get("dicomAssociationAcceptor"), false)); ae.setSupportedCharacterSets(LdapUtils.stringArray(attrs.get("dicomSupportedCharacterSet"))); ae.setInstalled(LdapUtils.booleanValue(attrs.get("dicomInstalled"), null)); if (!LdapUtils.hasObjectClass(attrs, "dcmNetworkAE")) return; ae.setAcceptedCallingAETitles(LdapUtils.stringArray(attrs.get("dcmAcceptedCallingAETitle"))); ae.setPreferredTransferSyntaxes(LdapUtils.removeOrdinalPrefix( LdapUtils.stringArray(attrs.get("dcmPreferredTransferSyntax")))); ae.setOtherAETitles(LdapUtils.stringArray(attrs.get("dcmOtherAETitle"))); ae.setMasqueradeCallingAETitles(LdapUtils.stringArray(attrs.get("dcmMasqueradeCallingAETitle"))); ae.setHl7ApplicationName(LdapUtils.stringValue(attrs.get("hl7ApplicationName"), null)); for (LdapDicomConfigurationExtension ext : extensions) ext.loadFrom(ae, attrs); }
@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; }
for (String dn : LdapUtils.stringArray(attrs.get("dicomThisNodeCertificateReference"))) device.setThisNodeCertificates(dn, loadCertificates(dn)); device.setVendorData(byteArrays(attrs.get("dicomVendorData"))); device.setInstalled(LdapUtils.booleanValue(attrs.get("dicomInstalled"), true)); if (!LdapUtils.hasObjectClass(attrs, "dcmDevice"))
for (String dn : LdapUtils.stringArray(attrs.get("dicomThisNodeCertificateReference"))) device.setThisNodeCertificates(dn, loadCertificates(dn)); device.setVendorData(byteArrays(attrs.get("dicomVendorData"))); device.setInstalled(LdapUtils.booleanValue(attrs.get("dicomInstalled"), true)); if (!LdapUtils.hasObjectClass(attrs, "dcmDevice"))