위의 Spring 구성에서 다음 코드 샘플은 LDAP 요청을 전송하여 구성원에 대한 그룹을 필터링합니다. 그런 다음 일반 이름이 응답에서 추출됩니다.
ProducerTemplate<Exchange> template = exchange.getContext().createProducerTemplate();
List<?> results = (Collection<?>) template.sendBody("ldap:ldapConnection, "LDiff goes here");
if (results.size() > 0) {
// Check for no errors
for (String result : results) {
if ("success".equalTo(result)) {
// LDIF entry success
} else {
// LDIF entry failure
}
}
}
ProducerTemplate<Exchange> template = exchange.getContext().createProducerTemplate();
List<?> results = (Collection<?>) template.sendBody("ldap:ldapConnection, "LDiff goes here");
if (results.size() > 0) {
// Check for no errors
for (String result : results) {
if ("success".equalTo(result)) {
// LDIF entry success
} else {
// LDIF entry failure
}
}
}
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow