| | |
| | | writer.writeEntry(connection.readEntry(dn, "description")); |
| | | writer.close(); |
| | | } catch (final IOException e) { |
| | | e.printStackTrace(); |
| | | // The writer could not write to System.out. |
| | | } |
| | | } |
| | | </programlisting> |
| | |
| | | System.out.println("Authorization ID returned: " |
| | | + control.getAuthorizationID()); |
| | | } catch (final DecodeException e) { |
| | | e.printStackTrace(); |
| | | // Failed to decode the response control. |
| | | } |
| | | } |
| | | </programlisting> |
| | |
| | | } |
| | | } |
| | | } catch (final DecodeException e) { |
| | | e.printStackTrace(); |
| | | // Failed to decode the response control. |
| | | } catch (final ErrorResultIOException e) { |
| | | e.printStackTrace(); |
| | | // Request failed due to an IO problem. |
| | | } catch (final SearchResultReferenceIOException e) { |
| | | e.printStackTrace(); |
| | | // Read a reference, rather than an entry. |
| | | } |
| | | } |
| | | </programlisting> |
| | |
| | | } |
| | | writer.close(); |
| | | } catch (final ErrorResultIOException e) { |
| | | e.printStackTrace(); |
| | | // Request failed due to an IO problem. |
| | | } catch (final SearchResultReferenceIOException e) { |
| | | e.printStackTrace(); |
| | | // Read a reference, rather than an entry. |
| | | } catch (final IOException e) { |
| | | e.printStackTrace(); |
| | | // The writer could not write to System.out. |
| | | } |
| | | } |
| | | </programlisting> |
| | |
| | | writer.writeEntry(entry); |
| | | writer.close(); |
| | | } catch (final ErrorResultIOException e) { |
| | | e.printStackTrace(); |
| | | // Request failed due to an IO problem. |
| | | } catch (final SearchResultReferenceIOException e) { |
| | | e.printStackTrace(); |
| | | // Read a reference, rather than an entry. |
| | | } catch (final IOException e) { |
| | | e.printStackTrace(); |
| | | // The writer could not write to System.out. |
| | | } |
| | | } |
| | | </programlisting> |
| | |
| | | writer.writeEntry(entry); |
| | | writer.close(); |
| | | } catch (final IOException e) { |
| | | e.printStackTrace(); |
| | | // The writer could not write to System.out. |
| | | } |
| | | } |
| | | </programlisting> |
| | |
| | | |
| | | try { |
| | | connection.bind(dn, pwd); |
| | | } catch (ErrorResultException e) { |
| | | } catch (final ErrorResultException e) { |
| | | final Result result = e.getResult(); |
| | | try { |
| | | final PasswordExpiredResponseControl control = |
| | |
| | | if (!(control == null) && control.hasValue()) { |
| | | System.out.println("Password expired for " + dn); |
| | | } |
| | | } catch (DecodeException de) { |
| | | de.printStackTrace(); |
| | | } catch (final DecodeException de) { |
| | | // Failed to decode the response control. |
| | | } |
| | | } |
| | | } |
| | |
| | | System.out.println("Password for " + dn + " expires in " |
| | | + control.getSecondsUntilExpiration() + " seconds."); |
| | | } |
| | | } catch (DecodeException de) { |
| | | de.printStackTrace(); |
| | | } catch (final DecodeException de) { |
| | | // Failed to decode the response control. |
| | | } |
| | | } |
| | | </programlisting> |
| | |
| | | + control.getWarningType().toString() + ", value " |
| | | + control.getWarningValue() + " for " + dn); |
| | | } |
| | | } catch (ErrorResultException e) { |
| | | } catch (final ErrorResultException e) { |
| | | final Result result = e.getResult(); |
| | | try { |
| | | final PasswordPolicyResponseControl control = |
| | |
| | | System.out.println("Password policy error " |
| | | + control.getErrorType().toString() + " for " + dn); |
| | | } |
| | | } catch (DecodeException de) { |
| | | de.printStackTrace(); |
| | | } catch (final DecodeException de) { |
| | | // Failed to decode the response control. |
| | | } |
| | | } catch (DecodeException e) { |
| | | e.printStackTrace(); |
| | | } catch (final DecodeException e) { |
| | | // Failed to decode the response control. |
| | | } |
| | | } |
| | | </programlisting> |
| | |
| | | final LDIFEntryWriter writer = new LDIFEntryWriter(System.out); |
| | | writer.writeEntry(entry); |
| | | writer.close(); |
| | | } catch (DecodeException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } catch (final DecodeException e) { |
| | | // Failed to decode the response control. |
| | | } catch (final IOException e) { |
| | | // The writer could not write to System.out. |
| | | } |
| | | } |
| | | </programlisting> |
| | |
| | | final LDIFEntryWriter writer = new LDIFEntryWriter(System.out); |
| | | writer.writeEntry(entry); |
| | | writer.close(); |
| | | } catch (DecodeException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } catch (final DecodeException e) { |
| | | // Failed to decode the response control. |
| | | } catch (final IOException e) { |
| | | // The writer could not write to System.out. |
| | | } |
| | | } |
| | | </programlisting> |
| | |
| | | try { |
| | | writer.writeEntry(entry); |
| | | writer.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } catch (final IOException e) { |
| | | // The writer could not write to System.out. |
| | | } |
| | | }</programlisting> |
| | | |
| | |
| | | } else { |
| | | System.out.println("# Entries not necessarily sorted"); |
| | | } |
| | | } catch (DecodeException e) { |
| | | e.printStackTrace(); |
| | | } catch (final DecodeException e) { |
| | | // Failed to decode the response control. |
| | | } |
| | | } else { |
| | | System.out.println("ServerSideSortRequestControl not supported"); |
| | |
| | | try { |
| | | writer.writeEntry(entry); |
| | | writer.flush(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } catch (final IOException e) { |
| | | // The writer could not write to System.out. |
| | | } |
| | | return true; |
| | | } |
| | |
| | | result.getControl(SimplePagedResultsControl.DECODER, |
| | | new DecodeOptions()); |
| | | cookie = control.getCookie(); |
| | | } catch (DecodeException e) { |
| | | e.printStackTrace(); |
| | | } catch (final DecodeException e) { |
| | | // Failed to decode the response control. |
| | | } |
| | | |
| | | ++page; |
| | |
| | | } |
| | | } |
| | | writer.close(); |
| | | } catch (ErrorResultIOException e) { |
| | | e.printStackTrace(); |
| | | } catch (SearchResultReferenceIOException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } catch (final ErrorResultIOException e) { |
| | | // Request failed due to an IO problem. |
| | | } catch (final SearchResultReferenceIOException e) { |
| | | // Read a reference, rather than an entry. |
| | | } catch (final IOException e) { |
| | | // The writer could not write to System.out. |
| | | } |
| | | } |
| | | </programlisting> |
| | |
| | | System.out.println("# Position in list: " |
| | | + vlvControl.getTargetPosition() + "/" |
| | | + vlvControl.getContentCount()); |
| | | } catch (DecodeException e) { |
| | | e.printStackTrace(); |
| | | } catch (final DecodeException e) { |
| | | // Failed to decode the response control. |
| | | } |
| | | } |
| | | </programlisting> |