public static void storeDiffWithOrdinalPrefix(ConfigurationChanges.ModifiedObject ldapObj, List<ModificationItem> mods, String attrId, String[] prevs, String[] vals) { if (!Arrays.equals(prevs, vals)) { String[] valsWithOrdinalPrefix = addOrdinalPrefix(vals); mods.add((vals.length == 0) ? new ModificationItem(DirContext.REMOVE_ATTRIBUTE, new BasicAttribute(attrId)) : new ModificationItem(DirContext.REPLACE_ATTRIBUTE, attr(attrId, valsWithOrdinalPrefix))); if (ldapObj != null) { ConfigurationChanges.ModifiedAttribute attribute = new ConfigurationChanges.ModifiedAttribute(attrId); for (String val : valsWithOrdinalPrefix) attribute.addValue(val); for (String prev : addOrdinalPrefix(prevs)) attribute.removeValue(prev); ldapObj.add(attribute); } } }
public static void storeDiffWithOrdinalPrefix(ConfigurationChanges.ModifiedObject ldapObj, List<ModificationItem> mods, String attrId, String[] prevs, String[] vals) { if (!Arrays.equals(prevs, vals)) { String[] valsWithOrdinalPrefix = addOrdinalPrefix(vals); mods.add((vals.length == 0) ? new ModificationItem(DirContext.REMOVE_ATTRIBUTE, new BasicAttribute(attrId)) : new ModificationItem(DirContext.REPLACE_ATTRIBUTE, attr(attrId, valsWithOrdinalPrefix))); if (ldapObj != null) { ConfigurationChanges.ModifiedAttribute attribute = new ConfigurationChanges.ModifiedAttribute(attrId); for (String val : valsWithOrdinalPrefix) attribute.addValue(val); for (String prev : addOrdinalPrefix(prevs)) attribute.removeValue(prev); ldapObj.add(attribute); } } }
LdapUtils.addOrdinalPrefix(tc.getPreferredTransferSyntaxes())); EnumSet<QueryOption> queryOpts = tc.getQueryOptions(); if (queryOpts != null) {
LdapUtils.addOrdinalPrefix(tc.getPreferredTransferSyntaxes())); EnumSet<QueryOption> queryOpts = tc.getQueryOptions(); if (queryOpts != null) {
private Attributes storeTo(ConfigurationChanges.ModifiedObject ldapObj, ApplicationEntity ae, String deviceDN, Attributes attrs) { BasicAttribute objectclass = new BasicAttribute("objectclass", "dicomNetworkAE"); attrs.put(objectclass); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dicomAETitle", ae.getAETitle(), null); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dicomDescription", ae.getDescription(), null); storeNotEmpty(ldapObj, attrs, "dicomVendorData", ae.getVendorData()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dicomApplicationCluster", ae.getApplicationClusters()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dicomPreferredCallingAETitle", ae.getPreferredCallingAETitles()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dicomPreferredCalledAETitle", ae.getPreferredCalledAETitles()); LdapUtils.storeBoolean(ldapObj, attrs, "dicomAssociationInitiator", ae.isAssociationInitiator()); LdapUtils.storeBoolean(ldapObj, attrs, "dicomAssociationAcceptor", ae.isAssociationAcceptor()); LdapUtils.storeConnRefs(ldapObj, attrs, ae.getConnections(), deviceDN); LdapUtils.storeNotEmpty(ldapObj, attrs, "dicomSupportedCharacterSet", ae.getSupportedCharacterSets()); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dicomInstalled", ae.getInstalled(), null); if (!extended) return attrs; objectclass.add("dcmNetworkAE"); LdapUtils.storeNotEmpty(ldapObj, attrs, "dcmPreferredTransferSyntax", LdapUtils.addOrdinalPrefix(ae.getPreferredTransferSyntaxes())); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "hl7ApplicationName", ae.getHl7ApplicationName(), null); LdapUtils.storeNotEmpty(ldapObj, attrs, "dcmAcceptedCallingAETitle", ae.getAcceptedCallingAETitles()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dcmOtherAETitle", ae.getOtherAETitles()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dcmMasqueradeCallingAETitle", ae.getMasqueradeCallingAETitles()); for (LdapDicomConfigurationExtension ext : extensions) ext.storeTo(ldapObj, ae, attrs); return attrs; }
private Attributes storeTo(ConfigurationChanges.ModifiedObject ldapObj, ApplicationEntity ae, String deviceDN, Attributes attrs) { BasicAttribute objectclass = new BasicAttribute("objectclass", "dicomNetworkAE"); attrs.put(objectclass); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dicomAETitle", ae.getAETitle(), null); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dicomDescription", ae.getDescription(), null); storeNotEmpty(ldapObj, attrs, "dicomVendorData", ae.getVendorData()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dicomApplicationCluster", ae.getApplicationClusters()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dicomPreferredCallingAETitle", ae.getPreferredCallingAETitles()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dicomPreferredCalledAETitle", ae.getPreferredCalledAETitles()); LdapUtils.storeBoolean(ldapObj, attrs, "dicomAssociationInitiator", ae.isAssociationInitiator()); LdapUtils.storeBoolean(ldapObj, attrs, "dicomAssociationAcceptor", ae.isAssociationAcceptor()); LdapUtils.storeConnRefs(ldapObj, attrs, ae.getConnections(), deviceDN); LdapUtils.storeNotEmpty(ldapObj, attrs, "dicomSupportedCharacterSet", ae.getSupportedCharacterSets()); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dicomInstalled", ae.getInstalled(), null); if (!extended) return attrs; objectclass.add("dcmNetworkAE"); LdapUtils.storeNotEmpty(ldapObj, attrs, "dcmPreferredTransferSyntax", LdapUtils.addOrdinalPrefix(ae.getPreferredTransferSyntaxes())); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "hl7ApplicationName", ae.getHl7ApplicationName(), null); LdapUtils.storeNotEmpty(ldapObj, attrs, "dcmAcceptedCallingAETitle", ae.getAcceptedCallingAETitles()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dcmOtherAETitle", ae.getOtherAETitles()); LdapUtils.storeNotEmpty(ldapObj, attrs, "dcmMasqueradeCallingAETitle", ae.getMasqueradeCallingAETitles()); for (LdapDicomConfigurationExtension ext : extensions) ext.storeTo(ldapObj, ae, attrs); return attrs; }