@Override public Device findDevice(String deviceName) throws ConfigurationException { Device device = get(deviceName); if (device == null) throw new ConfigurationNotFoundException("Unknown Device: " + deviceName); if (!device.isInstalled()) throw new ConfigurationNotFoundException("Device: " + deviceName + " not installed"); return device; } }
public ApplicationEntity findApplicationEntity(String aet) throws ConfigurationException { ApplicationEntity ae = get(aet); if (ae == null) throw new ConfigurationNotFoundException( "Unknown AE: " + aet); if (!ae.isInstalled()) throw new ConfigurationNotFoundException( "AE: " + aet + " not installed"); return ae; } }
public HL7Application findHL7Application(String name) throws ConfigurationException { HL7Application ae = get(name); if (ae == null) throw new ConfigurationNotFoundException( "Unknown HL7 Application: " + name); return ae; } }
@Override public Device findDevice(String deviceName) throws ConfigurationException { Device device = get(deviceName); if (device == null) throw new ConfigurationNotFoundException("Unknown Device: " + deviceName); if (!device.isInstalled()) throw new ConfigurationNotFoundException("Device: " + deviceName + " not installed"); return device; } }
public HL7Application findHL7Application(String name) throws ConfigurationException { HL7Application ae = get(name); if (ae == null) throw new ConfigurationNotFoundException( "Unknown HL7 Application: " + name); return ae; } }
public ApplicationEntity findApplicationEntity(String aet) throws ConfigurationException { ApplicationEntity ae = get(aet); if (ae == null) throw new ConfigurationNotFoundException( "Unknown AE: " + aet); if (!ae.isInstalled()) throw new ConfigurationNotFoundException( "AE: " + aet + " not installed"); return ae; } }
@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 Device findDeviceByUUID(String uuid) throws ConfigurationException { if (uuid == null) throw new IllegalArgumentException("Requested Device's uuid cannot be null"); Iterator search = lowLevelConfig.search(DicomPath.DeviceNameByUUID.set("deviceUUID", uuid).path()); try { String deviceNameNode = (String) search.next(); return findDevice(deviceNameNode); } catch (NoSuchElementException e) { throw new ConfigurationNotFoundException("Device with UUID '" + uuid + "' not found", e); } }
@Override public synchronized X509Certificate[] findCertificates(String dn) throws ConfigurationException { try { return loadCertificates(dn); } catch (NameNotFoundException e) { throw new ConfigurationNotFoundException(e); } catch (NamingException e) { throw new ConfigurationException(e); } catch (CertificateException e) { throw new ConfigurationException(e); } }
@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)); }
private void removeDeviceWithDN(String deviceDN, boolean unregister) throws ConfigurationException { try { ArrayList<String> destroyDNs = new ArrayList<>(); if (unregister) markForUnregister(deviceDN, destroyDNs); destroySubcontextWithChilds(deviceDN); unregister(destroyDNs); } catch (NameNotFoundException e) { throw new ConfigurationNotFoundException(e); } catch (NamingException e) { throw new ConfigurationException(e); } }
@Override public synchronized void persistCertificates(String dn, X509Certificate... certs) throws ConfigurationException { try { storeCertificates(dn, certs); } catch (NameNotFoundException e) { throw new ConfigurationNotFoundException(e); } catch (NamingException e) { throw new ConfigurationException(e); } catch (CertificateEncodingException e) { throw new ConfigurationException(e); } }
@Override public synchronized X509Certificate[] findCertificates(String dn) throws ConfigurationException { try { return loadCertificates(dn); } catch (NameNotFoundException e) { throw new ConfigurationNotFoundException(e); } catch (NamingException e) { throw new ConfigurationException(e); } catch (CertificateException e) { throw new ConfigurationException(e); } }
@Override public synchronized void persistCertificates(String dn, X509Certificate... certs) throws ConfigurationException { try { storeCertificates(dn, certs); } catch (NameNotFoundException e) { throw new ConfigurationNotFoundException(e); } catch (NamingException e) { throw new ConfigurationException(e); } catch (CertificateEncodingException e) { throw new ConfigurationException(e); } }
private void removeDeviceWithDN(String deviceDN, boolean unregister) throws ConfigurationException { try { ArrayList<String> destroyDNs = new ArrayList<>(); if (unregister) markForUnregister(deviceDN, destroyDNs); destroySubcontextWithChilds(deviceDN); unregister(destroyDNs); } catch (NameNotFoundException e) { throw new ConfigurationNotFoundException(e); } catch (NamingException e) { throw new ConfigurationException(e); } }
@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 synchronized void removeCertificates(String dn) throws ConfigurationException { try { ModificationItem removeCert = new ModificationItem( DirContext.REMOVE_ATTRIBUTE, new BasicAttribute(userCertificate)); ctx.modifyAttributes(dn, new ModificationItem[] { removeCert }); } catch (NameNotFoundException e) { throw new ConfigurationNotFoundException(e); } catch (NamingException e) { throw new ConfigurationException(e); } }
@Override public synchronized void removeCertificates(String dn) throws ConfigurationException { try { ModificationItem removeCert = new ModificationItem( DirContext.REMOVE_ATTRIBUTE, new BasicAttribute(userCertificate)); ctx.modifyAttributes(dn, new ModificationItem[] { removeCert }); } catch (NameNotFoundException e) { throw new ConfigurationNotFoundException(e); } catch (NamingException e) { throw new ConfigurationException(e); } }