上記の 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