@Override public synchronized HL7ApplicationInfo[] listHL7AppInfos(HL7ApplicationInfo keys) throws ConfigurationException { if (!config.configurationExists()) return new HL7ApplicationInfo[0]; ArrayList<HL7ApplicationInfo> results = new ArrayList<HL7ApplicationInfo>(); NamingEnumeration<SearchResult> ne = null; try { String deviceName = keys.getDeviceName(); ne = config.search(deviceName, HL7_ATTRS, toFilter(keys)); while (ne.hasMore()) { HL7ApplicationInfo hl7AppInfo = new HL7ApplicationInfo(); SearchResult ne1 = ne.next(); loadFrom(hl7AppInfo, ne1.getAttributes(), deviceName != null ? deviceName : LdapUtils.cutDeviceName(ne1.getName())); results.add(hl7AppInfo); } } catch (NameNotFoundException e) { return new HL7ApplicationInfo[0]; } catch (NamingException e) { throw new ConfigurationException(e); } finally { LdapUtils.safeClose(ne); } return results.toArray(new HL7ApplicationInfo[results.size()]); }
public void writeTo(HL7ApplicationInfo hl7AppInfo, JsonGenerator gen) { JsonWriter writer = new JsonWriter(gen); gen.writeStartObject(); writer.writeNotNullOrDef("dicomDeviceName", hl7AppInfo.getDeviceName(), null); writer.writeNotNullOrDef("hl7ApplicationName", hl7AppInfo.getHl7ApplicationName(), null); writer.writeNotEmpty("hl7OtherApplicationName", hl7AppInfo.getHl7OtherApplicationName()); writer.writeNotNullOrDef("dicomDescription", hl7AppInfo.getDescription(), null); writer.writeNotEmpty("dicomApplicationCluster", hl7AppInfo.getApplicationClusters()); writer.writeNotNull("dicomInstalled", hl7AppInfo.getInstalled()); writeNotExtendedConns(hl7AppInfo.getConnections(), writer); gen.writeEnd(); }
public void writeTo(HL7ApplicationInfo hl7AppInfo, JsonGenerator gen) { JsonWriter writer = new JsonWriter(gen); gen.writeStartObject(); writer.writeNotNullOrDef("dicomDeviceName", hl7AppInfo.getDeviceName(), null); writer.writeNotNullOrDef("hl7ApplicationName", hl7AppInfo.getHl7ApplicationName(), null); writer.writeNotEmpty("hl7OtherApplicationName", hl7AppInfo.getHl7OtherApplicationName()); writer.writeNotNullOrDef("dicomDescription", hl7AppInfo.getDescription(), null); writer.writeNotEmpty("dicomApplicationCluster", hl7AppInfo.getApplicationClusters()); writer.writeNotNull("dicomInstalled", hl7AppInfo.getInstalled()); writeNotExtendedConns(hl7AppInfo.getConnections(), writer); gen.writeEnd(); }