@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 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); } }
public synchronized Device findDevice(String filter, String childName) throws ConfigurationException { if (!configurationExists()) throw new ConfigurationNotFoundException(); SearchControls ctls = searchControlSubtreeScope(1, StringUtils.EMPTY_STRING, false); NamingEnumeration<SearchResult> ne = null; String childDN; try { ne = ctx.search(devicesDN, filter, ctls); if (!ne.hasMore()) throw new ConfigurationNotFoundException(childName); childDN = ne.next().getNameInNamespace(); } catch (NamingException e) { throw new ConfigurationException(e); } finally { LdapUtils.safeClose(ne); } String deviceDN = childDN.substring(childDN.indexOf(',') + 1); return loadDevice(deviceDN); }
@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); } }
public synchronized Device findDevice(String filter, String childName) throws ConfigurationException { if (!configurationExists()) throw new ConfigurationNotFoundException(); SearchControls ctls = searchControlSubtreeScope(1, StringUtils.EMPTY_STRING, false); NamingEnumeration<SearchResult> ne = null; String childDN; try { ne = ctx.search(devicesDN, filter, ctls); if (!ne.hasMore()) throw new ConfigurationNotFoundException(childName); childDN = ne.next().getNameInNamespace(); } catch (NamingException e) { throw new ConfigurationException(e); } finally { LdapUtils.safeClose(ne); } String deviceDN = childDN.substring(childDN.indexOf(',') + 1); return loadDevice(deviceDN); }
@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 ApplicationEntity findApplicationEntity(String aet) throws ConfigurationException { if (aet == null) throw new IllegalArgumentException("Requested AE's title cannot be null"); Iterator<?> search = lowLevelConfig.search(DicomPath.DeviceNameByAEName.set("aeName", aet).path()); if (!search.hasNext()) { search = lowLevelConfig.search(DicomPath.DeviceNameByAENameAlias.set("aeNameAlias", aet).path()); if (!search.hasNext()) throw new ConfigurationNotFoundException("AE '" + aet + "' not found"); } String deviceNameNode = (String) search.next(); if (search.hasNext()) log.warn("Application entity title '{}' is not unique. Check the configuration!", aet); Device device = findDevice(deviceNameNode); ApplicationEntity ae = device.getApplicationEntity(aet); if (ae == null) throw new NoSuchElementException("Unexpected error"); return ae; }