| | |
| | | writer.writeEntry(connection.readEntry(dn, "description")); |
| | | writer.close(); |
| | | } catch (final IOException e) { |
| | | e.printStackTrace(); |
| | | System.err.println(e.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_LOCAL_ERROR.intValue()); |
| | | } |
| | | } else { |
| | | System.err.println("AssertionRequestControl not supported."); |
| | |
| | | System.out.println("Authorization ID returned: " |
| | | + control.getAuthorizationID()); |
| | | } catch (final DecodeException e) { |
| | | e.printStackTrace(); |
| | | System.err.println(e.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_DECODING_ERROR.intValue()); |
| | | } |
| | | } else { |
| | | System.err.println("AuthorizationIdentityRequestControl not supported."); |
| | |
| | | * @throws ErrorResultException |
| | | * Operation failed. |
| | | */ |
| | | static void useGetEffectiveRightsRequestControl(Connection connection) |
| | | throws ErrorResultException { |
| | | static void useGetEffectiveRightsRequestControl(Connection connection) throws ErrorResultException { |
| | | if (isSupported(GetEffectiveRightsRequestControl.OID)) { |
| | | final String authDN = "uid=kvaughan,ou=People,dc=example,dc=com"; |
| | | |
| | |
| | | } |
| | | writer.close(); |
| | | } catch (final ErrorResultIOException e) { |
| | | e.printStackTrace(); |
| | | System.err.println(e.getMessage()); |
| | | System.exit(e.getCause().getResult().getResultCode().intValue()); |
| | | } catch (final SearchResultReferenceIOException e) { |
| | | e.printStackTrace(); |
| | | System.err.println("Got search reference(s): " + e.getReference().getURIs().toString()); |
| | | } catch (final IOException e) { |
| | | e.printStackTrace(); |
| | | System.err.println(e.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_LOCAL_ERROR.intValue()); |
| | | } |
| | | } else { |
| | | System.err.println("GetEffectiveRightsRequestControl not supported."); |
| | |
| | | writer.writeEntry(entry); |
| | | writer.close(); |
| | | } catch (final ErrorResultIOException e) { |
| | | e.printStackTrace(); |
| | | System.err.println(e.getMessage()); |
| | | System.exit(e.getCause().getResult().getResultCode().intValue()); |
| | | } catch (final SearchResultReferenceIOException e) { |
| | | e.printStackTrace(); |
| | | System.err.println("Got search reference(s): " + e.getReference().getURIs().toString()); |
| | | } catch (final IOException e) { |
| | | e.printStackTrace(); |
| | | System.err.println(e.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_LOCAL_ERROR.intValue()); |
| | | } |
| | | } else { |
| | | System.err.println("ManageDsaITRequestControl not supported."); |
| | |
| | | writer.writeEntry(entry); |
| | | writer.close(); |
| | | } catch (final IOException e) { |
| | | e.printStackTrace(); |
| | | System.err.println(e.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_LOCAL_ERROR.intValue()); |
| | | } |
| | | } else { |
| | | System.err.println("MatchedValuesRequestControl not supported."); |
| | |
| | | |
| | | 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) { |
| | | System.err.println(de.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_DECODING_ERROR.intValue()); |
| | | } |
| | | } |
| | | } else { |
| | |
| | | * @throws ErrorResultException |
| | | * Operation failed. |
| | | */ |
| | | static void usePasswordExpiringResponseControl(Connection connection) |
| | | throws ErrorResultException { |
| | | static void usePasswordExpiringResponseControl(Connection connection) throws ErrorResultException { |
| | | if (isSupported(PasswordExpiringResponseControl.OID)) { |
| | | final String dn = "uid=bjensen,ou=People,dc=example,dc=com"; |
| | | final char[] pwd = "hifalutin".toCharArray(); |
| | |
| | | System.out.println("Password for " + dn + " expires in " |
| | | + control.getSecondsUntilExpiration() + " seconds."); |
| | | } |
| | | } catch (DecodeException de) { |
| | | de.printStackTrace(); |
| | | } catch (final DecodeException de) { |
| | | System.err.println(de.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_DECODING_ERROR.intValue()); |
| | | } |
| | | } else { |
| | | System.err.println("PasswordExpiringResponseControl not supported"); |
| | |
| | | + 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) { |
| | | System.err.println(de.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_DECODING_ERROR.intValue()); |
| | | } |
| | | } catch (DecodeException e) { |
| | | e.printStackTrace(); |
| | | } catch (final DecodeException e) { |
| | | System.err.println(e.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_DECODING_ERROR.intValue()); |
| | | } |
| | | } else { |
| | | System.err.println("PasswordPolicyRequestControl not supported"); |
| | |
| | | * @throws ErrorResultException |
| | | * Operation failed. |
| | | */ |
| | | static void usePermissiveModifyRequestControl(Connection connection) |
| | | throws ErrorResultException { |
| | | static void usePermissiveModifyRequestControl(Connection connection) throws ErrorResultException { |
| | | if (isSupported(PermissiveModifyRequestControl.OID)) { |
| | | final String dn = "uid=bjensen,ou=People,dc=example,dc=com"; |
| | | |
| | |
| | | } |
| | | } |
| | | } catch (final DecodeException e) { |
| | | e.printStackTrace(); |
| | | System.err.println(e.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_DECODING_ERROR.intValue()); |
| | | } catch (final ErrorResultIOException e) { |
| | | e.printStackTrace(); |
| | | System.err.println(e.getMessage()); |
| | | System.exit(e.getCause().getResult().getResultCode().intValue()); |
| | | } catch (final SearchResultReferenceIOException e) { |
| | | e.printStackTrace(); |
| | | System.err.println("Got search reference(s): " + e.getReference().getURIs().toString()); |
| | | } |
| | | } else { |
| | | System.err.println("PersistentSearchRequestControl not supported."); |
| | |
| | | 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) { |
| | | System.err.println(e.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_DECODING_ERROR.intValue()); |
| | | } catch (final IOException e) { |
| | | System.err.println(e.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_LOCAL_ERROR.intValue()); |
| | | } |
| | | } else { |
| | | System.err.println("PostReadRequestControl not supported"); |
| | |
| | | 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) { |
| | | System.err.println(e.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_DECODING_ERROR.intValue()); |
| | | } catch (final IOException e) { |
| | | System.err.println(e.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_LOCAL_ERROR.intValue()); |
| | | } |
| | | } else { |
| | | System.err.println("PreReadRequestControl not supported"); |
| | |
| | | try { |
| | | writer.writeEntry(entry); |
| | | writer.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } catch (final IOException e) { |
| | | System.err.println(e.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_LOCAL_ERROR.intValue()); |
| | | } |
| | | } else { |
| | | System.err.println("ProxiedAuthV2RequestControl not supported"); |
| | |
| | | } else { |
| | | System.out.println("# Entries not necessarily sorted"); |
| | | } |
| | | } catch (DecodeException e) { |
| | | e.printStackTrace(); |
| | | } catch (final DecodeException e) { |
| | | System.err.println(e.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_DECODING_ERROR.intValue()); |
| | | } |
| | | } else { |
| | | System.err.println("ServerSideSortRequestControl not supported"); |
| | |
| | | try { |
| | | writer.writeEntry(entry); |
| | | writer.flush(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } catch (final IOException e) { |
| | | System.err.println(e.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_LOCAL_ERROR.intValue()); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | result.getControl(SimplePagedResultsControl.DECODER, |
| | | new DecodeOptions()); |
| | | cookie = control.getCookie(); |
| | | } catch (DecodeException e) { |
| | | e.printStackTrace(); |
| | | } catch (final DecodeException e) { |
| | | System.err.println(e.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_DECODING_ERROR.intValue()); |
| | | } |
| | | |
| | | ++page; |
| | |
| | | } |
| | | } |
| | | writer.close(); |
| | | } catch (ErrorResultIOException e) { |
| | | e.printStackTrace(); |
| | | } catch (SearchResultReferenceIOException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } catch (final ErrorResultIOException e) { |
| | | System.err.println(e.getMessage()); |
| | | System.exit(e.getCause().getResult().getResultCode().intValue()); |
| | | } catch (final SearchResultReferenceIOException e) { |
| | | System.err.println("Got search reference(s): " + e.getReference().getURIs().toString()); |
| | | } catch (final IOException e) { |
| | | System.err.println(e.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_LOCAL_ERROR.intValue()); |
| | | } |
| | | } else { |
| | | System.err.println("SubentriesRequestControl not supported"); |
| | |
| | | System.out.println("# Position in list: " |
| | | + vlvControl.getTargetPosition() + "/" |
| | | + vlvControl.getContentCount()); |
| | | } catch (DecodeException e) { |
| | | e.printStackTrace(); |
| | | } catch (final DecodeException e) { |
| | | System.err.println(e.getMessage()); |
| | | System.exit(ResultCode.CLIENT_SIDE_DECODING_ERROR.intValue()); |
| | | } |
| | | } else { |
| | | System.err.println("VirtualListViewRequestControl not supported"); |