Skip to content

Commit abf6282

Browse files
committed
Add LdapClient
Closes gh-675
1 parent 092b22c commit abf6282

20 files changed

+3590
-8
lines changed

core/src/main/java/org/springframework/ldap/core/ContextMapper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,6 @@ public interface ContextMapper<T> {
6464
* @throws NamingException if an error occurs.
6565
*/
6666
T mapFromContext(Object ctx) throws NamingException;
67+
68+
ContextMapper<DirContextOperations> DEFAULT = (ctx) -> (DirContextOperations) ctx;
6769
}

core/src/main/java/org/springframework/ldap/core/DirContextAdapter.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public class DirContextAdapter implements DirContextOperations {
106106

107107
private static Logger log = LoggerFactory.getLogger(DirContextAdapter.class);
108108

109-
private final NameAwareAttributes originalAttrs;
109+
private NameAwareAttributes originalAttrs;
110110

111111
private LdapName dn;
112112

@@ -804,6 +804,14 @@ public SortedSet<String> getAttributeSortedStringSet(String name) {
804804
}
805805
}
806806

807+
void setAttributes(Attributes attributes) {
808+
if (!updateMode) {
809+
originalAttrs = new NameAwareAttributes(attributes);
810+
} else {
811+
updatedAttrs = new NameAwareAttributes(attributes);
812+
}
813+
}
814+
807815
/**
808816
* Set the supplied attribute.
809817
*

0 commit comments

Comments
 (0)