| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.controls; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<AccountUsableRequestControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public AccountUsableRequestControl decode(boolean isCritical, |
| | | ByteString value) |
| | | throws DirectoryException |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<AccountUsableResponseControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public AccountUsableResponseControl decode(boolean isCritical, |
| | | ByteString value) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | // Indicates whether the user's account is usable. |
| | | /** Indicates whether the user's account is usable. */ |
| | | private boolean isUsable; |
| | | |
| | | // Indicates whether the user's password is expired. |
| | | /** Indicates whether the user's password is expired. */ |
| | | private boolean isExpired; |
| | | |
| | | // Indicates whether the user's account is inactive. |
| | | /** Indicates whether the user's account is inactive. */ |
| | | private boolean isInactive; |
| | | |
| | | // Indicates whether the user's account is currently locked. |
| | | /** Indicates whether the user's account is currently locked. */ |
| | | private boolean isLocked; |
| | | |
| | | // Indicates whether the user's password has been reset and must be changed |
| | | // before anything else can be done. |
| | | /** |
| | | * Indicates whether the user's password has been reset and must be changed |
| | | * before anything else can be done. |
| | | */ |
| | | private boolean isReset; |
| | | |
| | | // The number of remaining grace logins, if available. |
| | | /** The number of remaining grace logins, if available. */ |
| | | private int remainingGraceLogins; |
| | | |
| | | // The length of time in seconds before the user's password expires, if |
| | | // available. |
| | | /** |
| | | * The length of time in seconds before the user's password expires, if |
| | | * available. |
| | | */ |
| | | private int secondsBeforeExpiration; |
| | | |
| | | // The length of time before the user's account is unlocked, if available. |
| | | /** The length of time before the user's account is unlocked, if available. */ |
| | | private int secondsBeforeUnlock; |
| | | |
| | | |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<AuthorizationIdentityResponseControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public AuthorizationIdentityResponseControl decode(boolean isCritical, |
| | | ByteString value) |
| | | throws DirectoryException |
| | |
| | | DECODER = new Decoder(); |
| | | |
| | | |
| | | // The authorization ID for this control. |
| | | /** The authorization ID for this control. */ |
| | | private String authorizationID; |
| | | |
| | | |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<EntryChangeNotificationControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public EntryChangeNotificationControl decode( |
| | | boolean isCritical, ByteString value) throws DirectoryException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // The previous DN for this change notification control. |
| | | /** The previous DN for this change notification control. */ |
| | | private DN previousDN; |
| | | |
| | | // The change number for this change notification control. |
| | | /** The change number for this change notification control. */ |
| | | private long changeNumber; |
| | | |
| | | // The change type for this change notification control. |
| | | /** The change type for this change notification control. */ |
| | | private PersistentSearchChangeType changeType; |
| | | |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The cookie value - payload of this control. |
| | | /** The cookie value - payload of this control. */ |
| | | private String cookie; |
| | | |
| | | /** |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<EntryChangelogNotificationControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public EntryChangelogNotificationControl decode( |
| | | boolean isCritical, ByteString value) |
| | | throws DirectoryException |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<ExternalChangelogRequestControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ExternalChangelogRequestControl decode(boolean isCritical, |
| | | ByteString value) |
| | | throws DirectoryException |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<GetEffectiveRightsRequestControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public GetEffectiveRightsRequestControl decode(boolean isCritical, |
| | | ByteString value) throws DirectoryException |
| | | { |
| | |
| | | new Decoder(); |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | //The DN representing the authzId. May be null. |
| | | /** The DN representing the authzId. May be null. */ |
| | | private DN authzDN; |
| | | |
| | | //The raw DN representing the authzId. May be null. |
| | | /** The raw DN representing the authzId. May be null. */ |
| | | private String rawAuthzDN; |
| | | |
| | | //The list of additional attribute types to return rights for. May be null. |
| | | /** The list of additional attribute types to return rights for. May be null. */ |
| | | private List<AttributeType> attrs; |
| | | |
| | | //The raw DN representing the authzId. May be null. |
| | | /** The raw DN representing the authzId. May be null. */ |
| | | private List<String> rawAttrs; |
| | | |
| | | /** |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<LDAPAssertionRequestControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public LDAPAssertionRequestControl decode(boolean isCritical, |
| | | ByteString value) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | // The unparsed LDAP search filter contained in the request from the client. |
| | | /** The unparsed LDAP search filter contained in the request from the client. */ |
| | | private LDAPFilter rawFilter; |
| | | |
| | | // The processed search filter |
| | | /** The processed search filter. */ |
| | | private SearchFilter filter; |
| | | |
| | | |
| | |
| | | private static final class Decoder implements |
| | | ControlDecoder<LDAPPostReadRequestControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public LDAPPostReadRequestControl decode(boolean isCritical, |
| | | ByteString value) throws DirectoryException |
| | | { |
| | |
| | | new Decoder(); |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The set of raw attributes to return in the entry. |
| | | /** The set of raw attributes to return in the entry. */ |
| | | private Set<String> rawAttributes; |
| | | |
| | | // The set of processed attributes to return in the entry. |
| | | /** The set of processed attributes to return in the entry. */ |
| | | private Set<String> requestedAttributes; |
| | | |
| | | |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<LDAPPostReadResponseControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public LDAPPostReadResponseControl decode(boolean isCritical, |
| | | ByteString value) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | // The search result entry to include in the response control. |
| | | /** The search result entry to include in the response control. */ |
| | | private SearchResultEntry searchEntry; |
| | | |
| | | |
| | |
| | | private static final class Decoder implements |
| | | ControlDecoder<LDAPPreReadRequestControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public LDAPPreReadRequestControl decode(boolean isCritical, |
| | | ByteString value) throws DirectoryException |
| | | { |
| | |
| | | new Decoder(); |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The set of raw attributes to return in the entry. |
| | | /** The set of raw attributes to return in the entry. */ |
| | | private Set<String> rawAttributes; |
| | | |
| | | // The set of processed attributes to return in the entry. |
| | | /** The set of processed attributes to return in the entry. */ |
| | | private Set<String> requestedAttributes; |
| | | |
| | | |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<LDAPPreReadResponseControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public LDAPPreReadResponseControl decode(boolean isCritical, |
| | | ByteString value) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | // The search result entry to include in the response control. |
| | | /** The search result entry to include in the response control. */ |
| | | private SearchResultEntry searchEntry; |
| | | |
| | | |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<MatchedValuesControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public MatchedValuesControl decode(boolean isCritical, ByteString value) |
| | | throws DirectoryException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // The set of matched values filters for this control. |
| | | /** The set of matched values filters for this control. */ |
| | | private final ArrayList<MatchedValuesFilter> filters; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // The approximate matching rule for this matched values filter. |
| | | /** The approximate matching rule for this matched values filter. */ |
| | | private MatchingRule approximateMatchingRule; |
| | | |
| | | // The raw, unprocessed assertion value for this matched values filter. |
| | | /** The raw, unprocessed assertion value for this matched values filter. */ |
| | | private final ByteString rawAssertionValue; |
| | | |
| | | // The subFinal value for this matched values filter. |
| | | /** The subFinal value for this matched values filter. */ |
| | | private final ByteString subFinal; |
| | | |
| | | // The subInitial value for this matched values filter. |
| | | /** The subInitial value for this matched values filter. */ |
| | | private final ByteString subInitial; |
| | | |
| | | // The processed attribute type for this matched values filter. |
| | | /** The processed attribute type for this matched values filter. */ |
| | | private AttributeType attributeType; |
| | | |
| | | // The processed assertion value for this matched values filter. |
| | | /** The processed assertion value for this matched values filter. */ |
| | | private ByteString assertionValue; |
| | | |
| | | // Indicates whether the elements of this matched values filter have been |
| | | // fully decoded. |
| | | /** |
| | | * Indicates whether the elements of this matched values filter have been |
| | | * fully decoded. |
| | | */ |
| | | private boolean decoded; |
| | | |
| | | // The match type for this matched values filter. |
| | | /** The match type for this matched values filter. */ |
| | | private final byte matchType; |
| | | |
| | | // The equality matching rule for this matched values filter. |
| | | /** The equality matching rule for this matched values filter. */ |
| | | private MatchingRule equalityMatchingRule; |
| | | |
| | | // The set of subAny values for this matched values filter. |
| | | /** The set of subAny values for this matched values filter. */ |
| | | private final List<ByteString> subAny; |
| | | |
| | | // The matching rule for this matched values filter. |
| | | /** The matching rule for this matched values filter. */ |
| | | private MatchingRule matchingRule; |
| | | |
| | | // The ordering matching rule for this matched values filter. |
| | | /** The ordering matching rule for this matched values filter. */ |
| | | private MatchingRule orderingMatchingRule; |
| | | |
| | | // The matching rule ID for this matched values filter. |
| | | /** The matching rule ID for this matched values filter. */ |
| | | private final String matchingRuleID; |
| | | |
| | | // The raw, unprocessed attribute type for this matched values filter. |
| | | /** The raw, unprocessed attribute type for this matched values filter. */ |
| | | private final String rawAttributeType; |
| | | |
| | | // The substring matching rule for this matched values filter. |
| | | /** The substring matching rule for this matched values filter. */ |
| | | private MatchingRule substringMatchingRule; |
| | | |
| | | /** |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<PagedResultsControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public PagedResultsControl decode(boolean isCritical, ByteString value) |
| | | throws DirectoryException |
| | | { |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<PasswordExpiredControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public PasswordExpiredControl decode(boolean isCritical, ByteString value) |
| | | throws DirectoryException |
| | | { |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<PasswordExpiringControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public PasswordExpiringControl decode(boolean isCritical, ByteString value) |
| | | throws DirectoryException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // The length of time in seconds until the password actually expires. |
| | | /** The length of time in seconds until the password actually expires. */ |
| | | private int secondsUntilExpiration; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.controls; |
| | | |
| | | |
| | | |
| | | import static org.opends.messages.ProtocolMessages.*; |
| | | |
| | | import java.util.HashMap; |
| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This enumeration defines the set of password policy errors that may be |
| | | * included in the password policy response control defined in |
| | |
| | | |
| | | |
| | | |
| | | // A lookup table for resolving an error type from its integer value. |
| | | /** A lookup table for resolving an error type from its integer value. */ |
| | | private static final Map<Integer, PasswordPolicyErrorType> TABLE; |
| | | static |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // The integer value associated with the error type to use in the associated |
| | | // enumerated element in the password policy response control. |
| | | /** |
| | | * The integer value associated with the error type to use in the associated |
| | | * enumerated element in the password policy response control. |
| | | */ |
| | | private int value; |
| | | |
| | | // The message ID for the description of this password policy error type. |
| | | /** The message ID for the description of this password policy error type. */ |
| | | private LocalizableMessage description; |
| | | |
| | | |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<PasswordPolicyRequestControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public PasswordPolicyRequestControl decode(boolean isCritical, |
| | | ByteString value) |
| | | throws DirectoryException |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<PasswordPolicyResponseControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public PasswordPolicyResponseControl decode(boolean isCritical, |
| | | ByteString value) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | // The warning value for this password policy response control. |
| | | /** The warning value for this password policy response control. */ |
| | | private int warningValue; |
| | | |
| | | // The error type for this password policy response control. |
| | | /** The error type for this password policy response control. */ |
| | | private PasswordPolicyErrorType errorType; |
| | | |
| | | // The warning type for the password policy response control. |
| | | /** The warning type for the password policy response control. */ |
| | | private PasswordPolicyWarningType warningType; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.controls; |
| | | |
| | | |
| | | |
| | | import static org.opends.messages.ProtocolMessages.*; |
| | | |
| | | import java.util.HashMap; |
| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This enumeration defines the set of password policy warnings that may be |
| | | * included in the password policy response control defined in |
| | |
| | | |
| | | |
| | | |
| | | // A lookup table for resolving a warning type from its BER type. |
| | | /** A lookup table for resolving a warning type from its BER type. */ |
| | | private static final Map<Byte, PasswordPolicyWarningType> TABLE; |
| | | static |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // The BER type to use for the associated element in the password policy |
| | | // control. |
| | | /** |
| | | * The BER type to use for the associated element in the password policy |
| | | * control. |
| | | */ |
| | | private final byte type; |
| | | |
| | | // The message ID for the description of this password policy error type. |
| | | /** The message ID for the description of this password policy error type. */ |
| | | private final LocalizableMessage description; |
| | | |
| | | |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<PersistentSearchControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public PersistentSearchControl decode(boolean isCritical, ByteString value) |
| | | throws DirectoryException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // Indicates whether to only return entries that have been updated since the |
| | | // beginning of the search. |
| | | /** |
| | | * Indicates whether to only return entries that have been updated since the |
| | | * beginning of the search. |
| | | */ |
| | | private boolean changesOnly; |
| | | |
| | | // Indicates whether entries returned as a result of changes to directory data |
| | | // should include the entry change notification control. |
| | | /** |
| | | * Indicates whether entries returned as a result of changes to directory data |
| | | * should include the entry change notification control. |
| | | */ |
| | | private boolean returnECs; |
| | | |
| | | // The set of change types associated with this control. |
| | | /** The set of change types associated with this control. */ |
| | | private Set<PersistentSearchChangeType> changeTypes; |
| | | |
| | | |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<ProxiedAuthV1Control> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ProxiedAuthV1Control decode(boolean isCritical, ByteString value) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | // The raw, unprocessed authorization DN from the control value. |
| | | /** The raw, unprocessed authorization DN from the control value. */ |
| | | private ByteString rawAuthorizationDN; |
| | | |
| | | // The processed authorization DN from the control value. |
| | | /** The processed authorization DN from the control value. */ |
| | | private DN authorizationDN; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS. |
| | | * Portions Copyright 2011-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.controls; |
| | | |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<ProxiedAuthV2Control> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ProxiedAuthV2Control decode(boolean isCritical, ByteString value) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | // The authorization ID from the control value. |
| | | /** The authorization ID from the control value. */ |
| | | private ByteString authorizationID; |
| | | |
| | | |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<ServerSideSortRequestControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ServerSideSortRequestControl decode(boolean isCritical, |
| | | ByteString value) |
| | | throws DirectoryException |
| | |
| | | public static final ControlDecoder<ServerSideSortRequestControl> DECODER = |
| | | new Decoder(); |
| | | |
| | | // The sort order associated with this control represented by strings. |
| | | /** The sort order associated with this control represented by strings. */ |
| | | private ArrayList<String[]> decodedKeyList; |
| | | |
| | | // The sort order associated with this control. |
| | | /** The sort order associated with this control. */ |
| | | private SortOrder sortOrder; |
| | | |
| | | /** |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<ServerSideSortResponseControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ServerSideSortResponseControl decode(boolean isCritical, |
| | | ByteString value) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | // The result code for the sort result. |
| | | /** The result code for the sort result. */ |
| | | private int resultCode; |
| | | |
| | | // The attribute type for the sort result. |
| | | /** The attribute type for the sort result. */ |
| | | private String attributeType; |
| | | |
| | | |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<SubentriesControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public SubentriesControl decode(boolean isCritical, ByteString value) |
| | | throws DirectoryException |
| | | { |
| | |
| | | new Decoder(); |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The visibility from the control value. |
| | | /** The visibility from the control value. */ |
| | | private boolean visibility; |
| | | |
| | | /** |
| | |
| | | private static final class Decoder implements |
| | | ControlDecoder<SubtreeDeleteControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public SubtreeDeleteControl decode(boolean isCritical, |
| | | ByteString value) throws DirectoryException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void writeValue(ASN1Writer writer) throws IOException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<VLVRequestControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public VLVRequestControl decode(boolean isCritical, ByteString value) |
| | | throws DirectoryException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // The target type for this VLV request control. |
| | | /** The target type for this VLV request control. */ |
| | | private byte targetType; |
| | | |
| | | // The context ID for this VLV request control. |
| | | /** The context ID for this VLV request control. */ |
| | | private ByteString contextID; |
| | | |
| | | // The greaterThanOrEqual target assertion value for this VLV request control. |
| | | /** The greaterThanOrEqual target assertion value for this VLV request control. */ |
| | | private ByteString greaterThanOrEqual; |
| | | |
| | | // The after count for this VLV request control. |
| | | /** The after count for this VLV request control. */ |
| | | private int afterCount; |
| | | |
| | | // The before count for this VLV request control. |
| | | /** The before count for this VLV request control. */ |
| | | private int beforeCount; |
| | | |
| | | // The content count for the byOffset target of this VLV request control. |
| | | /** The content count for the byOffset target of this VLV request control. */ |
| | | private int contentCount; |
| | | |
| | | // The offset for the byOffset target of this VLV request control. |
| | | /** The offset for the byOffset target of this VLV request control. */ |
| | | private int offset; |
| | | |
| | | |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<VLVResponseControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public VLVResponseControl decode(boolean isCritical, ByteString value) |
| | | throws DirectoryException |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public String getOID() |
| | | { |
| | | return OID_VLV_RESPONSE_CONTROL; |
| | |
| | | public static final ControlDecoder<VLVResponseControl> DECODER = |
| | | new Decoder(); |
| | | |
| | | // The context ID for this VLV response control. |
| | | /** The context ID for this VLV response control. */ |
| | | private ByteString contextID; |
| | | |
| | | // The content count estimating the total number of entries in the result set. |
| | | /** The content count estimating the total number of entries in the result set. */ |
| | | private int contentCount; |
| | | |
| | | // The offset of the target entry in the result set. |
| | | /** The offset of the target entry in the result set. */ |
| | | private int targetPosition; |
| | | |
| | | // The result code for the VLV operation. |
| | | /** The result code for the VLV operation. */ |
| | | private int vlvResultCode; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final OperationType getOperationType() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final List<Control> getResponseControls() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void addResponseControl(Control control) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void removeResponseControl(Control control) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void toString(StringBuilder buffer) |
| | | { |
| | |
| | | private static final String CLASS_NAME = |
| | | "org.opends.server.core.AccessControlConfigManager"; |
| | | |
| | | // The single application-wide instance. |
| | | /** The single application-wide instance. */ |
| | | private static AccessControlConfigManager instance; |
| | | |
| | | // The active access control implementation. |
| | | /** The active access control implementation. */ |
| | | private AtomicReference<AccessControlHandler> accessControlHandler; |
| | | |
| | | // The current configuration. |
| | | /** The current configuration. */ |
| | | private AccessControlHandlerCfg currentConfiguration; |
| | | |
| | | private ServerContext serverContext; |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | AccessControlHandlerCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | AccessControlHandlerCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getComponentEntryDN() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getClassName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LinkedHashMap<String,String> getAlerts() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | AccountStatusNotificationHandlerCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | AccountStatusNotificationHandlerCfg configuration |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | AccountStatusNotificationHandlerCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd( |
| | | AccountStatusNotificationHandlerCfg configuration |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | AccountStatusNotificationHandlerCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | AccountStatusNotificationHandlerCfg configuration |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable(AlertHandlerCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd(AlertHandlerCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | AlertHandlerCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | AlertHandlerCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable(AlertHandlerCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | AlertHandlerCfg configuration) |
| | |
| | | |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // A mapping between the DNs of the config entries and the associated |
| | | // attribute syntaxes. |
| | | /** |
| | | * A mapping between the DNs of the config entries and the associated |
| | | * attribute syntaxes. |
| | | */ |
| | | private ConcurrentHashMap<DN,AttributeSyntax> syntaxes; |
| | | |
| | | private final ServerContext serverContext; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | AttributeSyntaxCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd( |
| | | AttributeSyntaxCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | AttributeSyntaxCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | AttributeSyntaxCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | AttributeSyntaxCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | AttributeSyntaxCfg configuration) |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | * Portions Copyright 2013-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.core; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | | |
| | | import org.opends.server.types.*; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | |
| | | |
| | | /** |
| | | * This abstract class wraps/decorates a given bind operation. |
| | | * This class will be extended by sub-classes to enhance the |
| | |
| | | super(bind); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public AuthenticationInfo getAuthenticationInfo() |
| | | { |
| | | return getOperation().getAuthenticationInfo(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public AuthenticationType getAuthenticationType() |
| | | { |
| | | return getOperation().getAuthenticationType(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public LocalizableMessage getAuthFailureReason() |
| | | { |
| | | return getOperation().getAuthFailureReason(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getBindDN() |
| | | { |
| | | return getOperation().getBindDN(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getRawBindDN() |
| | | { |
| | | return getOperation().getRawBindDN(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Entry getSASLAuthUserEntry() |
| | | { |
| | | return getOperation().getSASLAuthUserEntry(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getSASLCredentials() |
| | | { |
| | | return getOperation().getSASLCredentials(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getSASLMechanism() |
| | | { |
| | | return getOperation().getSASLMechanism(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getServerSASLCredentials() |
| | | { |
| | | return getOperation().getServerSASLCredentials(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getSimplePassword() |
| | | { |
| | | return getOperation().getSimplePassword(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getUserEntryDN() |
| | | { |
| | | return getOperation().getUserEntryDN(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setAuthenticationInfo(AuthenticationInfo authInfo) |
| | | { |
| | | getOperation().setAuthenticationInfo(authInfo); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setAuthFailureReason(LocalizableMessage reason) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setRawBindDN(ByteString rawBindDN) |
| | | { |
| | | getOperation().setRawBindDN(rawBindDN); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setSASLAuthUserEntry(Entry saslAuthUserEntry) |
| | | { |
| | | getOperation().setSASLAuthUserEntry(saslAuthUserEntry); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setSASLCredentials(String saslMechanism, |
| | | ByteString saslCredentials) |
| | |
| | | getOperation().setSASLCredentials(saslMechanism, saslCredentials); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setServerSASLCredentials(ByteString serverSASLCredentials) |
| | | { |
| | | getOperation().setServerSASLCredentials(serverSASLCredentials); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setSimplePassword(ByteString simplePassword) |
| | | { |
| | | getOperation().setSimplePassword(simplePassword); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setUserEntryDN(DN userEntryDN){ |
| | | getOperation().setUserEntryDN(userEntryDN); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() |
| | | { |
| | | return getOperation().toString(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setProtocolVersion(String protocolVersion) |
| | | { |
| | | getOperation().setProtocolVersion(protocolVersion); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getProtocolVersion() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | * Portions Copyright 2013-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.core; |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getRawEntryDN() |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setRawEntryDN(ByteString rawEntryDN) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getEntryDN() |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getRawAttributeType() |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setRawAttributeType(String rawAttributeType) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public AttributeType getAttributeType() |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setAttributeType(AttributeType attributeType) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Set<String> getAttributeOptions() |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setAttributeOptions(Set<String> attributeOptions) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getAssertionValue() |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setAssertionValue(ByteString assertionValue) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getProxiedAuthorizationDN() |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setProxiedAuthorizationDN(DN proxiedAuthorizationDN) |
| | | { |
| | |
| | | connectionHandlers = new ConcurrentHashMap<DN, ConnectionHandler<?>>(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd( |
| | | ConnectionHandlerCfg configuration) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | ConnectionHandlerCfg configuration) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | ConnectionHandlerCfg configuration) { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | ConnectionHandlerCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ConnectionHandlerCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | ConnectionHandlerCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | // Load and initialize the connection handler named in the config. |
| | | /** Load and initialize the connection handler named in the config. */ |
| | | private <T extends ConnectionHandlerCfg> ConnectionHandler<T> getConnectionHandler( |
| | | T config) throws ConfigException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // Determines whether or not the new configuration's implementation |
| | | // class is acceptable. |
| | | /** |
| | | * Determines whether or not the new configuration's implementation |
| | | * class is acceptable. |
| | | */ |
| | | private boolean isJavaClassAcceptable( |
| | | ConnectionHandlerCfg config, |
| | | List<LocalizableMessage> unacceptableReasons) { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable(GlobalCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange(GlobalCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeAccessControlHandler(AccessControlHandlerCfg |
| | | configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeAccessControlHandler() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAllowed(LocalBackendAddOperation addOperation) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAllowed(BindOperation bindOperation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAllowed(LocalBackendCompareOperation compareOperation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAllowed(LocalBackendDeleteOperation deleteOperation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAllowed(ExtendedOperation extendedOperation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAllowed(LocalBackendModifyOperation modifyOperation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAllowed(DN dn, Operation op, Control control) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAllowed(ModifyDNOperation modifyDNOperation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAllowed(SearchOperation searchOperation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAllowed(Operation operation, Entry entry, |
| | | SearchFilter filter) throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean maySend(Operation operation, SearchResultEntry unfilteredEntry) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void filterEntry(Operation operation, |
| | | SearchResultEntry unfilteredEntry, SearchResultEntry filteredEntry) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean maySend(DN dn, Operation operation, |
| | | SearchResultReference searchReference) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean mayProxy(Entry proxyUser, Entry proxiedUser, |
| | | Operation operation) { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.core; |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // Synchronizes calls to save. |
| | | /** Synchronizes calls to save. */ |
| | | private final Object saveLock = new Object(); |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void storeAttribute(final byte[] encodedAttribute, |
| | | final String attributeName, final Collection<String> attributeOptions) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void storeObjectClasses(final byte[] encodedObjectClasses, |
| | | final Collection<String> objectClassNames) throws DirectoryException |
| | |
| | | * Print messages for start-ds "-F" option (full version information). |
| | | */ |
| | | private static void printFullVersionInformation() { |
| | | /** |
| | | /* |
| | | * This option is used by the upgrade to identify the server build and it |
| | | * can eventually also be used to be sent to the support in case of an |
| | | * issue. Since this is not a public interface and since it is better |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The default entry cache. |
| | | /** The default entry cache. */ |
| | | private DefaultEntryCache _defaultEntryCache; |
| | | |
| | | // The entry cache order map sorted by the cache level. |
| | | /** The entry cache order map sorted by the cache level. */ |
| | | @SuppressWarnings("rawtypes") |
| | | private SortedMap<Integer, EntryCache> cacheOrderMap = |
| | | new TreeMap<Integer, EntryCache>(); |
| | |
| | | /** The entry cache to level map. */ |
| | | private Map<DN,Integer> cacheNameToLevelMap = new HashMap<DN, Integer>(); |
| | | |
| | | // Global entry cache monitor provider name. |
| | | /** Global entry cache monitor provider name. */ |
| | | private static final String |
| | | DEFAULT_ENTRY_CACHE_MONITOR_PROVIDER = "Entry Caches"; |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | EntryCacheCfg configuration, |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | EntryCacheCfg configuration |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | EntryCacheCfg configuration, |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd(EntryCacheCfg configuration) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | EntryCacheCfg configuration, |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | EntryCacheCfg configuration |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final String getRequestOID() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final ByteString getRequestValue() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final String getResponseOID() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void setResponseOID(String responseOID) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final ByteString getResponseValue() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void setResponseValue(ByteString responseValue) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final OperationType getOperationType() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final List<Control> getResponseControls() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void addResponseControl(Control control) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void removeResponseControl(Control control) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void toString(StringBuilder buffer) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | ExtendedOperationHandlerCfg configuration) |
| | |
| | | return ccr; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ExtendedOperationHandlerCfg configuration, |
| | |
| | | || isJavaClassAcceptable(configuration, unacceptableReasons); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | ExtendedOperationHandlerCfg configuration) |
| | |
| | | return ccr; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | ExtendedOperationHandlerCfg configuration, |
| | |
| | | return isConfigurationChangeAcceptable(configuration, unacceptableReasons); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd( |
| | | ExtendedOperationHandlerCfg configuration) |
| | |
| | | return ccr; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | ExtendedOperationHandlerCfg configuration, |
| | |
| | | return true; |
| | | } |
| | | |
| | | // Load and initialize the handler named in the config. |
| | | /** Load and initialize the handler named in the config. */ |
| | | private ExtendedOperationHandler getHandler( |
| | | ExtendedOperationHandlerCfg config) throws ConfigException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // Determines whether or not the new configuration's implementation |
| | | // class is acceptable. |
| | | /** |
| | | * Determines whether or not the new configuration's implementation |
| | | * class is acceptable. |
| | | */ |
| | | private boolean isJavaClassAcceptable(ExtendedOperationHandlerCfg config, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | IdentityMapperCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd( |
| | | IdentityMapperCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | IdentityMapperCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | IdentityMapperCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | IdentityMapperCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | IdentityMapperCfg configuration) |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012-2014 ForgeRock AS. |
| | | * Portions Copyright 2012-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.core; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | | |
| | | |
| | | import org.opends.server.api.ClientConnection; |
| | | import org.opends.server.api.ConnectionHandler; |
| | | import org.opends.server.api.DirectoryThread; |
| | |
| | | import org.opends.server.types.DisconnectReason; |
| | | |
| | | import static org.opends.messages.CoreMessages.*; |
| | | |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class defines a thread that will be used to terminate client |
| | | * connections if they have been idle for too long. |
| | |
| | | extends DirectoryThread |
| | | implements ServerShutdownListener |
| | | { |
| | | /** |
| | | * The debug log tracer for this object. |
| | | */ |
| | | /** The debug log tracer for this object. */ |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | |
| | | |
| | | // Shutdown monitor state. |
| | | /** Shutdown monitor state. */ |
| | | private volatile boolean shutdownRequested; |
| | | private final Object shutdownLock = new Object(); |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public String getShutdownListenerName() |
| | | { |
| | | return "Idle Time Limit Thread"; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void processServerShutdown(LocalizableMessage reason) |
| | | { |
| | | synchronized (shutdownLock) |
| | |
| | | |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // A mapping between the DNs of the config entries and the associated key |
| | | // manager providers. |
| | | /** |
| | | * A mapping between the DNs of the config entries and the associated key |
| | | * manager providers. |
| | | */ |
| | | private final ConcurrentHashMap<DN,KeyManagerProvider> providers; |
| | | |
| | | private final ServerContext serverContext; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationAddAcceptable( |
| | | KeyManagerProviderCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationAdd( |
| | | KeyManagerProviderCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | KeyManagerProviderCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | KeyManagerProviderCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | KeyManagerProviderCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | KeyManagerProviderCfg configuration) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | LogRetentionPolicyCfg configuration, |
| | |
| | | return isJavaClassAcceptable(configuration, unacceptableReasons); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | LogRetentionPolicyCfg configuration, |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd(LogRetentionPolicyCfg config) |
| | | { |
| | |
| | | return ccr; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | LogRetentionPolicyCfg config) |
| | |
| | | return ccr; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | LogRetentionPolicyCfg configuration, |
| | |
| | | return isJavaClassAcceptable(configuration, unacceptableReasons); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | LogRetentionPolicyCfg configuration) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | LogRotationPolicyCfg configuration, |
| | |
| | | return isJavaClassAcceptable(configuration, unacceptableReasons); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | LogRotationPolicyCfg configuration, |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd(LogRotationPolicyCfg config) |
| | | { |
| | |
| | | return ccr; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | LogRotationPolicyCfg config) |
| | |
| | | return ccr; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | LogRotationPolicyCfg configuration, |
| | |
| | | return isJavaClassAcceptable(configuration, unacceptableReasons); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | LogRotationPolicyCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | MonitorProviderCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd( |
| | | MonitorProviderCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | MonitorProviderCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | MonitorProviderCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | MonitorProviderCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | MonitorProviderCfg configuration) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | PasswordGeneratorCfg configuration, |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | PasswordGeneratorCfg configuration) |
| | |
| | | |
| | | return ccr; |
| | | } |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | PasswordGeneratorCfg configuration, |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd( |
| | | PasswordGeneratorCfg configuration) |
| | |
| | | return ccr; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | PasswordGeneratorCfg configuration, List<LocalizableMessage> unacceptableReasons) |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | PasswordGeneratorCfg configuration) |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2011 ForgeRock AS. |
| | | * Portions copyright 2011-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.core; |
| | | |
| | | |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.Entry; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class defines a data structure that holds information about a Directory |
| | | * Server password policy. |
| | |
| | | public abstract class PasswordPolicy extends AuthenticationPolicy |
| | | { |
| | | |
| | | /** |
| | | * Creates a new password policy. |
| | | */ |
| | | /** Creates a new password policy. */ |
| | | protected PasswordPolicy() |
| | | { |
| | | // Nothing to do. |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public abstract DN getDN(); |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isPasswordPolicy() |
| | | { |
| | | return true; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public PasswordPolicyState createAuthenticationPolicyState(Entry userEntry, |
| | | long time) throws DirectoryException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | AuthenticationPolicyCfg configuration, List<LocalizableMessage> unacceptableReason) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd(AuthenticationPolicyCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | AuthenticationPolicyCfg configuration, List<LocalizableMessage> unacceptableReason) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete(AuthenticationPolicyCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void checkSubentryAddAcceptable(Entry entry) throws DirectoryException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void checkSubentryDeleteAcceptable(Entry entry) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void checkSubentryModifyAcceptable(Entry oldEntry, Entry newEntry) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void checkSubentryModifyDNAcceptable(Entry oldEntry, Entry newEntry) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void handleSubentryAdd(Entry entry) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void handleSubentryDelete(Entry entry) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void handleSubentryModify(Entry oldEntry, Entry newEntry) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void handleSubentryModifyDN(Entry oldEntry, Entry newEntry) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // Creates and registers the provided authentication policy |
| | | // configuration. |
| | | /** |
| | | * Creates and registers the provided authentication policy |
| | | * configuration. |
| | | */ |
| | | private <T extends AuthenticationPolicyCfg> void createAuthenticationPolicy( |
| | | T policyConfiguration) throws ConfigException, InitializationException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // Determines whether or not the new authentication policy configuration's |
| | | // implementation class is acceptable. |
| | | /** |
| | | * Determines whether or not the new authentication policy configuration's |
| | | * implementation class is acceptable. |
| | | */ |
| | | private <T extends AuthenticationPolicyCfg> boolean isAuthenticationPolicyConfigurationAcceptable( |
| | | T policyConfiguration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // Current configuration. |
| | | /** Current configuration. */ |
| | | private PasswordPolicyCfg configuration; |
| | | |
| | | // Indicates whether the attribute type uses the authPassword syntax. |
| | | /** Indicates whether the attribute type uses the authPassword syntax. */ |
| | | private boolean authPasswordSyntax; |
| | | |
| | | // The set of account status notification handlers for this password policy. |
| | | /** The set of account status notification handlers for this password policy. */ |
| | | private Map<DN, AccountStatusNotificationHandler<?>> notificationHandlers; |
| | | |
| | | // The set of password validators that will be used with this |
| | | // password policy. |
| | | /** |
| | | * The set of password validators that will be used with this |
| | | * password policy. |
| | | */ |
| | | private Map<DN, PasswordValidator<?>> passwordValidators; |
| | | |
| | | // The set of default password storage schemes for this password |
| | | // policy. |
| | | /** |
| | | * The set of default password storage schemes for this password policy. |
| | | */ |
| | | private List<PasswordStorageScheme<?>> defaultStorageSchemes; |
| | | |
| | | // The names of the deprecated password storage schemes for this password |
| | | // policy. |
| | | /** |
| | | * The names of the deprecated password storage schemes for this password |
| | | * policy. |
| | | */ |
| | | private Set<String> deprecatedStorageSchemes; |
| | | |
| | | // The password generator for use with this password policy. |
| | | /** The password generator for use with this password policy. */ |
| | | private PasswordGenerator<?> passwordGenerator; |
| | | |
| | | // The the time by which all users will be required to change their |
| | | // passwords. |
| | | /** |
| | | * The the time by which all users will be required to change their |
| | | * passwords. |
| | | */ |
| | | private long requireChangeByTime; |
| | | |
| | | private final ServerContext serverContext; |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeAuthenticationPolicy() |
| | | { |
| | |
| | | return ccr; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | PasswordPolicyCfg configuration, List<LocalizableMessage> unacceptableReasons) |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAuthPasswordSyntax() |
| | | { |
| | | return authPasswordSyntax; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public List<PasswordStorageScheme<?>> getDefaultPasswordStorageSchemes() |
| | | { |
| | | return defaultStorageSchemes; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Set<String> getDeprecatedPasswordStorageSchemes() |
| | | { |
| | | return deprecatedStorageSchemes; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getDN() |
| | | { |
| | | return configuration.dn(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isDefaultPasswordStorageScheme(String name) |
| | | { |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isDeprecatedPasswordStorageScheme(String name) |
| | | { |
| | | return deprecatedStorageSchemes.contains(toLowerCase(name)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Collection<PasswordValidator<?>> getPasswordValidators() |
| | | { |
| | | return passwordValidators.values(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Collection<AccountStatusNotificationHandler<?>> |
| | | getAccountStatusNotificationHandlers() |
| | |
| | | return notificationHandlers.values(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PasswordGenerator<?> getPasswordGenerator() |
| | | { |
| | | return passwordGenerator; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public long getRequireChangeByTime() |
| | | { |
| | |
| | | buffer.append(EOL); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAllowExpiredPasswordChanges() |
| | | { |
| | | return configuration.isAllowExpiredPasswordChanges(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAllowMultiplePasswordValues() |
| | | { |
| | | return configuration.isAllowMultiplePasswordValues(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAllowPreEncodedPasswords() |
| | | { |
| | | return configuration.isAllowPreEncodedPasswords(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAllowUserPasswordChanges() |
| | | { |
| | | return configuration.isAllowUserPasswordChanges(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isExpirePasswordsWithoutWarning() |
| | | { |
| | | return configuration.isExpirePasswordsWithoutWarning(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isForceChangeOnAdd() |
| | | { |
| | | return configuration.isForceChangeOnAdd(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isForceChangeOnReset() |
| | | { |
| | | return configuration.isForceChangeOnReset(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int getGraceLoginCount() |
| | | { |
| | | return configuration.getGraceLoginCount(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public long getIdleLockoutInterval() |
| | | { |
| | | return configuration.getIdleLockoutInterval(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public AttributeType getLastLoginTimeAttribute() |
| | | { |
| | | return configuration.getLastLoginTimeAttribute(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getLastLoginTimeFormat() |
| | | { |
| | | return configuration.getLastLoginTimeFormat(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public long getLockoutDuration() |
| | | { |
| | | return configuration.getLockoutDuration(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int getLockoutFailureCount() |
| | | { |
| | | return configuration.getLockoutFailureCount(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public long getLockoutFailureExpirationInterval() |
| | | { |
| | | return configuration.getLockoutFailureExpirationInterval(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public long getMaxPasswordAge() |
| | | { |
| | | return configuration.getMaxPasswordAge(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public long getMaxPasswordResetAge() |
| | | { |
| | | return configuration.getMaxPasswordResetAge(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public long getMinPasswordAge() |
| | | { |
| | | return configuration.getMinPasswordAge(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public AttributeType getPasswordAttribute() |
| | | { |
| | | return configuration.getPasswordAttribute(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isPasswordChangeRequiresCurrentPassword() |
| | | { |
| | | return configuration.isPasswordChangeRequiresCurrentPassword(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public long getPasswordExpirationWarningInterval() |
| | | { |
| | | return configuration.getPasswordExpirationWarningInterval(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int getPasswordHistoryCount() |
| | | { |
| | | return configuration.getPasswordHistoryCount(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public long getPasswordHistoryDuration() |
| | | { |
| | | return configuration.getPasswordHistoryDuration(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public SortedSet<String> getPreviousLastLoginTimeFormats() |
| | | { |
| | | return configuration.getPreviousLastLoginTimeFormat(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isRequireSecureAuthentication() |
| | | { |
| | | return configuration.isRequireSecureAuthentication(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isRequireSecurePasswordChanges() |
| | | { |
| | | return configuration.isRequireSecurePasswordChanges(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isSkipValidationForAdministrators() |
| | | { |
| | | return configuration.isSkipValidationForAdministrators(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public StateUpdateFailurePolicy getStateUpdateFailurePolicy() |
| | | { |
| | |
| | | this.serverContext = serverContext; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PasswordPolicy createAuthenticationPolicy( |
| | | final PasswordPolicyCfg configuration) throws ConfigException, |
| | |
| | | return policy; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable( |
| | | final PasswordPolicyCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | // The string representation of the user's DN. |
| | | /** The string representation of the user's DN. */ |
| | | private final String userDNString; |
| | | |
| | | // The password policy with which the account is associated. |
| | | /** The password policy with which the account is associated. */ |
| | | private final PasswordPolicy passwordPolicy; |
| | | |
| | | // The current time for use in all password policy calculations. |
| | | /** The current time for use in all password policy calculations. */ |
| | | private final long currentTime; |
| | | |
| | | // The time that the user's password was last changed. |
| | | /** The time that the user's password was last changed. */ |
| | | private long passwordChangedTime = Long.MIN_VALUE; |
| | | |
| | | // Indicates whether the user's account is expired. |
| | | /** Indicates whether the user's account is expired. */ |
| | | private ConditionResult isAccountExpired = ConditionResult.UNDEFINED; |
| | | |
| | | // Indicates whether the user's password is expired. |
| | | /** Indicates whether the user's password is expired. */ |
| | | private ConditionResult isPasswordExpired = ConditionResult.UNDEFINED; |
| | | |
| | | // Indicates whether the warning to send to the client would be the first |
| | | // warning for the user. |
| | | /** |
| | | * Indicates whether the warning to send to the client would be the first |
| | | * warning for the user. |
| | | */ |
| | | private ConditionResult isFirstWarning = ConditionResult.UNDEFINED; |
| | | |
| | | // Indicates whether the user's account is locked by the idle lockout. |
| | | /** Indicates whether the user's account is locked by the idle lockout. */ |
| | | private ConditionResult isIdleLocked = ConditionResult.UNDEFINED; |
| | | |
| | | // Indicates whether the user may use a grace login if the password is expired |
| | | // and there are one or more grace logins remaining. |
| | | /** |
| | | * Indicates whether the user may use a grace login if the password is expired |
| | | * and there are one or more grace logins remaining. |
| | | */ |
| | | private ConditionResult mayUseGraceLogin = ConditionResult.UNDEFINED; |
| | | |
| | | // Indicates whether the user's password must be changed. |
| | | /** Indicates whether the user's password must be changed. */ |
| | | private ConditionResult mustChangePassword = ConditionResult.UNDEFINED; |
| | | |
| | | // Indicates whether the user should be warned of an upcoming expiration. |
| | | /** Indicates whether the user should be warned of an upcoming expiration. */ |
| | | private ConditionResult shouldWarn = ConditionResult.UNDEFINED; |
| | | |
| | | // The number of seconds until the user's account is automatically unlocked. |
| | | /** The number of seconds until the user's account is automatically unlocked. */ |
| | | private int secondsUntilUnlock = Integer.MIN_VALUE; |
| | | |
| | | // The set of authentication failure times for this user. |
| | | /** The set of authentication failure times for this user. */ |
| | | private List<Long> authFailureTimes; |
| | | |
| | | // The set of grace login times for this user. |
| | | /** The set of grace login times for this user. */ |
| | | private List<Long> graceLoginTimes; |
| | | |
| | | // The time that the user's account should expire (or did expire). |
| | | /** The time that the user's account should expire (or did expire). */ |
| | | private long accountExpirationTime = Long.MIN_VALUE; |
| | | |
| | | // The time that the user's entry was locked due to too many authentication |
| | | // failures. |
| | | /** |
| | | * The time that the user's entry was locked due to too many authentication |
| | | * failures. |
| | | */ |
| | | private long failureLockedTime = Long.MIN_VALUE; |
| | | |
| | | // The time that the user last authenticated to the Directory Server. |
| | | /** The time that the user last authenticated to the Directory Server. */ |
| | | private long lastLoginTime = Long.MIN_VALUE; |
| | | |
| | | // The time that the user's password should expire (or did expire). |
| | | /** The time that the user's password should expire (or did expire). */ |
| | | private long passwordExpirationTime = Long.MIN_VALUE; |
| | | |
| | | // The last required change time with which the user complied. |
| | | /** The last required change time with which the user complied. */ |
| | | private long requiredChangeTime = Long.MIN_VALUE; |
| | | |
| | | // The time that the user was first warned about an upcoming expiration. |
| | | /** The time that the user was first warned about an upcoming expiration. */ |
| | | private long warnedTime = Long.MIN_VALUE; |
| | | |
| | | // The set of modifications that should be applied to the user's entry. |
| | | private LinkedList<Modification> modifications |
| | | = new LinkedList<Modification>(); |
| | | /** The set of modifications that should be applied to the user's entry. */ |
| | | private LinkedList<Modification> modifications = new LinkedList<Modification>(); |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PasswordPolicy getAuthenticationPolicy() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordMatches(ByteString password) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeStateAfterBind() |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | PasswordStorageSchemeCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | PasswordStorageSchemeCfg configuration |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | PasswordStorageSchemeCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd( |
| | | PasswordStorageSchemeCfg configuration |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | PasswordStorageSchemeCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | PasswordStorageSchemeCfg configuration |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | PasswordValidatorCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd( |
| | | PasswordValidatorCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | PasswordValidatorCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | PasswordValidatorCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | PasswordValidatorCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | PasswordValidatorCfg configuration) |
| | |
| | | private DirectoryServerPlugin[] intermediateResponsePlugins; |
| | | |
| | | |
| | | // The mapping between the DN of a plugin entry and the plugin instance loaded |
| | | // from that entry. |
| | | /** |
| | | * The mapping between the DN of a plugin entry and the plugin instance loaded |
| | | * from that entry. |
| | | */ |
| | | private ConcurrentHashMap<DN, |
| | | DirectoryServerPlugin<? extends PluginCfg>> |
| | | registeredPlugins; |
| | | |
| | | // The mapping between an operation and a set of post operation plugins |
| | | // it should skip. This pairs up pre and post operation plugin processing |
| | | // such that only plugins that successfully execute its pre op plugin will |
| | | // have its post op plugin executed on a per operation basis. If an |
| | | // operation is not registered on this list then all all pre op plugins |
| | | // executed successfully for this operation so all post op plugins should |
| | | // execute. |
| | | /** |
| | | * The mapping between an operation and a set of post operation plugins |
| | | * it should skip. This pairs up pre and post operation plugin processing |
| | | * such that only plugins that successfully execute its pre op plugin will |
| | | * have its post op plugin executed on a per operation basis. If an |
| | | * operation is not registered on this list then all all pre op plugins |
| | | * executed successfully for this operation so all post op plugins should |
| | | * execute. |
| | | */ |
| | | private ConcurrentHashMap<PluginOperation, ArrayList<DirectoryServerPlugin>> |
| | | skippedPreOperationPlugins; |
| | | |
| | | // The plugin root configuration read at server startup. |
| | | /** The plugin root configuration read at server startup. */ |
| | | private PluginRootCfg pluginRootConfig; |
| | | |
| | | // The lock that will provide threadsafe access to the sets of registered |
| | | // plugins. |
| | | /** |
| | | * The lock that will provide threadsafe access to the sets of registered |
| | | * plugins. |
| | | */ |
| | | private ReentrantLock pluginLock; |
| | | |
| | | private final ServerContext serverContext; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable(PluginCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd( |
| | | PluginCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | PluginCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | PluginCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | PluginCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | PluginCfg configuration) |
| | |
| | | ConfigurationDeleteListener<RootDNUserCfg> |
| | | |
| | | { |
| | | // A mapping between the actual root DNs and their alternate bind DNs. |
| | | /** A mapping between the actual root DNs and their alternate bind DNs. */ |
| | | private ConcurrentHashMap<DN,HashSet<DN>> alternateBindDNs; |
| | | |
| | | // The root privilege change listener that will handle changes to the |
| | | // "cn=Root DNs,cn=config" entry itself. |
| | | /** |
| | | * The root privilege change listener that will handle changes to the |
| | | * "cn=Root DNs,cn=config" entry itself. |
| | | */ |
| | | private RootPrivilegeChangeListener rootPrivilegeChangeListener; |
| | | |
| | | private final ServerContext serverContext; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable(RootDNUserCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd(RootDNUserCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable(RootDNUserCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | RootDNUserCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable(RootDNUserCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | RootDNUserCfg configuration) |
| | |
| | | public class RootPrivilegeChangeListener |
| | | implements ConfigurationChangeListener<RootDNCfg> |
| | | { |
| | | // The set of privileges that will be given to root users by default. |
| | | /** The set of privileges that will be given to root users by default. */ |
| | | private Set<Privilege> defaultRootPrivileges; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new instance of this root privilege change listener. |
| | | */ |
| | | /** Creates a new instance of this root privilege change listener. */ |
| | | public RootPrivilegeChangeListener() |
| | | { |
| | | defaultRootPrivileges = Privilege.getDefaultRootPrivileges(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable(RootDNCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange(RootDNCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | SASLMechanismHandlerCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd( |
| | | SASLMechanismHandlerCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | SASLMechanismHandlerCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | SASLMechanismHandlerCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | SASLMechanismHandlerCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | SASLMechanismHandlerCfg configuration) |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.core; |
| | | |
| | |
| | | */ |
| | | public static class SchemaFileFilter implements FilenameFilter |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean accept(File directory, String filename) |
| | | { |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // A mapping between the DNs and applicable subentries. |
| | | /** A mapping between the DNs and applicable subentries. */ |
| | | private HashMap<DN,List<SubEntry>> dn2SubEntry; |
| | | |
| | | // A mapping between the DNs and applicable collective subentries. |
| | | /** A mapping between the DNs and applicable collective subentries. */ |
| | | private HashMap<DN,List<SubEntry>> dn2CollectiveSubEntry; |
| | | |
| | | // A mapping between subentry DNs and subentry objects. |
| | | /** A mapping between subentry DNs and subentry objects. */ |
| | | private DITCacheMap<SubEntry> dit2SubEntry; |
| | | |
| | | // Internal search all operational attributes. |
| | | /** Internal search all operational attributes. */ |
| | | private LinkedHashSet<String> requestAttrs; |
| | | |
| | | // Lock to protect internal data structures. |
| | | /** Lock to protect internal data structures. */ |
| | | private final ReentrantReadWriteLock lock; |
| | | |
| | | // The set of change notification listeners. |
| | | /** The set of change notification listeners. */ |
| | | private CopyOnWriteArrayList<SubentryChangeListener> |
| | | changeListeners; |
| | | |
| | | // Dummy configuration DN for Subentry Manager. |
| | | /** Dummy configuration DN for Subentry Manager. */ |
| | | private static final String CONFIG_DN = "cn=Subentry Manager,cn=config"; |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PreOperation doPreOperation( |
| | | PreOperationAddOperation addOperation) |
| | |
| | | return PluginResult.PreOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PreOperation doPreOperation( |
| | | PreOperationDeleteOperation deleteOperation) |
| | |
| | | return PluginResult.PreOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PreOperation doPreOperation( |
| | | PreOperationModifyOperation modifyOperation) |
| | |
| | | return PluginResult.PreOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PreOperation doPreOperation(PreOperationModifyDNOperation modifyDNOperation) |
| | | { |
| | |
| | | return PluginResult.PreOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PostOperation doPostOperation( |
| | | PostOperationAddOperation addOperation) |
| | |
| | | return PluginResult.PostOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PostOperation doPostOperation( |
| | | PostOperationDeleteOperation deleteOperation) |
| | |
| | | return PluginResult.PostOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PostOperation doPostOperation( |
| | | PostOperationModifyOperation modifyOperation) |
| | |
| | | return PluginResult.PostOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PostOperation doPostOperation( |
| | | PostOperationModifyDNOperation modifyDNOperation) |
| | |
| | | return PluginResult.PostOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void doPostSynchronization( |
| | | PostSynchronizationAddOperation addOperation) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void doPostSynchronization( |
| | | PostSynchronizationDeleteOperation deleteOperation) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void doPostSynchronization( |
| | | PostSynchronizationModifyOperation modifyOperation) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void doPostSynchronization( |
| | | PostSynchronizationModifyDNOperation modifyDNOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | SynchronizationProviderCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | SynchronizationProviderCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd( |
| | | SynchronizationProviderCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | SynchronizationProviderCfg configuration, |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | SynchronizationProviderCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | SynchronizationProviderCfg configuration, |
| | |
| | | |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // A mapping between the DNs of the config entries and the associated trust |
| | | // manager providers. |
| | | /** |
| | | * A mapping between the DNs of the config entries and the associated trust |
| | | * manager providers. |
| | | */ |
| | | private final ConcurrentHashMap<DN,TrustManagerProvider> providers; |
| | | |
| | | private final ServerContext serverContext; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationAddAcceptable( |
| | | TrustManagerProviderCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationAdd( |
| | | TrustManagerProviderCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | TrustManagerProviderCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | TrustManagerProviderCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | TrustManagerProviderCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | TrustManagerProviderCfg configuration) |
| | | { |
| | |
| | | ERR_CANNOT_CANCEL_UNBIND.get()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final OperationType getOperationType() |
| | | { |
| | |
| | | // candidate for being called by the logging subsystem. |
| | | return OperationType.UNBIND; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final List<Control> getResponseControls() |
| | | { |
| | |
| | | return NO_RESPONSE_CONTROLS; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void addResponseControl(Control control) |
| | | { |
| | | // An unbind operation can never have a response, so just ignore this. |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void removeResponseControl(Control control) |
| | | { |
| | |
| | | setProcessingStopTime(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void toString(StringBuilder buffer) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable(WorkQueueCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange(WorkQueueCfg configuration) |
| | | { |
| | |
| | | return fValue.hashCode(); |
| | | } |
| | | |
| | | // state |
| | | /** State. */ |
| | | private final UUID fValue; |
| | | } |
| | | |
| | |
| | | return fIsCompromised; |
| | | } |
| | | |
| | | // state |
| | | /** State. */ |
| | | private final KeyEntryID fKeyID; |
| | | private final SecretKey fSecretKey; |
| | | private final int fKeyLengthBits; |
| | |
| | | return fIVLengthBits; |
| | | } |
| | | |
| | | // state |
| | | /** State. */ |
| | | private final String fType; |
| | | private int fIVLengthBits = -1; |
| | | } |
| | |
| | | return fType; |
| | | } |
| | | |
| | | // state |
| | | /** State. */ |
| | | private final String fType; |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // The reference to the Directory Server crypto manager that we will use to |
| | | // handle the encryption/decryption. |
| | | /** |
| | | * The reference to the Directory Server crypto manager that we will use to |
| | | * handle the encryption/decryption. |
| | | */ |
| | | private CryptoManager cryptoManager; |
| | | |
| | | |
| | |
| | | super(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordStorageScheme( |
| | | AESPasswordStorageSchemeCfg configuration) |
| | |
| | | cryptoManager = DirectoryServer.getCryptoManager(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getStorageSchemeName() |
| | | { |
| | | return STORAGE_SCHEME_NAME_AES; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePasswordWithScheme(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | return ByteString.valueOf(buffer.toString()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordMatches(ByteSequence plaintextPassword, |
| | | ByteSequence storedPassword) |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isReversible() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getPlaintextValue(ByteSequence storedPassword) |
| | | throws DirectoryException |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodeAuthPassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean authPasswordMatches(ByteSequence plaintextPassword, |
| | | String authInfo, String authValue) |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getAuthPasswordPlaintextValue(String authInfo, |
| | | String authValue) |
| | |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | |
| | | super(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeSASLMechanismHandler(AnonymousSASLMechanismHandlerCfg |
| | | configuration) |
| | |
| | | this); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeSASLMechanismHandler() |
| | | { |
| | | DirectoryServer.deregisterSASLMechanismHandler(SASL_MECHANISM_ANONYMOUS); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processSASLBind(BindOperation bindOperation) |
| | | { |
| | |
| | | bindOperation.setResultCode(ResultCode.SUCCESS); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | |
| | | implements ConfigurationChangeListener< |
| | | AttributeValuePasswordValidatorCfg> |
| | | { |
| | | // The current configuration for this password validator. |
| | | /** The current configuration for this password validator. */ |
| | | private AttributeValuePasswordValidatorCfg currentConfig; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordValidator( |
| | | AttributeValuePasswordValidatorCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizePasswordValidator() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordIsAcceptable(ByteString newPassword, |
| | | Set<ByteString> currentPasswords, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(PasswordValidatorCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | AttributeValuePasswordValidatorCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | AttributeValuePasswordValidatorCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordStorageScheme( |
| | | Base64PasswordStorageSchemeCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getStorageSchemeName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePasswordWithScheme(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordMatches(ByteSequence plaintextPassword, |
| | | ByteSequence storedPassword) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isReversible() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getPlaintextValue(ByteSequence storedPassword) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodeAuthPassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean authPasswordMatches(ByteSequence plaintextPassword, |
| | | String authInfo, String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getAuthPasswordPlaintextValue(String authInfo, |
| | | String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeTrustManagerProvider( |
| | | BlindTrustManagerProviderCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public TrustManager[] getTrustManagers() |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | // The reference to the Directory Server crypto manager that we will use to |
| | | // handle the encryption/decryption. |
| | | /** |
| | | * The reference to the Directory Server crypto manager that we will use to |
| | | * handle the encryption/decryption. |
| | | */ |
| | | private CryptoManager cryptoManager; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordStorageScheme( |
| | | BlowfishPasswordStorageSchemeCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getStorageSchemeName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePasswordWithScheme(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordMatches(ByteSequence plaintextPassword, |
| | | ByteSequence storedPassword) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isReversible() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getPlaintextValue(ByteSequence storedPassword) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodeAuthPassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean authPasswordMatches(ByteSequence plaintextPassword, |
| | | String authInfo, String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getAuthPasswordPlaintextValue(String authInfo, |
| | | String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // An array filled with the inner pad byte. |
| | | /** An array filled with the inner pad byte. */ |
| | | private byte[] iPad; |
| | | |
| | | // An array filled with the outer pad byte. |
| | | /** An array filled with the outer pad byte. */ |
| | | private byte[] oPad; |
| | | |
| | | // The current configuration for this SASL mechanism handler. |
| | | /** The current configuration for this SASL mechanism handler. */ |
| | | private CramMD5SASLMechanismHandlerCfg currentConfig; |
| | | |
| | | // The identity mapper that will be used to map ID strings to user entries. |
| | | /** The identity mapper that will be used to map ID strings to user entries. */ |
| | | private IdentityMapper<?> identityMapper; |
| | | |
| | | // The message digest engine that will be used to create the MD5 digests. |
| | | /** The message digest engine that will be used to create the MD5 digests. */ |
| | | private MessageDigest md5Digest; |
| | | |
| | | // The lock that will be used to provide threadsafe access to the message |
| | | // digest. |
| | | /** |
| | | * The lock that will be used to provide threadsafe access to the message |
| | | * digest. |
| | | */ |
| | | private Object digestLock; |
| | | |
| | | // The random number generator that we will use to create the server |
| | | // challenge. |
| | | /** |
| | | * The random number generator that we will use to create the server challenge. |
| | | */ |
| | | private SecureRandom randomGenerator; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeSASLMechanismHandler( |
| | | CramMD5SASLMechanismHandlerCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeSASLMechanismHandler() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processSASLBind(BindOperation bindOperation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable( |
| | | SASLMechanismHandlerCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | CramMD5SASLMechanismHandlerCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | CramMD5SASLMechanismHandlerCfg configuration) |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // The human-readable name for this policy. |
| | | /** The human-readable name for this policy. */ |
| | | private String policyName; |
| | | |
| | | |
| | |
| | | extends PasswordValidator<CharacterSetPasswordValidatorCfg> |
| | | implements ConfigurationChangeListener<CharacterSetPasswordValidatorCfg> |
| | | { |
| | | // The current configuration for this password validator. |
| | | /** The current configuration for this password validator. */ |
| | | private CharacterSetPasswordValidatorCfg currentConfig; |
| | | |
| | | // A mapping between the character sets and the minimum number of characters |
| | | // required for each. |
| | | /** |
| | | * A mapping between the character sets and the minimum number of characters |
| | | * required for each. |
| | | */ |
| | | private HashMap<String,Integer> characterSets; |
| | | |
| | | // A mapping between the character ranges and the minimum number of characters |
| | | // required for each. |
| | | /** |
| | | * A mapping between the character ranges and the minimum number of characters |
| | | * required for each. |
| | | */ |
| | | private HashMap<String,Integer> characterRanges; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordValidator( |
| | | CharacterSetPasswordValidatorCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizePasswordValidator() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordIsAcceptable(ByteString newPassword, |
| | | Set<ByteString> currentPasswords, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(PasswordValidatorCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | CharacterSetPasswordValidatorCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | CharacterSetPasswordValidatorCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordStorageScheme( |
| | | ClearPasswordStorageSchemeCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getStorageSchemeName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePasswordWithScheme(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordMatches(ByteSequence plaintextPassword, |
| | | ByteSequence storedPassword) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isReversible() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getPlaintextValue(ByteSequence storedPassword) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodeAuthPassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean authPasswordMatches(ByteSequence plaintextPassword, |
| | | String authInfo, String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getAuthPasswordPlaintextValue(String authInfo, |
| | | String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordStorageScheme( |
| | | CryptPasswordStorageSchemeCfg configuration) |
| | |
| | | currentConfig = configuration; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getStorageSchemeName() |
| | | { |
| | |
| | | return ByteString.valueOf(output); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePasswordWithScheme(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordMatches(ByteSequence plaintextPassword, |
| | | ByteSequence storedPassword) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodeAuthPassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean authPasswordMatches(ByteSequence plaintextPassword, |
| | | String authInfo, String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isReversible() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getPlaintextValue(ByteSequence storedPassword) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getAuthPasswordPlaintextValue(String authInfo, |
| | | String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable( |
| | | PasswordStorageSchemeCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | CryptPasswordStorageSchemeCfg configuration, |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The current configuration for this password validator. |
| | | /** The current configuration for this password validator. */ |
| | | private DictionaryPasswordValidatorCfg currentConfig; |
| | | |
| | | // The current dictionary that we should use when performing the validation. |
| | | /** The current dictionary that we should use when performing the validation. */ |
| | | private HashSet<String> dictionary; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordValidator( |
| | | DictionaryPasswordValidatorCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizePasswordValidator() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordIsAcceptable(ByteString newPassword, |
| | | Set<ByteString> currentPasswords, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(PasswordValidatorCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | DictionaryPasswordValidatorCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | DictionaryPasswordValidatorCfg configuration) |
| | |
| | | |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The current configuration for this SASL mechanism handler. |
| | | /** The current configuration for this SASL mechanism handler. */ |
| | | private DigestMD5SASLMechanismHandlerCfg configuration; |
| | | |
| | | // The identity mapper that will be used to map ID strings to user entries. |
| | | /** The identity mapper that will be used to map ID strings to user entries. */ |
| | | private IdentityMapper<?> identityMapper; |
| | | |
| | | //Properties to use when creating a SASL server to process the authentication. |
| | | /** Properties to use when creating a SASL server to process the authentication. */ |
| | | private HashMap<String,String> saslProps; |
| | | |
| | | //The fully qualified domain name used when creating the SASL server. |
| | | /** The fully qualified domain name used when creating the SASL server. */ |
| | | private String serverFQDN; |
| | | |
| | | // The DN of the configuration entry for this SASL mechanism handler. |
| | | /** The DN of the configuration entry for this SASL mechanism handler. */ |
| | | private DN configEntryDN; |
| | | |
| | | //Property used to set the realm in the environment. |
| | | private static final String REALM_PROPERTY = |
| | | "com.sun.security.sasl.digest.realm"; |
| | | /** Property used to set the realm in the environment. */ |
| | | private static final String REALM_PROPERTY = "com.sun.security.sasl.digest.realm"; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeSASLMechanismHandler( |
| | | DigestMD5SASLMechanismHandlerCfg configuration) |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeSASLMechanismHandler() { |
| | | configuration.removeDigestMD5ChangeListener(this); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processSASLBind(BindOperation bindOp) { |
| | | ClientConnection clientConnection = bindOp.getClientConnection(); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable( |
| | | SASLMechanismHandlerCfg configuration, |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | DigestMD5SASLMechanismHandlerCfg configuration, |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | DigestMD5SASLMechanismHandlerCfg configuration) |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The DN of the entry that holds the definition for this group. |
| | | /** The DN of the entry that holds the definition for this group. */ |
| | | private DN groupEntryDN; |
| | | |
| | | // The set of the LDAP URLs that define the membership criteria. |
| | | /** The set of the LDAP URLs that define the membership criteria. */ |
| | | private LinkedHashSet<LDAPURL> memberURLs; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeGroupImplementation( |
| | | DynamicGroupImplementationCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DynamicGroup newInstance(ServerContext serverContext, Entry groupEntry) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public SearchFilter getGroupDefinitionFilter() |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isGroupDefinition(Entry entry) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getGroupDN() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setGroupDN(DN groupDN) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean supportsNestedGroups() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public List<DN> getNestedGroupDNs() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void addNestedGroup(DN nestedGroupDN) |
| | | throws UnsupportedOperationException, DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void removeNestedGroup(DN nestedGroupDN) |
| | | throws UnsupportedOperationException, DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isMember(DN userDN, Set<DN> examinedGroups) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isMember(Entry userEntry, Set<DN> examinedGroups) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public MemberList getMembers() |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public MemberList getMembers(DN baseDN, SearchScope scope, |
| | | SearchFilter filter) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean mayAlterMemberList() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void addMember(Entry userEntry) |
| | | throws UnsupportedOperationException, DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void removeMember(DN userDN) |
| | | throws UnsupportedOperationException, DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | |
| | | public class DynamicGroupMemberList |
| | | extends MemberList |
| | | { |
| | | // Indicates whether the search thread has completed its processing. |
| | | /** Indicates whether the search thread has completed its processing. */ |
| | | private boolean searchesCompleted; |
| | | |
| | | // The base DN to use when filtering the set of group members. |
| | | /** The base DN to use when filtering the set of group members. */ |
| | | private final DN baseDN; |
| | | |
| | | // The DN of the entry containing the group definition. |
| | | /** The DN of the entry containing the group definition. */ |
| | | private final DN groupDN; |
| | | |
| | | // The queue into which results will be placed while they are waiting to be |
| | | // returned. The types of objects that may be placed in this queue are Entry |
| | | // objects to return or MembershipException objects to throw. |
| | | /** |
| | | * The queue into which results will be placed while they are waiting to be |
| | | * returned. The types of objects that may be placed in this queue are Entry |
| | | * objects to return or MembershipException objects to throw. |
| | | */ |
| | | private final LinkedBlockingQueue<Object> resultQueue; |
| | | |
| | | // The search filter to use when filtering the set of group members. |
| | | /** The search filter to use when filtering the set of group members. */ |
| | | private final SearchFilter filter; |
| | | |
| | | // The search scope to use when filtering the set of group members. |
| | | /** The search scope to use when filtering the set of group members. */ |
| | | private final SearchScope scope; |
| | | |
| | | // The set of LDAP URLs that define the membership criteria. |
| | | /** The set of LDAP URLs that define the membership criteria. */ |
| | | private final Set<LDAPURL> memberURLs; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean hasMoreMembers() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Entry nextMemberEntry() |
| | | throws MembershipException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void close() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The set of base DNs for the search requests. |
| | | /** The set of base DNs for the search requests. */ |
| | | private final DN[] baseDNs; |
| | | |
| | | // The member list with which this search thread is associated. |
| | | /** The member list with which this search thread is associated. */ |
| | | private final DynamicGroupMemberList memberList; |
| | | |
| | | // A counter used to keep track of which search is currently in progress. |
| | | /** A counter used to keep track of which search is currently in progress. */ |
| | | private int searchCounter; |
| | | |
| | | // The set of member URLs for determining whether entries match the criteria. |
| | | /** The set of member URLs for determining whether entries match the criteria. */ |
| | | private final LDAPURL[][] memberURLs; |
| | | |
| | | // The set of search filters for the search requests. |
| | | /** The set of search filters for the search requests. */ |
| | | private final SearchFilter[] searchFilters; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void handleInternalSearchEntry(InternalSearchOperation searchOperation, |
| | | SearchResultEntry searchEntry) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void handleInternalSearchReference( |
| | | InternalSearchOperation searchOperation, |
| | |
| | | private static final Comparator<Attribute> ATTRIBUTE_COMPARATOR = |
| | | new Comparator<Attribute>() |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int compare(final Attribute a1, final Attribute a2) |
| | | { |
| | |
| | | } |
| | | }; |
| | | |
| | | // Current configuration. |
| | | /** Current configuration. */ |
| | | private volatile EntityTagVirtualAttributeCfg config; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | final EntityTagVirtualAttributeCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConditionResult approximatelyEqualTo(final Entry entry, |
| | | final VirtualAttributeRule rule, final ByteString value) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeVirtualAttributeProvider() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Attribute getValues(final Entry entry, final VirtualAttributeRule rule) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConditionResult greaterThanOrEqualTo(final Entry entry, |
| | | final VirtualAttributeRule rule, final ByteString value) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean hasValue(final Entry entry, final VirtualAttributeRule rule) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeVirtualAttributeProvider( |
| | | final EntityTagVirtualAttributeCfg configuration) throws ConfigException, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | final EntityTagVirtualAttributeCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isMultiValued() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isSearchable(final VirtualAttributeRule rule, |
| | | final SearchOperation searchOperation, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConditionResult lessThanOrEqualTo(final Entry entry, |
| | | final VirtualAttributeRule rule, final ByteString value) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConditionResult matchesSubstring(final Entry entry, |
| | | final VirtualAttributeRule rule, final ByteString subInitial, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processSearch(final VirtualAttributeRule rule, |
| | | final SearchOperation searchOperation) |
| | |
| | | */ |
| | | public class ConfigErrorHandler |
| | | { |
| | | // Configuration phase. |
| | | /** Configuration phase. */ |
| | | private EntryCacheCommon.ConfigPhase _configPhase; |
| | | |
| | | // Unacceptable reasons. Used when _configPhase is PHASE_ACCEPTABLE. |
| | | /** Unacceptable reasons. Used when _configPhase is PHASE_ACCEPTABLE. */ |
| | | private List<LocalizableMessage> _unacceptableReasons; |
| | | |
| | | // Error messages. Used when _configPhase is PHASE_APPLY. |
| | | /** Error messages. Used when _configPhase is PHASE_APPLY. */ |
| | | private ArrayList<LocalizableMessage> _errorMessages; |
| | | |
| | | // Result code. Used when _configPhase is PHASE_APPLY. |
| | | /** Result code. Used when _configPhase is PHASE_APPLY. */ |
| | | private ResultCode _resultCode; |
| | | |
| | | // Acceptable Configuration ? Used when _configPhase is PHASE_ACCEPTABLE |
| | | // or PHASE_APPLY. |
| | | /** |
| | | * Acceptable Configuration ? Used when _configPhase is PHASE_ACCEPTABLE |
| | | * or PHASE_APPLY. |
| | | */ |
| | | private boolean _isAcceptable; |
| | | |
| | | // Indicates whether administrative action is required or not. Used when |
| | | // _configPhase is PHASE_APPLY. |
| | | /** |
| | | * Indicates whether administrative action is required or not. Used when |
| | | * _configPhase is PHASE_APPLY. |
| | | */ |
| | | private boolean _isAdminActionRequired; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | // The DN of the configuration entry for this notification handler. |
| | | /** The DN of the configuration entry for this notification handler. */ |
| | | private DN configEntryDN; |
| | | |
| | | // The set of notification types that should generate log messages. |
| | | /** The set of notification types that should generate log messages. */ |
| | | private HashSet<AccountStatusNotificationType> notificationTypes; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initializeStatusNotificationHandler( |
| | | ErrorLogAccountStatusNotificationHandlerCfg configuration |
| | | ) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void handleStatusNotification( |
| | | AccountStatusNotification notification) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable( |
| | | AccountStatusNotificationHandlerCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ErrorLogAccountStatusNotificationHandlerCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange ( |
| | | ErrorLogAccountStatusNotificationHandlerCfg configuration |
| | | ) |
| | |
| | | implements ConfigurationChangeListener< |
| | | ExactMatchIdentityMapperCfg> |
| | | { |
| | | // The set of attribute types to use when performing lookups. |
| | | /** The set of attribute types to use when performing lookups. */ |
| | | private AttributeType[] attributeTypes; |
| | | |
| | | // The DN of the configuration entry for this identity mapper. |
| | | /** The DN of the configuration entry for this identity mapper. */ |
| | | private DN configEntryDN; |
| | | |
| | | // The current configuration for this identity mapper. |
| | | /** The current configuration for this identity mapper. */ |
| | | private ExactMatchIdentityMapperCfg currentConfig; |
| | | |
| | | // The set of attributes to return in search result entries. |
| | | /** The set of attributes to return in search result entries. */ |
| | | private LinkedHashSet<String> requestedAttributes; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeIdentityMapper( |
| | | ExactMatchIdentityMapperCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(IdentityMapperCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ExactMatchIdentityMapperCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | ExactMatchIdentityMapperCfg configuration) |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The attribute type that should hold the certificates to use for the |
| | | // validation. |
| | | /** |
| | | * The attribute type that should hold the certificates to use for the |
| | | * validation. |
| | | */ |
| | | private AttributeType certificateAttributeType; |
| | | |
| | | // Indicates whether to attempt to validate the certificate presented by the |
| | | // client with a certificate in the user's entry. |
| | | /** |
| | | * Indicates whether to attempt to validate the certificate presented by the |
| | | * client with a certificate in the user's entry. |
| | | */ |
| | | private CertificateValidationPolicy validationPolicy; |
| | | |
| | | // The current configuration for this SASL mechanism handler. |
| | | /** The current configuration for this SASL mechanism handler. */ |
| | | private ExternalSASLMechanismHandlerCfg currentConfig; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeSASLMechanismHandler( |
| | | ExternalSASLMechanismHandlerCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeSASLMechanismHandler() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processSASLBind(BindOperation bindOperation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable( |
| | | SASLMechanismHandlerCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ExternalSASLMechanismHandlerCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | ExternalSASLMechanismHandlerCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // The DN of the configuration entry for this key manager provider. |
| | | /** The DN of the configuration entry for this key manager provider. */ |
| | | private DN configEntryDN; |
| | | |
| | | // The PIN needed to access the keystore. |
| | | /** The PIN needed to access the keystore. */ |
| | | private char[] keyStorePIN; |
| | | |
| | | // The configuration for this key manager provider. |
| | | /** The configuration for this key manager provider. */ |
| | | private FileBasedKeyManagerProviderCfg currentConfig; |
| | | |
| | | // The path to the key store backing file. |
| | | /** The path to the key store backing file. */ |
| | | private String keyStoreFile; |
| | | |
| | | // The key store type to use. |
| | | /** The key store type to use. */ |
| | | private String keyStoreType; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeKeyManagerProvider( |
| | | FileBasedKeyManagerProviderCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable( |
| | | FileBasedKeyManagerProviderCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | FileBasedKeyManagerProviderCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | FileBasedKeyManagerProviderCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // The DN of the configuration entry for this trust manager provider. |
| | | /** The DN of the configuration entry for this trust manager provider. */ |
| | | private DN configEntryDN; |
| | | |
| | | // The PIN needed to access the trust store. |
| | | /** The PIN needed to access the trust store. */ |
| | | private char[] trustStorePIN; |
| | | |
| | | // The handle to the configuration for this trust manager. |
| | | /** The handle to the configuration for this trust manager. */ |
| | | private FileBasedTrustManagerProviderCfg currentConfig; |
| | | |
| | | // The path to the trust store backing file. |
| | | /** The path to the trust store backing file. */ |
| | | private String trustStoreFile; |
| | | |
| | | // The trust store type to use. |
| | | /** The trust store type to use. */ |
| | | private String trustStoreType; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeTrustManagerProvider( |
| | | FileBasedTrustManagerProviderCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeTrustManagerProvider() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public TrustManager[] getTrustManagers() |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable( |
| | | TrustManagerProviderCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | FileBasedTrustManagerProviderCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | return configAcceptable; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | FileBasedTrustManagerProviderCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // The DN of the configuration entry for this certificate mapper. |
| | | /** The DN of the configuration entry for this certificate mapper. */ |
| | | private DN configEntryDN; |
| | | |
| | | // The current configuration for this certificate mapper. |
| | | /** The current configuration for this certificate mapper. */ |
| | | private FingerprintCertificateMapperCfg currentConfig; |
| | | |
| | | // The algorithm that will be used to generate the fingerprint. |
| | | /** The algorithm that will be used to generate the fingerprint. */ |
| | | private String fingerprintAlgorithm; |
| | | |
| | | // The set of attributes to return in search result entries. |
| | | /** The set of attributes to return in search result entries. */ |
| | | private LinkedHashSet<String> requestedAttributes; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeCertificateMapper( |
| | | FingerprintCertificateMapperCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeCertificateMapper() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Entry mapCertificateToUser(Certificate[] certificateChain) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(CertificateMapperCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | FingerprintCertificateMapperCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | FingerprintCertificateMapperCfg configuration) |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The DN of the configuration entry for this SASL mechanism handler. |
| | | /** The DN of the configuration entry for this SASL mechanism handler. */ |
| | | private DN configEntryDN; |
| | | |
| | | // The current configuration for this SASL mechanism handler. |
| | | /** The current configuration for this SASL mechanism handler. */ |
| | | private GSSAPISASLMechanismHandlerCfg configuration; |
| | | |
| | | // The identity mapper that will be used to map identities. |
| | | /** The identity mapper that will be used to map identities. */ |
| | | private IdentityMapper<?> identityMapper; |
| | | |
| | | // The properties to use when creating a SASL server to process the |
| | | // GSSAPI authentication. |
| | | /** |
| | | * The properties to use when creating a SASL server to process the |
| | | * GSSAPI authentication. |
| | | */ |
| | | private HashMap<String, String> saslProps; |
| | | |
| | | // The fully qualified domain name used when creating the SASL server. |
| | | /** The fully qualified domain name used when creating the SASL server. */ |
| | | private String serverFQDN; |
| | | |
| | | // The login context used to perform server-side authentication. |
| | | /** The login context used to perform server-side authentication. */ |
| | | private volatile LoginContext loginContext; |
| | | private final Object loginContextLock = new Object(); |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeSASLMechanismHandler( |
| | | GSSAPISASLMechanismHandlerCfg configuration) throws ConfigException, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeSASLMechanismHandler() { |
| | | logout(); |
| | |
| | | System.clearProperty(JAAS_PROPERTY_SUBJECT_CREDS_ONLY); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processSASLBind(BindOperation bindOp) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable( |
| | | SASLMechanismHandlerCfg configuration, List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | GSSAPISASLMechanismHandlerCfg newConfiguration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange(GSSAPISASLMechanismHandlerCfg newConfiguration) |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | * Portions Copyright 2013-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | super.initializeExtendedOperationHandler(config); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processExtendedOperation(ExtendedOperation operation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // The current configuration for this alert handler. |
| | | /** The current configuration for this alert handler. */ |
| | | private AlertHandlerCfg currentConfig; |
| | | |
| | | // The sequence number generator used for this alert handler. |
| | | /** The sequence number generator used for this alert handler. */ |
| | | private AtomicLong sequenceNumber; |
| | | |
| | | // The DN of the configuration entry with which this alert handler is |
| | | // associated. |
| | | /** |
| | | * The DN of the configuration entry with which this alert handler is |
| | | * associated. |
| | | */ |
| | | private DN configEntryDN; |
| | | |
| | | // The JMX object name used for this JMX alert handler. |
| | | /** The JMX object name used for this JMX alert handler. */ |
| | | private ObjectName objectName; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initializeAlertHandler(JMXAlertHandlerCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public AlertHandlerCfg getAlertHandlerConfiguration() |
| | | { |
| | | return currentConfig; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationAcceptable(AlertHandlerCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void finalizeAlertHandler() |
| | | { |
| | | // No action is required. |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void sendAlertNotification(AlertGenerator generator, String alertType, |
| | | LocalizableMessage alertMessage) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | JMXAlertHandlerCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | JMXAlertHandlerCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void close() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString search(final DN baseDN, final SearchScope scope, |
| | | final SearchFilter filter) throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void simpleBind(final ByteString username, |
| | | final ByteString password) throws DirectoryException |
| | |
| | | { |
| | | private final ConnectionFactory factory; |
| | | |
| | | // isAvailable acts as memory barrier for lastException. |
| | | /** IsAvailable acts as memory barrier for lastException. */ |
| | | private volatile boolean isAvailable = true; |
| | | private DirectoryException lastException; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void close() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Connection getConnection() throws DirectoryException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final Connection getConnection() throws DirectoryException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void close() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Connection getConnection() throws DirectoryException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void close() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString search(final DN baseDN, final SearchScope scope, |
| | | final SearchFilter filter) throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void simpleBind(final ByteString username, |
| | | final ByteString password) throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | // Guarded by PolicyImpl.lock. |
| | | /** Guarded by PolicyImpl.lock. */ |
| | | private boolean poolIsClosed; |
| | | |
| | | private final ConnectionFactory factory; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Connection getConnection() throws DirectoryException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | int getStartIndex() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void close() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString search(final DN baseDN, final SearchScope scope, |
| | | final SearchFilter filter) throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void simpleBind(final ByteString username, |
| | | final ByteString password) throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void finalize() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // Reads a response message and adapts errors to directory exceptions. |
| | | /** Reads a response message and adapts errors to directory exceptions. */ |
| | | private LDAPMessage readResponse() throws DirectoryException |
| | | { |
| | | final LDAPMessage responseMessage; |
| | |
| | | |
| | | |
| | | |
| | | // Sends a request message and adapts errors to directory exceptions. |
| | | /** Sends a request message and adapts errors to directory exceptions. */ |
| | | private void sendRequest(final ProtocolOp request) |
| | | throws DirectoryException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void close() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Connection getConnection() throws DirectoryException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | int getStartIndex() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeStateAfterBind() throws DirectoryException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public AuthenticationPolicy getAuthenticationPolicy() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordMatches(final ByteString password) |
| | | throws DirectoryException |
| | |
| | | private final ReadLock sharedLock = lock.readLock(); |
| | | private final WriteLock exclusiveLock = lock.writeLock(); |
| | | |
| | | // Current configuration. |
| | | /** Current configuration. */ |
| | | private LDAPPassThroughAuthenticationPolicyCfg cfg; |
| | | |
| | | private ConnectionFactory searchFactory; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | final LDAPPassThroughAuthenticationPolicyCfg cfg) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public AuthenticationPolicyState createAuthenticationPolicyState( |
| | | final Entry userEntry, final long time) throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeAuthenticationPolicy() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getDN() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | final LDAPPassThroughAuthenticationPolicyCfg cfg, |
| | |
| | | |
| | | |
| | | |
| | | // Debug tracer for this class. |
| | | /** Debug tracer for this class. */ |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | /** |
| | | * Attribute list for searches requesting no attributes. |
| | | */ |
| | | static final LinkedHashSet<String> NO_ATTRIBUTES = new LinkedHashSet<String>( |
| | | 1); |
| | | /** Attribute list for searches requesting no attributes. */ |
| | | static final LinkedHashSet<String> NO_ATTRIBUTES = new LinkedHashSet<String>(1); |
| | | static |
| | | { |
| | | NO_ATTRIBUTES.add(SchemaConstants.NO_ATTRIBUTES); |
| | | } |
| | | |
| | | // The provider which should be used by policies to create LDAP connections. |
| | | /** The provider which should be used by policies to create LDAP connections. */ |
| | | private final Provider provider; |
| | | |
| | | private ServerContext serverContext; |
| | | |
| | | /** |
| | | * The default LDAP connection factory provider. |
| | | */ |
| | | /** The default LDAP connection factory provider. */ |
| | | private static final Provider DEFAULT_PROVIDER = new Provider() |
| | | { |
| | | |
| | | // Global scheduler used for periodically monitoring connection factories in |
| | | // order to detect when they are online. |
| | | /** |
| | | * Global scheduler used for periodically monitoring connection factories in |
| | | * order to detect when they are online. |
| | | */ |
| | | private final ScheduledExecutorService scheduler = Executors |
| | | .newScheduledThreadPool(2, new ThreadFactory() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | //Get the search bind password performing mapped searches. |
| | | // |
| | | // We will offer several places to look for the password, and we will |
| | | // do so in the following order: |
| | | // |
| | | // - In a specified Java property |
| | | // - In a specified environment variable |
| | | // - In a specified file on the server filesystem. |
| | | // - As the value of a configuration attribute. |
| | | // |
| | | // In any case, the password must be in the clear. |
| | | /** |
| | | * Get the search bind password performing mapped searches. |
| | | * We will offer several places to look for the password, and we will |
| | | * do so in the following order: |
| | | * - In a specified Java property |
| | | * - In a specified environment variable |
| | | * - In a specified file on the server filesystem. |
| | | * - As the value of a configuration attribute. |
| | | * In any case, the password must be in the clear. |
| | | */ |
| | | private static String getMappedSearchBindPassword( |
| | | final LDAPPassThroughAuthenticationPolicyCfg cfg, |
| | | final List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public AuthenticationPolicy createAuthenticationPolicy( |
| | | final LDAPPassThroughAuthenticationPolicyCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable( |
| | | final LDAPPassThroughAuthenticationPolicyCfg cfg, |
| | |
| | | PasswordValidator<LengthBasedPasswordValidatorCfg> implements |
| | | ConfigurationChangeListener<LengthBasedPasswordValidatorCfg> |
| | | { |
| | | // The current configuration for this password validator. |
| | | /** The current configuration for this password validator. */ |
| | | private LengthBasedPasswordValidatorCfg currentConfig; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordValidator( |
| | | LengthBasedPasswordValidatorCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizePasswordValidator() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordIsAcceptable(ByteString newPassword, |
| | | Set<ByteString> currentPasswords, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(PasswordValidatorCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | LengthBasedPasswordValidatorCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | LengthBasedPasswordValidatorCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // The message digest that will actually be used to generate the MD5 hashes. |
| | | /** The message digest that will actually be used to generate the MD5 hashes. */ |
| | | private MessageDigest messageDigest; |
| | | |
| | | // The lock used to provide threadsafe access to the message digest. |
| | | /** The lock used to provide threadsafe access to the message digest. */ |
| | | private Object digestLock; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordStorageScheme( |
| | | MD5PasswordStorageSchemeCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getStorageSchemeName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePasswordWithScheme(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordMatches(ByteSequence plaintextPassword, |
| | | ByteSequence storedPassword) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodeAuthPassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean authPasswordMatches(ByteSequence plaintextPassword, |
| | | String authInfo, String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isReversible() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getPlaintextValue(ByteSequence storedPassword) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getAuthPasswordPlaintextValue(String authInfo, |
| | | String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The current configuration for this member virtual attribute. |
| | | /** The current configuration for this member virtual attribute. */ |
| | | private MemberVirtualAttributeCfg currentConfig; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeVirtualAttributeProvider( |
| | | MemberVirtualAttributeCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isMultiValued() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Attribute getValues(Entry entry, VirtualAttributeRule rule) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean hasValue(Entry entry, VirtualAttributeRule rule) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean hasValue(Entry entry, VirtualAttributeRule rule, ByteString value) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConditionResult matchesSubstring(Entry entry, |
| | | VirtualAttributeRule rule, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConditionResult greaterThanOrEqualTo(Entry entry, |
| | | VirtualAttributeRule rule, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConditionResult lessThanOrEqualTo(Entry entry, |
| | | VirtualAttributeRule rule, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConditionResult approximatelyEqualTo(Entry entry, |
| | | VirtualAttributeRule rule, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processSearch(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | MemberVirtualAttributeCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | MemberVirtualAttributeCfg configuration) |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | import org.opends.server.types.AccountStatusNotification; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class implements a notification message template element that will |
| | | * generate a value that is the message for the account status notification. |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void generateValue(LocalizableMessageBuilder buffer, |
| | | AccountStatusNotification notification) |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | import org.opends.server.types.AccountStatusNotification; |
| | | import org.opends.server.types.AccountStatusNotificationProperty; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class implements a notification message template element that will |
| | | * generate a value that is the value of a specified notification property. |
| | |
| | | public class NotificationPropertyNotificationMessageTemplateElement |
| | | extends NotificationMessageTemplateElement |
| | | { |
| | | // The account status notification property for which to obtain the value. |
| | | /** The account status notification property for which to obtain the value. */ |
| | | private AccountStatusNotificationProperty property; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void generateValue(LocalizableMessageBuilder buffer, |
| | | AccountStatusNotification notification) |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | import org.opends.server.types.AccountStatusNotification; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class implements a notification message template element that will |
| | | * generate a value that is the name of the account status notification type. |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void generateValue(LocalizableMessageBuilder buffer, |
| | | AccountStatusNotification notification) |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | | |
| | | |
| | | import javax.net.ssl.KeyManager; |
| | | |
| | | import org.opends.server.admin.std.server.KeyManagerProviderCfg; |
| | |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class provides an implementation of a key manager provider that does not |
| | | * actually have the ability to provide a key manager. It will be used when no |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeKeyManagerProvider( |
| | | KeyManagerProviderCfg configuration) throws ConfigException, |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | | |
| | | |
| | | import javax.net.ssl.TrustManager; |
| | | |
| | | import org.opends.server.admin.std.server.TrustManagerProviderCfg; |
| | |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class provides an implementation of a trust manager provider that does |
| | | * not actually have the ability to provide a trust manager. It will be used |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initializeTrustManagerProvider( |
| | | TrustManagerProviderCfg configuration) |
| | | throws ConfigException, InitializationException |
| | |
| | | |
| | | |
| | | |
| | | // The DN of the configuration entry for this key manager provider. |
| | | /** The DN of the configuration entry for this key manager provider. */ |
| | | private DN configEntryDN; |
| | | |
| | | // The PIN needed to access the keystore. |
| | | /** The PIN needed to access the keystore. */ |
| | | private char[] keyStorePIN; |
| | | |
| | | // The current configuration for this key manager provider. |
| | | /** The current configuration for this key manager provider. */ |
| | | private PKCS11KeyManagerProviderCfg currentConfig; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeKeyManagerProvider( |
| | | PKCS11KeyManagerProviderCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable( |
| | | PKCS11KeyManagerProviderCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | PKCS11KeyManagerProviderCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | PKCS11KeyManagerProviderCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeWorkQueue(ParallelWorkQueueCfg configuration) |
| | | throws ConfigException, InitializationException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeWorkQueue(LocalizableMessage reason) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ParallelWorkQueueCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | ParallelWorkQueueCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isIdle() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeSASLMechanismHandler( |
| | | PlainSASLMechanismHandlerCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeSASLMechanismHandler() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processSASLBind(BindOperation bindOperation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable( |
| | | SASLMechanismHandlerCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | PlainSASLMechanismHandlerCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | PlainSASLMechanismHandlerCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | // The reference to the Directory Server crypto manager that we will use to |
| | | // handle the encryption/decryption. |
| | | /** |
| | | * The reference to the Directory Server crypto manager that we will use to |
| | | * handle the encryption/decryption. |
| | | */ |
| | | private CryptoManager cryptoManager; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordStorageScheme( |
| | | RC4PasswordStorageSchemeCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getStorageSchemeName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePasswordWithScheme(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordMatches(ByteSequence plaintextPassword, |
| | | ByteSequence storedPassword) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isReversible() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getPlaintextValue(ByteSequence storedPassword) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodeAuthPassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean authPasswordMatches(ByteSequence plaintextPassword, |
| | | String authInfo, String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getAuthPasswordPlaintextValue(String authInfo, |
| | | String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | |
| | | // The current configuration for this password validator. |
| | | /** The current configuration for this password validator. */ |
| | | private RandomPasswordGeneratorCfg currentConfig; |
| | | |
| | | // The encoded list of character sets defined for this password generator. |
| | | /** The encoded list of character sets defined for this password generator. */ |
| | | private SortedSet<String> encodedCharacterSets; |
| | | |
| | | // The DN of the configuration entry for this password generator. |
| | | /** The DN of the configuration entry for this password generator. */ |
| | | private DN configEntryDN; |
| | | |
| | | // The total length of the password that will be generated. |
| | | /** The total length of the password that will be generated. */ |
| | | private int totalLength; |
| | | |
| | | // The numbers of characters of each type that should be used to generate the |
| | | // passwords. |
| | | /** |
| | | * The numbers of characters of each type that should be used to generate the |
| | | * passwords. |
| | | */ |
| | | private int[] characterCounts; |
| | | |
| | | // The character sets that should be used to generate the passwords. |
| | | /** The character sets that should be used to generate the passwords. */ |
| | | private NamedCharacterSet[] characterSets; |
| | | |
| | | // The lock to use to ensure that the character sets and counts are not |
| | | // altered while a password is being generated. |
| | | /** |
| | | * The lock to use to ensure that the character sets and counts are not |
| | | * altered while a password is being generated. |
| | | */ |
| | | private Object generatorLock; |
| | | |
| | | // The character set format string for this password generator. |
| | | /** The character set format string for this password generator. */ |
| | | private String formatString; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordGenerator( |
| | | RandomPasswordGeneratorCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizePasswordGenerator() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(PasswordGeneratorCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | RandomPasswordGeneratorCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | RandomPasswordGeneratorCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void close() throws IOException |
| | | { |
| | | final ByteChannel tmp = redirect; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isOpen() |
| | | { |
| | | final ByteChannel tmp = redirect; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public int read(final ByteBuffer buffer) throws IOException |
| | | { |
| | | final ByteChannel tmp = redirect; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public int write(final ByteBuffer buffer) throws IOException |
| | | { |
| | | final ByteChannel tmp = redirect; |
| | |
| | | implements ConfigurationChangeListener< |
| | | RegularExpressionIdentityMapperCfg> |
| | | { |
| | | // The set of attribute types to use when performing lookups. |
| | | /** The set of attribute types to use when performing lookups. */ |
| | | private AttributeType[] attributeTypes; |
| | | |
| | | // The DN of the configuration entry for this identity mapper. |
| | | /** The DN of the configuration entry for this identity mapper. */ |
| | | private DN configEntryDN; |
| | | |
| | | // The set of attributes to return in search result entries. |
| | | /** The set of attributes to return in search result entries. */ |
| | | private LinkedHashSet<String> requestedAttributes; |
| | | |
| | | // The regular expression pattern matcher for the current configuration. |
| | | /** The regular expression pattern matcher for the current configuration. */ |
| | | private Pattern matchPattern; |
| | | |
| | | // The current configuration for this identity mapper. |
| | | /** The current configuration for this identity mapper. */ |
| | | private RegularExpressionIdentityMapperCfg currentConfig; |
| | | |
| | | // The replacement string to use for the pattern. |
| | | /** The replacement string to use for the pattern. */ |
| | | private String replacePattern; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeIdentityMapper( |
| | | RegularExpressionIdentityMapperCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeIdentityMapper() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Entry getEntryForID(String id) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(IdentityMapperCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | RegularExpressionIdentityMapperCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | RegularExpressionIdentityMapperCfg configuration) |
| | |
| | | implements ConfigurationChangeListener< |
| | | RepeatedCharactersPasswordValidatorCfg> |
| | | { |
| | | // The current configuration for this password validator. |
| | | /** The current configuration for this password validator. */ |
| | | private RepeatedCharactersPasswordValidatorCfg currentConfig; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordValidator( |
| | | RepeatedCharactersPasswordValidatorCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizePasswordValidator() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordIsAcceptable(ByteString newPassword, |
| | | Set<ByteString> currentPasswords, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | RepeatedCharactersPasswordValidatorCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | RepeatedCharactersPasswordValidatorCfg configuration) |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | * Portions Copyright 2012-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.extensions; |
| | | |
| | | |
| | | |
| | | import java.io.IOException; |
| | | import java.nio.ByteBuffer; |
| | | import java.nio.channels.ByteChannel; |
| | |
| | | |
| | | import org.opends.server.api.ClientConnection; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class implements a SASL byte channel that can be used during |
| | | * confidentiality and integrity. |
| | |
| | | public final class SASLByteChannel implements ConnectionSecurityProvider |
| | | { |
| | | |
| | | /** |
| | | * Private implementation. |
| | | */ |
| | | /** Private implementation. */ |
| | | private final class ByteChannelImpl implements ByteChannel |
| | | { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void close() throws IOException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isOpen() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int read(final ByteBuffer unwrappedData) throws IOException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int write(final ByteBuffer unwrappedData) throws IOException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // Attempt to read and unwrap the next SASL packet. |
| | | /** Attempt to read and unwrap the next SASL packet. */ |
| | | private int doRecvAndUnwrap() throws IOException |
| | | { |
| | | // Read SASL packets until some unwrapped data is produced or no more |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteChannel getChannel() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Certificate[] getClientCertificateChain() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int getSSF() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isSecure() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // The SASL server to use in the authentication. |
| | | /** The SASL server to use in the authentication. */ |
| | | private SaslServer saslServer; |
| | | |
| | | // The identity mapper to use when mapping identities. |
| | | /** The identity mapper to use when mapping identities. */ |
| | | private final IdentityMapper<?> identityMapper; |
| | | |
| | | // The property set to use when creating the SASL server. |
| | | /** The property set to use when creating the SASL server. */ |
| | | private final HashMap<String, String> saslProps; |
| | | |
| | | // The fully qualified domain name to use when creating the SASL server. |
| | | /** The fully qualified domain name to use when creating the SASL server. */ |
| | | private final String serverFQDN; |
| | | |
| | | // The SASL mechanism name. |
| | | /** The SASL mechanism name. */ |
| | | private final String mechanism; |
| | | |
| | | // The authorization entry used in the authentication. |
| | | /** The authorization entry used in the authentication. */ |
| | | private Entry authEntry; |
| | | |
| | | // The authorization entry used in the authentication. |
| | | /** The authorization entry used in the authentication. */ |
| | | private Entry authzEntry; |
| | | |
| | | // The user name used in the authentication taken from the name callback. |
| | | /** The user name used in the authentication taken from the name callback. */ |
| | | private String userName; |
| | | |
| | | // Error message used by callbacks. |
| | | /** Error message used by callbacks. */ |
| | | private LocalizableMessage cbMsg; |
| | | |
| | | // Error code used by callbacks. |
| | | /** Error code used by callbacks. */ |
| | | private ResultCode cbResultCode; |
| | | |
| | | // The current bind operation used by the callbacks. |
| | | /** The current bind operation used by the callbacks. */ |
| | | private BindOperation bindOp; |
| | | |
| | | // Used to check if negotiated QOP is confidentiality or integrity. |
| | | /** Used to check if negotiated QOP is confidentiality or integrity. */ |
| | | private static final String confidentiality = "auth-conf"; |
| | | private static final String integrity = "auth-int"; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // The message digest that will actually be used to generate the SHA-1 hashes. |
| | | /** The message digest that will actually be used to generate the SHA-1 hashes. */ |
| | | private MessageDigest messageDigest; |
| | | |
| | | // The lock used to provide threadsafe access to the message digest. |
| | | /** The lock used to provide threadsafe access to the message digest. */ |
| | | private Object digestLock; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordStorageScheme( |
| | | SHA1PasswordStorageSchemeCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getStorageSchemeName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePasswordWithScheme(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordMatches(ByteSequence plaintextPassword, |
| | | ByteSequence storedPassword) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodeAuthPassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean authPasswordMatches(ByteSequence plaintextPassword, |
| | | String authInfo, String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isReversible() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getPlaintextValue(ByteSequence storedPassword) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getAuthPasswordPlaintextValue(String authInfo, |
| | | String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // A mapping between the notification types and the message template. |
| | | /** A mapping between the notification types and the message template. */ |
| | | private HashMap<AccountStatusNotificationType, |
| | | List<NotificationMessageTemplateElement>> templateMap; |
| | | |
| | | // A mapping between the notification types and the message subject. |
| | | /** A mapping between the notification types and the message subject. */ |
| | | private HashMap<AccountStatusNotificationType,String> subjectMap; |
| | | |
| | | // The current configuration for this account status notification handler. |
| | | /** The current configuration for this account status notification handler. */ |
| | | private SMTPAccountStatusNotificationHandlerCfg currentConfig; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeStatusNotificationHandler( |
| | | SMTPAccountStatusNotificationHandlerCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable( |
| | | AccountStatusNotificationHandlerCfg |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void handleStatusNotification(AccountStatusNotification notification) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | SMTPAccountStatusNotificationHandlerCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | SMTPAccountStatusNotificationHandlerCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | // The current configuration for this alert handler. |
| | | /** The current configuration for this alert handler. */ |
| | | private SMTPAlertHandlerCfg currentConfig; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initializeAlertHandler(SMTPAlertHandlerCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public AlertHandlerCfg getAlertHandlerConfiguration() |
| | | { |
| | | return currentConfig; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationAcceptable(AlertHandlerCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void finalizeAlertHandler() |
| | | { |
| | | // No action is required. |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void sendAlertNotification(AlertGenerator generator, String alertType, |
| | | LocalizableMessage alertMessage) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | SMTPAlertHandlerCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | SMTPAlertHandlerCfg configuration) |
| | | { |
| | |
| | | */ |
| | | private static final int NUM_SALT_BYTES = 8; |
| | | |
| | | // The number of bytes MD5 algorithm produces |
| | | /** The number of bytes MD5 algorithm produces. */ |
| | | private static final int MD5_LENGTH = 16; |
| | | |
| | | |
| | | // The message digest that will actually be used to generate the MD5 hashes. |
| | | /** The message digest that will actually be used to generate the MD5 hashes. */ |
| | | private MessageDigest messageDigest; |
| | | |
| | | // The lock used to provide threadsafe access to the message digest. |
| | | /** The lock used to provide threadsafe access to the message digest. */ |
| | | private Object digestLock; |
| | | |
| | | // The secure random number generator to use to generate the salt values. |
| | | /** The secure random number generator to use to generate the salt values. */ |
| | | private Random random; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordStorageScheme( |
| | | SaltedMD5PasswordStorageSchemeCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getStorageSchemeName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePasswordWithScheme(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordMatches(ByteSequence plaintextPassword, |
| | | ByteSequence storedPassword) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getAuthPasswordSchemeName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodeAuthPassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean authPasswordMatches(ByteSequence plaintextPassword, |
| | | String authInfo, String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isReversible() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getPlaintextValue(ByteSequence storedPassword) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getAuthPasswordPlaintextValue(String authInfo, |
| | | String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | |
| | | */ |
| | | private static final int NUM_SALT_BYTES = 8; |
| | | |
| | | // The number of bytes SHA algorithm produces |
| | | /** The number of bytes SHA algorithm produces. */ |
| | | private static final int SHA1_LENGTH = 20; |
| | | |
| | | |
| | | // The message digest that will actually be used to generate the SHA-1 hashes. |
| | | /** The message digest that will actually be used to generate the SHA-1 hashes. */ |
| | | private MessageDigest messageDigest; |
| | | |
| | | // The lock used to provide threadsafe access to the message digest. |
| | | /** The lock used to provide threadsafe access to the message digest. */ |
| | | private Object digestLock; |
| | | |
| | | // The secure random number generator to use to generate the salt values. |
| | | /** The secure random number generator to use to generate the salt values. */ |
| | | private Random random; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordStorageScheme( |
| | | SaltedSHA1PasswordStorageSchemeCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getStorageSchemeName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePasswordWithScheme(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordMatches(ByteSequence plaintextPassword, |
| | | ByteSequence storedPassword) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getAuthPasswordSchemeName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodeAuthPassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean authPasswordMatches(ByteSequence plaintextPassword, |
| | | String authInfo, String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isReversible() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getPlaintextValue(ByteSequence storedPassword) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getAuthPasswordPlaintextValue(String authInfo, |
| | | String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | |
| | | */ |
| | | private static final int NUM_SALT_BYTES = 8; |
| | | |
| | | // Size of the dgiest in bytes. |
| | | /** Size of the dgiest in bytes. */ |
| | | private static final int SHA256_LENGTH = 256 / 8; |
| | | |
| | | // The message digest that will actually be used to generate the 256-bit SHA-2 |
| | | // hashes. |
| | | /** |
| | | * The message digest that will actually be used to generate the 256-bit SHA-2 |
| | | * hashes. |
| | | */ |
| | | private MessageDigest messageDigest; |
| | | |
| | | // The lock used to provide threadsafe access to the message digest. |
| | | /** The lock used to provide threadsafe access to the message digest. */ |
| | | private Object digestLock; |
| | | |
| | | // The secure random number generator to use to generate the salt values. |
| | | /** The secure random number generator to use to generate the salt values. */ |
| | | private Random random; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordStorageScheme( |
| | | SaltedSHA256PasswordStorageSchemeCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getStorageSchemeName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePasswordWithScheme(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordMatches(ByteSequence plaintextPassword, |
| | | ByteSequence storedPassword) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getAuthPasswordSchemeName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodeAuthPassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean authPasswordMatches(ByteSequence plaintextPassword, |
| | | String authInfo, String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isReversible() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getPlaintextValue(ByteSequence storedPassword) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getAuthPasswordPlaintextValue(String authInfo, |
| | | String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | |
| | | private static final int NUM_SALT_BYTES = 8; |
| | | |
| | | |
| | | // The size of the digest in bytes. |
| | | /** The size of the digest in bytes. */ |
| | | private static final int SHA384_LENGTH = 384 / 8; |
| | | |
| | | // The message digest that will actually be used to generate the 384-bit SHA-2 |
| | | // hashes. |
| | | /** |
| | | * The message digest that will actually be used to generate the 384-bit SHA-2 |
| | | * hashes. |
| | | */ |
| | | private MessageDigest messageDigest; |
| | | |
| | | // The lock used to provide threadsafe access to the message digest. |
| | | /** The lock used to provide threadsafe access to the message digest. */ |
| | | private Object digestLock; |
| | | |
| | | // The secure random number generator to use to generate the salt values. |
| | | /** The secure random number generator to use to generate the salt values. */ |
| | | private Random random; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordStorageScheme( |
| | | SaltedSHA384PasswordStorageSchemeCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getStorageSchemeName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePasswordWithScheme(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordMatches(ByteSequence plaintextPassword, |
| | | ByteSequence storedPassword) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getAuthPasswordSchemeName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodeAuthPassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean authPasswordMatches(ByteSequence plaintextPassword, |
| | | String authInfo, String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isReversible() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getPlaintextValue(ByteSequence storedPassword) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getAuthPasswordPlaintextValue(String authInfo, |
| | | String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | |
| | | private static final int NUM_SALT_BYTES = 8; |
| | | |
| | | |
| | | // The size of the digest in bytes. |
| | | /** The size of the digest in bytes. */ |
| | | private static final int SHA512_LENGTH = 512 / 8; |
| | | |
| | | // The message digest that will actually be used to generate the 512-bit SHA-2 |
| | | // hashes. |
| | | /** |
| | | * The message digest that will actually be used to generate the 512-bit SHA-2 |
| | | * hashes. |
| | | */ |
| | | private MessageDigest messageDigest; |
| | | |
| | | // The lock used to provide threadsafe access to the message digest. |
| | | /** The lock used to provide threadsafe access to the message digest. */ |
| | | private Object digestLock; |
| | | |
| | | // The secure random number generator to use to generate the salt values. |
| | | /** The secure random number generator to use to generate the salt values. */ |
| | | private Random random; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordStorageScheme( |
| | | SaltedSHA512PasswordStorageSchemeCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getStorageSchemeName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePasswordWithScheme(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordMatches(ByteSequence plaintextPassword, |
| | | ByteSequence storedPassword) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getAuthPasswordSchemeName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodeAuthPassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean authPasswordMatches(ByteSequence plaintextPassword, |
| | | String authInfo, String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isReversible() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getPlaintextValue(ByteSequence storedPassword) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getAuthPasswordPlaintextValue(String authInfo, |
| | | String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | |
| | | ConfigurationChangeListener<SimilarityBasedPasswordValidatorCfg> |
| | | { |
| | | |
| | | // The current configuration for this password validator. |
| | | /** The current configuration for this password validator. */ |
| | | private SimilarityBasedPasswordValidatorCfg currentConfig; |
| | | |
| | | |
| | |
| | | // method. |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordValidator( |
| | | SimilarityBasedPasswordValidatorCfg configuration) |
| | |
| | | currentConfig = configuration; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizePasswordValidator() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordIsAcceptable(ByteString newPassword, |
| | | Set<ByteString> currentPasswords, |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | SimilarityBasedPasswordValidatorCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | SimilarityBasedPasswordValidatorCfg configuration) |
| | | { |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The DN of the configuration entry for this certificate mapper. |
| | | /** The DN of the configuration entry for this certificate mapper. */ |
| | | private DN configEntryDN; |
| | | |
| | | // The mappings between certificate attribute names and user attribute types. |
| | | /** The mappings between certificate attribute names and user attribute types. */ |
| | | private LinkedHashMap<String,AttributeType> attributeMap; |
| | | |
| | | // The current configuration for this certificate mapper. |
| | | /** The current configuration for this certificate mapper. */ |
| | | private SubjectAttributeToUserAttributeCertificateMapperCfg currentConfig; |
| | | |
| | | // The set of attributes to return in search result entries. |
| | | /** The set of attributes to return in search result entries. */ |
| | | private LinkedHashSet<String> requestedAttributes; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeCertificateMapper( |
| | | SubjectAttributeToUserAttributeCertificateMapperCfg |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeCertificateMapper() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Entry mapCertificateToUser(Certificate[] certificateChain) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(CertificateMapperCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | SubjectAttributeToUserAttributeCertificateMapperCfg |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | SubjectAttributeToUserAttributeCertificateMapperCfg |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The DN of the configuration entry for this certificate mapper. |
| | | /** The DN of the configuration entry for this certificate mapper. */ |
| | | private DN configEntryDN; |
| | | |
| | | // The current configuration for this certificate mapper. |
| | | /** The current configuration for this certificate mapper. */ |
| | | private SubjectDNToUserAttributeCertificateMapperCfg currentConfig; |
| | | |
| | | // The set of attributes to return in search result entries. |
| | | /** The set of attributes to return in search result entries. */ |
| | | private LinkedHashSet<String> requestedAttributes; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeCertificateMapper( |
| | | SubjectDNToUserAttributeCertificateMapperCfg |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeCertificateMapper() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Entry mapCertificateToUser(Certificate[] certificateChain) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(CertificateMapperCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | SubjectDNToUserAttributeCertificateMapperCfg |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | SubjectDNToUserAttributeCertificateMapperCfg |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | * Portions Copyright 2013-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeCertificateMapper(SubjectEqualsDNCertificateMapperCfg |
| | | configuration) |
| | |
| | | private final class ByteChannelImpl implements ByteChannel |
| | | { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void close() throws IOException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isOpen() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int read(final ByteBuffer unwrappedData) throws IOException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int write(final ByteBuffer unwrappedData) throws IOException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // It seems that the SSL engine does not remember if an error has already |
| | | // occurred so we must cache it here and rethrow. See OPENDJ-652. |
| | | /** |
| | | * It seems that the SSL engine does not remember if an error has already |
| | | * occurred so we must cache it here and rethrow. See OPENDJ-652. |
| | | */ |
| | | private void abortOnSSLException() throws IOException |
| | | { |
| | | if (sslException != null) |
| | |
| | | |
| | | |
| | | |
| | | // Attempt to read and unwrap the next SSL packet. |
| | | /** Attempt to read and unwrap the next SSL packet. */ |
| | | private int doRecvAndUnwrap() throws IOException |
| | | { |
| | | // Synchronize SSL unwrap with channel reads. |
| | |
| | | |
| | | |
| | | |
| | | // Attempt to wrap and send the next SSL packet. |
| | | /** Attempt to wrap and send the next SSL packet. */ |
| | | private int doWrapAndSend(final ByteBuffer unwrappedData) |
| | | throws IOException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteChannel getChannel() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Certificate[] getClientCertificateChain() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int getSSF() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isSecure() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | public class TextNotificationMessageTemplateElement |
| | | extends NotificationMessageTemplateElement |
| | | { |
| | | // The static text associated with this element. |
| | | /** The static text associated with this element. */ |
| | | private final String text; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void generateValue(LocalizableMessageBuilder buffer, |
| | | AccountStatusNotification notification) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeWorkQueue(TraditionalWorkQueueCfg configuration) |
| | | throws ConfigException, InitializationException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeWorkQueue(LocalizableMessage reason) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | TraditionalWorkQueueCfg configuration, List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | TraditionalWorkQueueCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isIdle() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // The reference to the Directory Server crypto manager that we will use to |
| | | // handle the encryption/decryption. |
| | | /** |
| | | * The reference to the Directory Server crypto manager that we will use to |
| | | * handle the encryption/decryption. |
| | | */ |
| | | private CryptoManager cryptoManager; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordStorageScheme( |
| | | TripleDESPasswordStorageSchemeCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getStorageSchemeName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodePasswordWithScheme(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordMatches(ByteSequence plaintextPassword, |
| | | ByteSequence storedPassword) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isReversible() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getPlaintextValue(ByteSequence storedPassword) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString encodeAuthPassword(ByteSequence plaintext) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean authPasswordMatches(ByteSequence plaintextPassword, |
| | | String authInfo, String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteString getAuthPasswordPlaintextValue(String authInfo, |
| | | String authValue) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | |
| | | implements ConfigurationChangeListener< |
| | | UniqueCharactersPasswordValidatorCfg> |
| | | { |
| | | // The current configuration for this password validator. |
| | | /** The current configuration for this password validator. */ |
| | | private UniqueCharactersPasswordValidatorCfg currentConfig; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePasswordValidator( |
| | | UniqueCharactersPasswordValidatorCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizePasswordValidator() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean passwordIsAcceptable(ByteString newPassword, |
| | | Set<ByteString> currentPasswords, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | UniqueCharactersPasswordValidatorCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | UniqueCharactersPasswordValidatorCfg configuration) |
| | | { |
| | |
| | | public class UserAttributeNotificationMessageTemplateElement |
| | | extends NotificationMessageTemplateElement |
| | | { |
| | | // The attribute type for which to obtain the value. |
| | | /** The attribute type for which to obtain the value. */ |
| | | private AttributeType attributeType; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void generateValue(LocalizableMessageBuilder buffer, |
| | | AccountStatusNotification notification) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void generateValue(LocalizableMessageBuilder buffer, |
| | | AccountStatusNotification notification) |
| | | { |
| | |
| | | extends VirtualAttributeProvider<UserDefinedVirtualAttributeCfg> |
| | | implements ConfigurationChangeListener<UserDefinedVirtualAttributeCfg> |
| | | { |
| | | // The current configuration for this virtual attribute provider. |
| | | /** The current configuration for this virtual attribute provider. */ |
| | | private UserDefinedVirtualAttributeCfg currentConfig; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeVirtualAttributeProvider( |
| | | UserDefinedVirtualAttributeCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeVirtualAttributeProvider() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isMultiValued() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Attribute getValues(Entry entry, VirtualAttributeRule rule) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processSearch(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | UserDefinedVirtualAttributeCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | UserDefinedVirtualAttributeCfg configuration) |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The DN of the entry that holds the definition for this group. |
| | | /** The DN of the entry that holds the definition for this group. */ |
| | | private DN groupEntryDN; |
| | | |
| | | // The DN of the target group that will provide membership information. |
| | | /** The DN of the target group that will provide membership information. */ |
| | | private DN targetGroupDN; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeGroupImplementation( |
| | | VirtualStaticGroupImplementationCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public VirtualStaticGroup newInstance(ServerContext serverContext, Entry groupEntry) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public SearchFilter getGroupDefinitionFilter() |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isGroupDefinition(Entry entry) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getGroupDN() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void setGroupDN(DN groupDN) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean supportsNestedGroups() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public List<DN> getNestedGroupDNs() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void addNestedGroup(DN nestedGroupDN) |
| | | throws UnsupportedOperationException, DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void removeNestedGroup(DN nestedGroupDN) |
| | | throws UnsupportedOperationException, DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isMember(DN userDN, Set<DN> examinedGroups) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isMember(Entry userEntry, Set<DN> examinedGroups) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public MemberList getMembers() |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public MemberList getMembers(DN baseDN, SearchScope scope, |
| | | SearchFilter filter) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean mayAlterMemberList() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void addMember(Entry userEntry) |
| | | throws UnsupportedOperationException, DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void removeMember(DN userDN) |
| | | throws UnsupportedOperationException, DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable(C config, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | isJavaClassAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable(C config, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | isJavaClassAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd(C config) |
| | | { |
| | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange(C config) |
| | | { |
| | |
| | | return ccr; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable(C config, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | return findLogPublisher(config.dn()) != null; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete(C config) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConnectLoggable(final ClientConnection connection) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isDisconnectLoggable(final ClientConnection connection) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isRequestLoggable(final Operation operation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isResponseLoggable(final Operation operation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConnectLoggable(final ClientConnection connection) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isDisconnectLoggable(final ClientConnection connection) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isRequestLoggable(final Operation operation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isResponseLoggable(final Operation operation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConnectLoggable(final ClientConnection connection) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isDisconnectLoggable(final ClientConnection connection) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isRequestLoggable(final Operation operation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isResponseLoggable(final Operation operation) |
| | | { |
| | |
| | | private final class ChangeListener implements |
| | | ConfigurationChangeListener<AccessLogPublisherCfg> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final ConfigChangeResult applyConfigurationChange( |
| | | final AccessLogPublisherCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final boolean isConfigurationChangeAcceptable( |
| | | final AccessLogPublisherCfg configuration, |
| | |
| | | ConfigurationDeleteListener<AccessLogFilteringCriteriaCfg> |
| | | { |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd( |
| | | final AccessLogFilteringCriteriaCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | final AccessLogFilteringCriteriaCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete( |
| | | final AccessLogFilteringCriteriaCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable( |
| | | final AccessLogFilteringCriteriaCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | final AccessLogFilteringCriteriaCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable( |
| | | final AccessLogFilteringCriteriaCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void close() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final DN getDN() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // Build an appropriate set of filters based on the configuration. |
| | | /** Build an appropriate set of filters based on the configuration. */ |
| | | private void buildFilters() |
| | | { |
| | | buildFilters(cfg.isSuppressInternalOperations(), |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.loggers; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * the run method of the writerThread. Run until queue is empty |
| | | * The run method of the writerThread. Run until queue is empty |
| | | * AND we've been asked to terminate |
| | | */ |
| | | @Override |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void flush() |
| | | { |
| | | writer.flush(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public long getBytesWritten() |
| | | { |
| | |
| | | return writer; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getShutdownListenerName() |
| | | { |
| | | return "AsynchronousTextWriter Thread " + name; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processServerShutdown(LocalizableMessage reason) |
| | | { |
| | |
| | | shutdown(false); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void shutdown() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | * Portions Copyright 2013-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.loggers; |
| | | |
| | |
| | | this.err = err; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeLogPublisher(DebugLogPublisherCfg config, ServerContext serverContext) |
| | | throws ConfigException, InitializationException { |
| | | // This publisher is not configurable. |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void trace(TraceSettings settings, |
| | | String signature, |
| | |
| | | publish(msg, stack); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void traceException(TraceSettings settings, |
| | | String signature, |
| | |
| | | publish(message, stack); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void close() |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | // Publishes a record, optionally performing some "special" work: |
| | | // - injecting a stack trace into the message |
| | | /** |
| | | * Publishes a record, optionally performing some "special" work: |
| | | * - injecting a stack trace into the message |
| | | */ |
| | | private void publish(String msg, String stack) |
| | | { |
| | | StringBuilder buf = new StringBuilder(); |
| | |
| | | err.print(buf); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getDN() |
| | | { |
| | |
| | | public abstract class DebugLogPublisher<T extends DebugLogPublisherCfg> |
| | | implements LogPublisher<T> |
| | | { |
| | | //The default global settings key. |
| | | /** The default global settings key. */ |
| | | private static final String GLOBAL= "_global"; |
| | | |
| | | //The map of class names to their trace settings. |
| | | /** The map of class names to their trace settings. */ |
| | | private Map<String,TraceSettings> classTraceSettings; |
| | | |
| | | //The map of class names to their method trace settings. |
| | | /** The map of class names to their method trace settings. */ |
| | | private Map<String,Map<String,TraceSettings>> methodTraceSettings; |
| | | |
| | | |
| | |
| | | private int numFiles; |
| | | private FileCountLogRetentionPolicyCfg config; |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initializeLogRetentionPolicy( |
| | | FileCountLogRetentionPolicyCfg config) |
| | | { |
| | |
| | | config.addFileCountChangeListener(this); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | FileCountLogRetentionPolicyCfg config, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | FileCountLogRetentionPolicyCfg config) |
| | | { |
| | |
| | | return new ConfigChangeResult(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public File[] deleteFiles(FileNamingPolicy fileNamingPolicy) |
| | | throws DirectoryException |
| | | { |
| | |
| | | return filesToDelete.toArray(new File[0]); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public String toString() |
| | | { |
| | | return "Free Number Retention Policy " + config.dn(); |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The scheduled rotation times as ms offsets from the beginning of the day. |
| | | /** The scheduled rotation times as ms offsets from the beginning of the day. */ |
| | | private int[] rotationTimes; |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initializeLogRotationPolicy(FixedTimeLogRotationPolicyCfg config) |
| | | { |
| | | rotationTimes = new int[config.getTimeOfDay().size()]; |
| | |
| | | config.addFixedTimeChangeListener(this); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | FixedTimeLogRotationPolicyCfg config, List<LocalizableMessage> unacceptableReasons) |
| | | { |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | FixedTimeLogRotationPolicyCfg config) |
| | | { |
| | |
| | | return ccr; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean rotateFile(RotatableLogFile writer) |
| | | { |
| | | Calendar lastRotationTime = writer.getLastRotationTime(); |
| | |
| | | private long freeDiskSpace; |
| | | private FreeDiskSpaceLogRetentionPolicyCfg config; |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeLogRetentionPolicy( |
| | | FreeDiskSpaceLogRetentionPolicyCfg config) |
| | |
| | | config.addFreeDiskSpaceChangeListener(this); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | FreeDiskSpaceLogRetentionPolicyCfg config, |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | FreeDiskSpaceLogRetentionPolicyCfg config) |
| | |
| | | return new ConfigChangeResult(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public File[] deleteFiles(FileNamingPolicy fileNamingPolicy) |
| | | throws DirectoryException |
| | |
| | | return filesToDelete.toArray(new File[filesToDelete.size()]); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() |
| | | { |
| | |
| | | private FileNamingPolicy namingPolicy; |
| | | private FilePermission filePermissions; |
| | | private LogPublisherErrorHandler errorHandler; |
| | | //TODO: Implement actions. |
| | | /** TODO: Implement actions. */ |
| | | private ArrayList<ActionType> actions; |
| | | |
| | | private String name; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | SizeLimitLogRotationPolicyCfg config, List<LocalizableMessage> unacceptableReasons) |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | SizeLimitLogRotationPolicyCfg config) |
| | |
| | | } |
| | | |
| | | /** |
| | | * the run method of the rotaterThread. It wakes up periodically and checks |
| | | * The run method of the rotaterThread. It wakes up periodically and checks |
| | | * whether the file needs to be rotated based on the rotation policy. |
| | | */ |
| | | @Override |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void flush() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.loggers; |
| | | |
| | |
| | | super(name); |
| | | } |
| | | /** |
| | | * the run method of the writerThread. Run until queue is empty |
| | | * The run method of the writerThread. Run until queue is empty |
| | | * AND we've been asked to terminate |
| | | */ |
| | | @Override |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void flush() |
| | | { |
| | | writer.flush(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public long getBytesWritten() |
| | | { |
| | | return writer.getBytesWritten(); |
| | |
| | | return writer; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public String getShutdownListenerName() |
| | | { |
| | | return "ParallelTextWriter Thread " + name; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void processServerShutdown(LocalizableMessage reason) |
| | | { |
| | | // Don't shutdown the wrapped writer on server shutdown as it |
| | |
| | | shutdown(false); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void shutdown() |
| | | { |
| | | shutdown(true); |
| | |
| | | private FileComparator comparator; |
| | | private SizeLimitLogRetentionPolicyCfg config; |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeLogRetentionPolicy( |
| | | SizeLimitLogRetentionPolicyCfg config) |
| | |
| | | config.addSizeLimitChangeListener(this); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | SizeLimitLogRetentionPolicyCfg config, |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | SizeLimitLogRetentionPolicyCfg config) |
| | |
| | | return new ConfigChangeResult(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public File[] deleteFiles(FileNamingPolicy fileNamingPolicy) |
| | | throws DirectoryException |
| | |
| | | return filesToDelete; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() |
| | | { |
| | |
| | | |
| | | SizeLimitLogRotationPolicyCfg currentConfig; |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initializeLogRotationPolicy(SizeLimitLogRotationPolicyCfg config) |
| | | throws ConfigException, InitializationException |
| | | { |
| | |
| | | currentConfig = config; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | SizeLimitLogRotationPolicyCfg config, List<LocalizableMessage> unacceptableReasons) |
| | | { |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | SizeLimitLogRotationPolicyCfg config) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | final FileBasedAccessLogPublisherCfg config) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeLogPublisher(final FileBasedAccessLogPublisherCfg cfg, ServerContext serverContext) |
| | | throws ConfigException, InitializationException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable( |
| | | final FileBasedAccessLogPublisherCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | final FileBasedAccessLogPublisherCfg config, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void close0() |
| | | { |
| | |
| | | private TextWriter writer; |
| | | private FileBasedAuditLogPublisherCfg cfg; |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | FileBasedAuditLogPublisherCfg config) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void close0() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeLogPublisher(FileBasedAuditLogPublisherCfg cfg, ServerContext serverContext) |
| | | throws ConfigException, InitializationException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable( |
| | | FileBasedAuditLogPublisherCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | FileBasedAuditLogPublisherCfg config, List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void logAddResponse(AddOperation addOperation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void logDeleteResponse(DeleteOperation deleteOperation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void logModifyDNResponse(ModifyDNOperation modifyDNOperation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void logModifyResponse(ModifyOperation modifyOperation) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // Appends the common log header information to the provided buffer. |
| | | /** Appends the common log header information to the provided buffer. */ |
| | | private void appendHeader(Operation operation, StringBuilder buffer) |
| | | { |
| | | buffer.append("# "); |
| | |
| | | |
| | | |
| | | |
| | | // Determines whether the provided operation should be logged. |
| | | /** Determines whether the provided operation should be logged. */ |
| | | private boolean isLoggable(Operation operation) |
| | | { |
| | | return operation.getResultCode() == SUCCESS |
| | |
| | | return startupPublisher; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable( |
| | | FileBasedDebugLogPublisherCfg config, List<LocalizableMessage> unacceptableReasons) |
| | |
| | | return isConfigurationChangeAcceptable(config, unacceptableReasons); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeLogPublisher(FileBasedDebugLogPublisherCfg config, ServerContext serverContext) |
| | | throws ConfigException, InitializationException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | FileBasedDebugLogPublisherCfg config, List<LocalizableMessage> unacceptableReasons) |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | FileBasedDebugLogPublisherCfg config) |
| | |
| | | config.isDefaultIncludeThrowableCause()); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAddAcceptable(DebugTargetCfg config, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | return !hasTraceSettings(config.getDebugScope()); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationDeleteAcceptable(DebugTargetCfg config, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationAdd(DebugTargetCfg config) |
| | | { |
| | |
| | | return new ConfigChangeResult(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationDelete(DebugTargetCfg config) |
| | | { |
| | |
| | | return new ConfigChangeResult(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void trace(TraceSettings settings, String signature, |
| | | String sourceLocation, String msg, StackTraceElement[] stackTrace) |
| | |
| | | publish(signature, sourceLocation, msg, stack); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void traceException(TraceSettings settings, String signature, |
| | | String sourceLocation, String msg, Throwable ex, |
| | |
| | | publish(signature, sourceLocation, message, stack); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void close() |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | // Publishes a record, optionally performing some "special" work: |
| | | // - injecting a stack trace into the message |
| | | // - format the message with argument values |
| | | /** |
| | | * Publishes a record, optionally performing some "special" work: |
| | | * - injecting a stack trace into the message |
| | | * - format the message with argument values |
| | | */ |
| | | private void publish(String signature, String sourceLocation, String msg, |
| | | String stack) |
| | | { |
| | |
| | | writer.writeRecord(buf.toString()); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getDN() |
| | | { |
| | |
| | | private MeteredStream stream = new MeteredStream(System.out, 0); |
| | | private PrintWriter writer = new PrintWriter(stream, true); |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void writeRecord(String record) |
| | | { |
| | | writer.println(record); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void flush() |
| | | { |
| | | writer.flush(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void shutdown() |
| | | { |
| | | // Should never close the system out stream. |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public long getBytesWritten() |
| | | { |
| | | return stream.written; |
| | |
| | | private MeteredStream stream = new MeteredStream(System.err, 0); |
| | | private PrintWriter writer = new PrintWriter(stream, true); |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void writeRecord(String record) |
| | | { |
| | | writer.println(record); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void flush() |
| | | { |
| | | writer.flush(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void shutdown() |
| | | { |
| | | // Should never close the system error stream. |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public long getBytesWritten() |
| | | { |
| | | return stream.written; |
| | |
| | | writer = new PrintWriter(stream, true); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void writeRecord(String record) |
| | | { |
| | | writer.println(record); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void flush() |
| | | { |
| | | writer.flush(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void shutdown() |
| | | { |
| | | // Should never close the system error stream. |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public long getBytesWritten() |
| | | { |
| | | return stream.written; |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | * Portions Copyright 2013-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.loggers; |
| | | |
| | |
| | | this.writer = writer; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeLogPublisher(ErrorLogPublisherCfg config, ServerContext serverContext) |
| | | throws ConfigException, InitializationException |
| | |
| | | // configurable via the admin framework. |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void close() |
| | | { |
| | |
| | | { |
| | | private long timeInterval; |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initializeLogRotationPolicy(TimeLimitLogRotationPolicyCfg config) |
| | | { |
| | | timeInterval = config.getRotationInterval(); |
| | |
| | | config.addTimeLimitChangeListener(this); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | TimeLimitLogRotationPolicyCfg config, List<LocalizableMessage> unacceptableReasons) |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.loggers; |
| | | |
| | |
| | | this.filter = new TimeStampNamingFilter(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public File getInitialName() |
| | | { |
| | | return file; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public File getNextName() |
| | | { |
| | | return new File(file + "." + TimeThread.getGMTTime()); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public FilenameFilter getFilenameFilter() |
| | | { |
| | | return filter; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public File[] listFiles() |
| | | { |
| | | File directory = file.getParentFile(); |
| | |
| | | config.addChangeListener(this); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable(DebugTargetCfg config, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | | { |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange(DebugTargetCfg config) |
| | | { |
| | | final ConfigChangeResult ccr = new ConfigChangeResult(); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.monitors; |
| | | |
| | |
| | | public class BackendMonitor |
| | | extends MonitorProvider<MonitorProviderCfg> |
| | | { |
| | | // The attribute type that will be used to report the backend ID. |
| | | /** The attribute type that will be used to report the backend ID. */ |
| | | private AttributeType backendIDType; |
| | | |
| | | // The attribute type that will be used to report the set of base DNs. |
| | | /** The attribute type that will be used to report the set of base DNs. */ |
| | | private AttributeType baseDNType; |
| | | |
| | | // The attribute type that will be used to report the number of entries. |
| | | /** The attribute type that will be used to report the number of entries. */ |
| | | private AttributeType entryCountType; |
| | | |
| | | // The attribute type that will be used to report the number of entries per |
| | | // base DN. |
| | | /** |
| | | * The attribute type that will be used to report the number of entries per |
| | | * base DN. |
| | | */ |
| | | private AttributeType baseDNEntryCountType; |
| | | |
| | | // The attribute type that will be used to indicate if a backend is private. |
| | | /** The attribute type that will be used to indicate if a backend is private. */ |
| | | private AttributeType isPrivateType; |
| | | |
| | | // The attribute type that will be used to report the writability mode. |
| | | /** The attribute type that will be used to report the writability mode. */ |
| | | private AttributeType writabilityModeType; |
| | | |
| | | // The backend with which this monitor is associated. |
| | | private Backend backend; |
| | | /** The backend with which this monitor is associated. */ |
| | | private Backend<?> backend; |
| | | |
| | | // The name for this monitor. |
| | | /** The name for this monitor. */ |
| | | private String monitorName; |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | |
| | | * |
| | | * @param backend The backend with which this monitor is associated. |
| | | */ |
| | | public BackendMonitor(Backend backend) |
| | | public BackendMonitor(Backend<?> backend) |
| | | { |
| | | this.backend = backend; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initializeMonitorProvider(MonitorProviderCfg configuration) |
| | | { |
| | | monitorName = backend.getBackendID() + " Backend"; |
| | | |
| | | backendIDType = DirectoryConfig.getAttributeType(ATTR_MONITOR_BACKEND_ID, |
| | | true); |
| | | |
| | | baseDNType = DirectoryConfig.getAttributeType(ATTR_MONITOR_BACKEND_BASE_DN, |
| | | true); |
| | | |
| | | backendIDType = DirectoryConfig.getAttributeType(ATTR_MONITOR_BACKEND_ID, true); |
| | | baseDNType = DirectoryConfig.getAttributeType(ATTR_MONITOR_BACKEND_BASE_DN, true); |
| | | entryCountType = |
| | | DirectoryConfig.getAttributeType(ATTR_MONITOR_BACKEND_ENTRY_COUNT, |
| | | true); |
| | | |
| | | DirectoryConfig.getAttributeType(ATTR_MONITOR_BACKEND_ENTRY_COUNT, true); |
| | | baseDNEntryCountType = |
| | | DirectoryConfig.getAttributeType(ATTR_MONITOR_BASE_DN_ENTRY_COUNT, |
| | | true); |
| | | |
| | | DirectoryConfig.getAttributeType(ATTR_MONITOR_BASE_DN_ENTRY_COUNT, true); |
| | | isPrivateType = |
| | | DirectoryConfig.getAttributeType(ATTR_MONITOR_BACKEND_IS_PRIVATE, |
| | | true); |
| | | |
| | | DirectoryConfig.getAttributeType(ATTR_MONITOR_BACKEND_IS_PRIVATE, true); |
| | | writabilityModeType = |
| | | DirectoryConfig.getAttributeType(ATTR_MONITOR_BACKEND_WRITABILITY_MODE, |
| | | true); |
| | | DirectoryConfig.getAttributeType(ATTR_MONITOR_BACKEND_WRITABILITY_MODE, true); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public String getMonitorInstanceName() |
| | | { |
| | | return monitorName; |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public List<Attribute> getMonitorData() |
| | | { |
| | | LinkedList<Attribute> attrs = new LinkedList<Attribute>(); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.monitors; |
| | | |
| | |
| | | MonitorProvider<ClientConnectionMonitorProviderCfg> |
| | | { |
| | | |
| | | // The connection handler associated with this monitor, or null if all |
| | | // connection handlers should be monitored. |
| | | /** |
| | | * The connection handler associated with this monitor, or null if all |
| | | * connection handlers should be monitored. |
| | | */ |
| | | private final ConnectionHandler<?> handler; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeMonitorProvider( |
| | | ClientConnectionMonitorProviderCfg configuration) |
| | |
| | | public class ConnectionHandlerMonitor |
| | | extends MonitorProvider<MonitorProviderCfg> |
| | | { |
| | | // The attribute type that will be used to report the established connections. |
| | | /** The attribute type that will be used to report the established connections. */ |
| | | private AttributeType connectionsType; |
| | | |
| | | // The attribute type that will be used to report the listeners. |
| | | /** The attribute type that will be used to report the listeners. */ |
| | | private AttributeType listenerType; |
| | | |
| | | // The attribute type that will be used to report the number of established |
| | | // client connections. |
| | | /** |
| | | * The attribute type that will be used to report the number of established |
| | | * client connections. |
| | | */ |
| | | private AttributeType numConnectionsType; |
| | | |
| | | // The attribute type that will be used to report the protocol. |
| | | /** The attribute type that will be used to report the protocol. */ |
| | | private AttributeType protocolType; |
| | | |
| | | // The attribute type that will be used to report the config dn . |
| | | /** The attribute type that will be used to report the config dn . */ |
| | | private AttributeType configDnType; |
| | | |
| | | // The connection handler with which this monitor is associated. |
| | | /** The connection handler with which this monitor is associated. */ |
| | | private ConnectionHandler<?> connectionHandler; |
| | | |
| | | // The name for this monitor. |
| | | /** The name for this monitor. */ |
| | | private String monitorName; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeMonitorProvider(MonitorProviderCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getMonitorInstanceName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public List<Attribute> getMonitorData() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initializeMonitorProvider(MonitorProviderCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.monitors; |
| | | |
| | |
| | | |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The name for this monitor. |
| | | /** The name for this monitor. */ |
| | | private String monitorName; |
| | | |
| | | // The entry cache common name. |
| | | /** The entry cache common name. */ |
| | | private String entryCacheName; |
| | | |
| | | // The entry cache with which this monitor is associated. |
| | | /** The entry cache with which this monitor is associated. */ |
| | | private EntryCache<? extends EntryCacheCfg> entryCache; |
| | | |
| | | // Entry cache monitor configuration. |
| | | /** Entry cache monitor configuration. */ |
| | | private EntryCacheMonitorProviderCfg monitorConfiguration; |
| | | |
| | | /** |
| | |
| | | this.entryCache = entryCache; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeMonitorProvider( |
| | | EntryCacheMonitorProviderCfg configuration) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getMonitorInstanceName() |
| | | { |
| | | return monitorName; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ArrayList<Attribute> getMonitorData() |
| | | { |
| | |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.types.*; |
| | | |
| | | |
| | | /** |
| | | * This class defines a monitor provider that reports information about |
| | | * Directory Server memory usage. |
| | |
| | | extends MonitorProvider<MemoryUsageMonitorProviderCfg> |
| | | implements Runnable |
| | | { |
| | | // A map of the last GC counts seen by this monitor for calculating recent |
| | | // stats. |
| | | /** A map of the last GC counts seen by this monitor for calculating recent stats. */ |
| | | private HashMap<String,Long> lastGCCounts = new HashMap<String,Long>(); |
| | | |
| | | // A map of the last GC times seen by this monitor for calculating recent |
| | | // stats. |
| | | /** A map of the last GC times seen by this monitor for calculating recent stats. */ |
| | | private HashMap<String,Long> lastGCTimes = new HashMap<String,Long>(); |
| | | |
| | | // A map of the most recent GC durations seen by this monitor. |
| | | /** A map of the most recent GC durations seen by this monitor. */ |
| | | private HashMap<String,Long> recentGCDurations = new HashMap<String,Long>(); |
| | | |
| | | // A map of the memory manager names to names that are safe for use in |
| | | // attribute names. |
| | | /** |
| | | * A map of the memory manager names to names that are safe for use in |
| | | * attribute names. |
| | | */ |
| | | private HashMap<String,String> gcSafeNames = new HashMap<String,String>(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initializeMonitorProvider( |
| | | MemoryUsageMonitorProviderCfg configuration) |
| | | throws ConfigException, InitializationException |
| | |
| | | scheduleUpdate(this, 0, 1, TimeUnit.SECONDS); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getMonitorInstanceName() |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void run() |
| | | { |
| | | for (GarbageCollectorMXBean gc : |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ArrayList<Attribute> getMonitorData() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.monitors; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // The maximum backlog observed by polling the queue. |
| | | /** The maximum backlog observed by polling the queue. */ |
| | | private int maxBacklog; |
| | | |
| | | // The total number of times the backlog has been polled. |
| | | /** The total number of times the backlog has been polled. */ |
| | | private long numPolls; |
| | | |
| | | // The total backlog observed from periodic polling. |
| | | /** The total backlog observed from periodic polling. */ |
| | | private long totalBacklog; |
| | | |
| | | // The parallel work queue instance with which this monitor is associated. |
| | | /** The parallel work queue instance with which this monitor is associated. */ |
| | | private ParallelWorkQueue workQueue; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initializeMonitorProvider(MonitorProviderCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void run() |
| | | { |
| | | int backlog = workQueue.size(); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.monitors; |
| | | |
| | |
| | | public class StackTraceMonitorProvider |
| | | extends MonitorProvider<StackTraceMonitorProviderCfg> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initializeMonitorProvider( |
| | | StackTraceMonitorProviderCfg configuration) |
| | | throws ConfigException, InitializationException |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012-2014 ForgeRock AS. |
| | | * Portions Copyright 2012-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.monitors; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initializeMonitorProvider( |
| | | SystemInfoMonitorProviderCfg configuration) |
| | | throws ConfigException, InitializationException |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.monitors; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // The maximum backlog observed by polling the queue. |
| | | /** The maximum backlog observed by polling the queue. */ |
| | | private int maxBacklog; |
| | | |
| | | // The total number of times the backlog has been polled. |
| | | /** The total number of times the backlog has been polled. */ |
| | | private long numPolls; |
| | | |
| | | // The total backlog observed from periodic polling. |
| | | /** The total backlog observed from periodic polling. */ |
| | | private long totalBacklog; |
| | | |
| | | // The traditional work queue instance with which this monitor is associated. |
| | | /** The traditional work queue instance with which this monitor is associated. */ |
| | | private TraditionalWorkQueue workQueue; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initializeMonitorProvider(MonitorProviderCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void run() |
| | | { |
| | | int backlog = workQueue.size(); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.monitors; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void initializeMonitorProvider(VersionMonitorProviderCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | final AttributeCleanupPluginCfg config) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PluginResult.PreParse doPreParse( |
| | | final PreParseAddOperation addOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PluginResult.PreParse doPreParse( |
| | | final PreParseModifyOperation modifyOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizePlugin() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePlugin(final Set<PluginType> pluginTypes, |
| | | final AttributeCleanupPluginCfg configuration) throws ConfigException, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(final PluginCfg configuration, |
| | | final List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | final AttributeCleanupPluginCfg config, final List<LocalizableMessage> messages) |
| | |
| | | super(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void initializePlugin(Set<PluginType> pluginTypes, |
| | | ChangeNumberControlPluginCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void finalizePlugin() |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.PostOperation |
| | | doPostOperation(PostOperationAddOperation addOperation) |
| | |
| | | return PluginResult.PostOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.PostOperation |
| | | doPostOperation(PostOperationDeleteOperation deleteOperation) |
| | |
| | | return PluginResult.PostOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.PostOperation |
| | | doPostOperation(PostOperationModifyOperation modifyOperation) |
| | |
| | | return PluginResult.PostOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.PostOperation |
| | | doPostOperation(PostOperationModifyDNOperation modifyDNOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(PluginCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ChangeNumberControlPluginCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | return configAcceptable; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | ChangeNumberControlPluginCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | // The attribute type for the "entryUUID" attribute. |
| | | /** The attribute type for the "entryUUID" attribute. */ |
| | | private final AttributeType entryUUIDType; |
| | | |
| | | // The current configuration for this plugin. |
| | | /** The current configuration for this plugin. */ |
| | | private EntryUUIDPluginCfg currentConfig; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void initializePlugin(Set<PluginType> pluginTypes, |
| | | EntryUUIDPluginCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void finalizePlugin() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.ImportLDIF |
| | | doLDIFImport(LDIFImportConfig importConfig, Entry entry) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.PreOperation |
| | | doPreOperation(PreOperationAddOperation addOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(PluginCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | EntryUUIDPluginCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | EntryUUIDPluginCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | // The current configuration for this plugin. |
| | | /** The current configuration for this plugin. */ |
| | | private LDAPAttributeDescriptionListPluginCfg currentConfig; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void initializePlugin(Set<PluginType> pluginTypes, |
| | | LDAPAttributeDescriptionListPluginCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void finalizePlugin() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.PreParse doPreParse( |
| | | PreParseSearchOperation searchOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(PluginCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | LDAPAttributeDescriptionListPluginCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | LDAPAttributeDescriptionListPluginCfg |
| | | configuration) |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The attribute type for the "createTimestamp" attribute. |
| | | /** The attribute type for the "createTimestamp" attribute. */ |
| | | private final AttributeType createTimestampType; |
| | | |
| | | // The attribute type for the "creatorsName" attribute. |
| | | /** The attribute type for the "creatorsName" attribute. */ |
| | | private final AttributeType creatorsNameType; |
| | | |
| | | // The attribute type for the "modifiersName" attribute. |
| | | /** The attribute type for the "modifiersName" attribute. */ |
| | | private final AttributeType modifiersNameType; |
| | | |
| | | // The attribute type for the "modifyTimestamp" attribute. |
| | | /** The attribute type for the "modifyTimestamp" attribute. */ |
| | | private final AttributeType modifyTimestampType; |
| | | |
| | | // The current configuration for this plugin. |
| | | /** The current configuration for this plugin. */ |
| | | private LastModPluginCfg currentConfig; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void initializePlugin(Set<PluginType> pluginTypes, |
| | | LastModPluginCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void finalizePlugin() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.PreOperation |
| | | doPreOperation(PreOperationAddOperation addOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.PreOperation |
| | | doPreOperation(PreOperationModifyOperation modifyOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.PreOperation |
| | | doPreOperation(PreOperationModifyDNOperation modifyDNOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(PluginCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable(LastModPluginCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | LastModPluginCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | // The attribute type used to specify the password policy for an entry. |
| | | /** The attribute type used to specify the password policy for an entry. */ |
| | | private AttributeType customPolicyAttribute; |
| | | |
| | | // The set of attribute types defined in the schema with the auth password |
| | | // syntax. |
| | | /** |
| | | * The set of attribute types defined in the schema with the auth password |
| | | * syntax. |
| | | */ |
| | | private AttributeType[] authPasswordTypes; |
| | | |
| | | // The set of attribute types defined in the schema with the user password |
| | | // syntax. |
| | | /** |
| | | * The set of attribute types defined in the schema with the user password |
| | | * syntax. |
| | | */ |
| | | private AttributeType[] userPasswordTypes; |
| | | |
| | | // The set of password storage schemes to use for the various password |
| | | // policies defined in the server. |
| | | /** |
| | | * The set of password storage schemes to use for the various password |
| | | * policies defined in the server. |
| | | */ |
| | | private HashMap<DN,PasswordStorageScheme<?>[]> schemesByPolicy; |
| | | |
| | | // The default password storage schemes for auth password attributes. |
| | | /** The default password storage schemes for auth password attributes. */ |
| | | private PasswordStorageScheme<?>[] defaultAuthPasswordSchemes; |
| | | |
| | | // The default password storage schemes for user password attributes. |
| | | /** The default password storage schemes for user password attributes. */ |
| | | private PasswordStorageScheme<?>[] defaultUserPasswordSchemes; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void initializePlugin(Set<PluginType> pluginTypes, |
| | | PasswordPolicyImportPluginCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void processImportBegin(Backend backend, LDIFImportConfig config) |
| | | { |
| | | // Find the set of attribute types with the auth password and user password |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void processImportEnd(Backend backend, LDIFImportConfig config, |
| | | boolean successful) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.ImportLDIF |
| | | doLDIFImport(LDIFImportConfig importConfig, Entry entry) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(PluginCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | PasswordPolicyImportPluginCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | PasswordPolicyImportPluginCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | //Current plugin configuration. |
| | | /** Current plugin configuration. */ |
| | | private ReferentialIntegrityPluginCfg currentConfiguration; |
| | | |
| | | //List of attribute types that will be checked during referential integrity |
| | | //processing. |
| | | /** |
| | | * List of attribute types that will be checked during referential integrity |
| | | * processing. |
| | | */ |
| | | private LinkedHashSet<AttributeType> |
| | | attributeTypes = new LinkedHashSet<AttributeType>(); |
| | | |
| | | //List of base DNs that limit the scope of the referential integrity checking. |
| | | /** List of base DNs that limit the scope of the referential integrity checking. */ |
| | | private Set<DN> baseDNs = new LinkedHashSet<DN>(); |
| | | |
| | | //The update interval the background thread uses. If it is 0, then |
| | | //the changes are processed in foreground. |
| | | /** |
| | | * The update interval the background thread uses. If it is 0, then |
| | | * the changes are processed in foreground. |
| | | */ |
| | | private long interval; |
| | | |
| | | //The flag used by the background thread to check if it should exit. |
| | | /** The flag used by the background thread to check if it should exit. */ |
| | | private boolean stopRequested; |
| | | |
| | | //The thread name. |
| | | /** The thread name. */ |
| | | private static final String name = |
| | | "Referential Integrity Background Update Thread"; |
| | | |
| | | //The name of the logfile that the update thread uses to process change |
| | | //records. Defaults to "logs/referint", but can be changed in the |
| | | //configuration. |
| | | /** |
| | | * The name of the logfile that the update thread uses to process change |
| | | * records. Defaults to "logs/referint", but can be changed in the |
| | | * configuration. |
| | | */ |
| | | private String logFileName; |
| | | |
| | | //The File class that logfile corresponds to. |
| | | /** The File class that logfile corresponds to. */ |
| | | private File logFile; |
| | | |
| | | //The Thread class that the background thread corresponds to. |
| | | /** The Thread class that the background thread corresponds to. */ |
| | | private Thread backGroundThread; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public static final String DELETE_DNS="deleteDNs"; |
| | | |
| | | //The buffered reader that is used to read the log file by the background |
| | | //thread. |
| | | /** |
| | | * The buffered reader that is used to read the log file by the background |
| | | * thread. |
| | | */ |
| | | private BufferedReader reader; |
| | | |
| | | //The buffered writer that is used to write update records in the log |
| | | //when the plugin is in background processing mode. |
| | | /** |
| | | * The buffered writer that is used to write update records in the log |
| | | * when the plugin is in background processing mode. |
| | | */ |
| | | private BufferedWriter writer; |
| | | |
| | | /* Specifies the mapping between the attribute type (specified in the |
| | | /** |
| | | * Specifies the mapping between the attribute type (specified in the |
| | | * attributeTypes list) and the filter which the plugin should use |
| | | * to verify the integrity of the value of the given attribute. |
| | | */ |
| | |
| | | new LinkedHashMap<AttributeType, SearchFilter>(); |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void initializePlugin(Set<PluginType> pluginTypes, |
| | | ReferentialIntegrityPluginCfg pluginCfg) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | ReferentialIntegrityPluginCfg newConfiguration) |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(PluginCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ReferentialIntegrityPluginCfg configuration, |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | public PluginResult.PostOperation |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | public PluginResult.PostOperation doPostOperation( |
| | |
| | | return PluginResult.PostOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | public PluginResult.SubordinateModifyDN processSubordinateModifyDN( |
| | |
| | | return PluginResult.SubordinateModifyDN.continueOperationProcessing(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @SuppressWarnings("unchecked") |
| | | @Override |
| | | public PluginResult.SubordinateDelete processSubordinateDelete( |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void finalizePlugin() { |
| | | currentConfiguration.removeReferentialIntegrityChangeListener(this); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PluginResult.PreOperation doPreOperation( |
| | | public PluginResult.PreOperation doPreOperation( |
| | | PreOperationModifyOperation modifyOperation) |
| | | { |
| | | /* Skip the integrity checks if the enforcing is not enabled |
| | |
| | | return PluginResult.PreOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PluginResult.PreOperation doPreOperation( |
| | | PreOperationAddOperation addOperation) |
| | |
| | | */ |
| | | static final class MD4MessageDigest extends MessageDigest |
| | | { |
| | | // Class is package private for testing. |
| | | /** Class is package private for testing. */ |
| | | private final byte[] xBuf = new byte[4]; |
| | | private int xBufOff; |
| | | private long byteCount; |
| | | |
| | | private static final int DIGEST_LENGTH = 16; |
| | | private int H1, H2, H3, H4; // IV's |
| | | /** IV's. */ |
| | | private int H1, H2, H3, H4; |
| | | private final int[] X = new int[16]; |
| | | private int xOff; |
| | | |
| | | // |
| | | // round 1 left rotates |
| | | // |
| | | /** Round 1 left rotates. */ |
| | | private static final int S11 = 3; |
| | | private static final int S12 = 7; |
| | | private static final int S13 = 11; |
| | | private static final int S14 = 19; |
| | | |
| | | // |
| | | // round 2 left rotates |
| | | // |
| | | /** Round 2 left rotates. */ |
| | | private static final int S21 = 3; |
| | | private static final int S22 = 5; |
| | | private static final int S23 = 9; |
| | | private static final int S24 = 13; |
| | | |
| | | // |
| | | // round 3 left rotates |
| | | // |
| | | /** Round 3 left rotates. */ |
| | | private static final int S31 = 3; |
| | | private static final int S32 = 9; |
| | | private static final int S33 = 11; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public byte[] engineDigest() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void engineReset() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void engineUpdate(final byte input) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void engineUpdate(final byte[] in, int inOff, int len) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /* |
| | | /** |
| | | * F, G, H and I are the basic MD4 functions. |
| | | */ |
| | | private int F(final int u, final int v, final int w) |
| | |
| | | */ |
| | | private SambaPasswordPluginCfg config; |
| | | |
| | | // The name of the Samba LanMan password attribute. |
| | | /** The name of the Samba LanMan password attribute. */ |
| | | private static final String SAMBA_LM_PASSWORD_ATTRIBUTE_NAME = |
| | | "sambaLMPassword"; |
| | | |
| | | // The name of the Samba NT password attribute. |
| | | /** The name of the Samba NT password attribute. */ |
| | | private static final String SAMBA_NT_PASSWORD_ATTRIBUTE_NAME = |
| | | "sambaNTPassword"; |
| | | |
| | | // The name of the Samba account object class. |
| | | /** The name of the Samba account object class. */ |
| | | private static final String SAMBA_SAM_ACCOUNT_OC_NAME = "sambaSAMAccount"; |
| | | |
| | | // The name of the Samba last password change attribute. |
| | | /** The name of the Samba last password change attribute. */ |
| | | private static final String SAMBA_PWD_LAST_SET_NAME = "sambaPwdLastSet"; |
| | | |
| | | /** |
| | | * Debug tracer object to log debugging information. |
| | | */ |
| | | /** Debug tracer object to log debugging information. */ |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | /** |
| | | * Password Modify Extended Operation OID. |
| | | */ |
| | | /** Password Modify Extended Operation OID. */ |
| | | private static final String PWMOD_EXTOP_OID = "1.3.6.1.4.1.4203.1.11.1"; |
| | | |
| | | /** |
| | | * Magic string to be used as salt. |
| | | */ |
| | | /** Magic string to be used as salt. */ |
| | | private static final String MAGIC_STR = "KGS!@#$%"; |
| | | |
| | | // Default timestamp provider implementation. |
| | | /** Default timestamp provider implementation. */ |
| | | private static final TimeStampProvider DEFAULT_TIMESTAMP_PROVIDER = |
| | | new TimeStampProvider() |
| | | { |
| | |
| | | } |
| | | }; |
| | | |
| | | // Use the default implementation of the timestamp provider... by default. |
| | | /** Use the default implementation of the timestamp provider... by default. */ |
| | | private TimeStampProvider timeStampProvider = DEFAULT_TIMESTAMP_PROVIDER; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | final SambaPasswordPluginCfg newConfig) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PluginResult.PostOperation doPostOperation( |
| | | final PostOperationExtendedOperation extendedOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public PluginResult.PreOperation doPreOperation( |
| | | final PreOperationModifyOperation modifyOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializePlugin(final Set<PluginType> pluginTypes, |
| | | final SambaPasswordPluginCfg configuration) throws ConfigException, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | final SambaPasswordPluginCfg newConfig, final List<LocalizableMessage> messages) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void initializePlugin(Set<PluginType> pluginTypes, |
| | | SevenBitCleanPluginCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void finalizePlugin() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.ImportLDIF |
| | | doLDIFImport(LDIFImportConfig importConfig, Entry entry) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.PreParse |
| | | doPreParse(PreParseAddOperation addOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.PreParse |
| | | doPreParse(PreParseModifyOperation modifyOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.PreParse |
| | | doPreParse(PreParseModifyDNOperation modifyDNOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(PluginCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | SevenBitCleanPluginCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | SevenBitCleanPluginCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void initializePlugin(Set<PluginType> pluginTypes, |
| | | UniqueAttributePluginCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void finalizePlugin() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.PreOperation |
| | | doPreOperation(PreOperationAddOperation addOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.PreOperation |
| | | doPreOperation(PreOperationModifyOperation modifyOperation) |
| | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.PreOperation doPreOperation( |
| | | PreOperationModifyDNOperation modifyDNOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void doPostSynchronization( |
| | | PostSynchronizationAddOperation addOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void doPostSynchronization( |
| | | PostSynchronizationModifyOperation modifyOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void doPostSynchronization( |
| | | PostSynchronizationModifyDNOperation modifyDNOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(PluginCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | UniqueAttributePluginCfg configuration, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | UniqueAttributePluginCfg newConfiguration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getComponentEntryDN() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getClassName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Map<String,String> getAlerts() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.PostOperation |
| | | doPostOperation(PostOperationAddOperation addOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.PostOperation |
| | | doPostOperation(PostOperationModifyOperation modifyOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.PostOperation |
| | | doPostOperation(PostOperationModifyDNOperation modifyDNOperation) |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.plugins.profiler; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // The number of frames in this stack. |
| | | /** The number of frames in this stack. */ |
| | | private int numFrames; |
| | | |
| | | // The source file line numbers for each of the frames in this stack. |
| | | /** The source file line numbers for each of the frames in this stack. */ |
| | | private int[] lineNumbers; |
| | | |
| | | // The class names for each of the frames in this stack. |
| | | /** The class names for each of the frames in this stack. */ |
| | | private String[] classNames; |
| | | |
| | | // The method names for each of the frames in this stack. |
| | | /** The method names for each of the frames in this stack. */ |
| | | private String[] methodNames; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.plugins.profiler; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // The mapping between the line numbers for this stack frame and the |
| | | // number of times that they were encountered. |
| | | /** |
| | | * The mapping between the line numbers for this stack frame and the |
| | | * number of times that they were encountered. |
| | | */ |
| | | private HashMap<Integer,Long> lineNumbers; |
| | | |
| | | // The mapping for subordinate frames. It is mapped to itself because we |
| | | // use a fuzzy equality comparison and sets do not have a get method that |
| | | // can be used to retrieve a specified object. |
| | | /** |
| | | * The mapping for subordinate frames. It is mapped to itself because we |
| | | * use a fuzzy equality comparison and sets do not have a get method that |
| | | * can be used to retrieve a specified object. |
| | | */ |
| | | private HashMap<ProfileStackFrame,ProfileStackFrame> subordinateFrames; |
| | | |
| | | // The class name for this stack frame. |
| | | /** The class name for this stack frame. */ |
| | | private String className; |
| | | |
| | | // The method name for this stack frame. |
| | | /** The method name for this stack frame. */ |
| | | private String methodName; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012-2014 ForgeRock AS |
| | | * Portions Copyright 2012-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.plugins.profiler; |
| | | |
| | |
| | | public class ProfileViewer |
| | | implements TreeSelectionListener |
| | | { |
| | | // The root stack frames for the profile information that has been captured. |
| | | /** The root stack frames for the profile information that has been captured. */ |
| | | private HashMap<ProfileStackFrame,ProfileStackFrame> rootFrames; |
| | | |
| | | // A set of stack traces indexed by class and method name. |
| | | /** A set of stack traces indexed by class and method name. */ |
| | | private HashMap<String,HashMap<ProfileStack,Long>> stacksByMethod; |
| | | |
| | | // The editor pane that will provide detailed information about the selected |
| | | // stack frame. |
| | | /** |
| | | * The editor pane that will provide detailed information about the selected |
| | | * stack frame. |
| | | */ |
| | | private JEditorPane frameInfoPane; |
| | | |
| | | // The GUI tree that will be used to hold stack frame information; |
| | | /** The GUI tree that will be used to hold stack frame information;. */ |
| | | private JTree profileTree; |
| | | |
| | | // The total length of time in milliseconds for which data is available. |
| | | /** The total length of time in milliseconds for which data is available. */ |
| | | private long totalDuration; |
| | | |
| | | // The total number of profile intervals for which data is available. |
| | | /** The total number of profile intervals for which data is available. */ |
| | | private long totalIntervals; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // The DN of the configuration entry for this plugin. |
| | | /** The DN of the configuration entry for this plugin. */ |
| | | private DN configEntryDN; |
| | | |
| | | // The current configuration for this plugin. |
| | | /** The current configuration for this plugin. */ |
| | | private ProfilerPluginCfg currentConfig; |
| | | |
| | | // The thread that is actually capturing the profile information. |
| | | /** The thread that is actually capturing the profile information. */ |
| | | private ProfilerThread profilerThread; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void initializePlugin(Set<PluginType> pluginTypes, |
| | | ProfilerPluginCfg configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void finalizePlugin() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final PluginResult.Startup doStartup() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(PluginCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | ProfilerPluginCfg configuration, |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.plugins.profiler; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // Indicates whether a request has been received to stop profiling. |
| | | /** Indicates whether a request has been received to stop profiling. */ |
| | | private boolean stopProfiling; |
| | | |
| | | // The time at which the capture started. |
| | | /** The time at which the capture started. */ |
| | | private long captureStartTime; |
| | | |
| | | // The time at which the capture stopped. |
| | | /** The time at which the capture stopped. */ |
| | | private long captureStopTime; |
| | | |
| | | // The number of intervals for which we have captured data. |
| | | /** The number of intervals for which we have captured data. */ |
| | | private long numIntervals; |
| | | |
| | | // The sampling interval that will be used by this thread. |
| | | /** The sampling interval that will be used by this thread. */ |
| | | private long sampleInterval; |
| | | |
| | | // The set of thread stack traces captured by this profiler thread. |
| | | /** The set of thread stack traces captured by this profiler thread. */ |
| | | private HashMap<ProfileStack,Long> stackTraces; |
| | | |
| | | // The thread that is actually performing the capture. |
| | | /** The thread that is actually performing the capture. */ |
| | | private Thread captureThread; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // Indicates whether this connection handler is currently stopped. |
| | | /** Indicates whether this connection handler is currently stopped. */ |
| | | private volatile boolean isStopped; |
| | | |
| | | // Indicates whether we should stop this connection handler. |
| | | /** Indicates whether we should stop this connection handler. */ |
| | | private volatile boolean stopRequested; |
| | | |
| | | // The path to the directory to watch for new LDIF files. |
| | | /** The path to the directory to watch for new LDIF files. */ |
| | | private File ldifDirectory; |
| | | |
| | | // The internal client connection that will be used for all processing. |
| | | /** The internal client connection that will be used for all processing. */ |
| | | private InternalClientConnection conn; |
| | | |
| | | // The current configuration for this LDIF connection handler. |
| | | /** The current configuration for this LDIF connection handler. */ |
| | | private LDIFConnectionHandlerCfg currentConfig; |
| | | |
| | | // The thread used to run the connection handler. |
| | | /** The thread used to run the connection handler. */ |
| | | private Thread connectionHandlerThread; |
| | | |
| | | // Help to not warn permanently and fullfill the log file |
| | | // in debug mode. |
| | | /** Help to not warn permanently and fullfill the log file in debug mode. */ |
| | | private boolean alreadyWarn; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeConnectionHandler(LDIFConnectionHandlerCfg |
| | | configuration) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeConnectionHandler(LocalizableMessage finalizeReason) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getConnectionHandlerName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getProtocol() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Collection<HostPort> getListeners() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Collection<ClientConnection> getClientConnections() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void run() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(ConnectionHandlerCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | LDIFConnectionHandlerCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | LDIFConnectionHandlerCfg configuration) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getComponentEntryDN() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public String getClassName() |
| | | { |
| | | return LDIFConnectionHandler.class.getName(); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public LinkedHashMap<String,String> getAlerts() |
| | | { |
| | | LinkedHashMap<String,String> alerts = new LinkedHashMap<String,String>(); |
| | |
| | | return 0; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int getSSF() { |
| | | //Always return strongest value. |
| | |
| | | public final class InternalConnectionHandler |
| | | extends ConnectionHandler |
| | | { |
| | | // The singleton instance of this internal connection handler. |
| | | /** The singleton instance of this internal connection handler. */ |
| | | private static InternalConnectionHandler handlerInstance = |
| | | new InternalConnectionHandler(); |
| | | |
| | | // The list of "connections" associated with this connection |
| | | // handler. |
| | | /** The list of "connections" associated with this connection handler. */ |
| | | private LinkedList<ClientConnection> connectionList; |
| | | |
| | | // The list of listeners associated with this connection handler. |
| | | /** The list of listeners associated with this connection handler. */ |
| | | private LinkedList<HostPort> listeners; |
| | | |
| | | // The name of the protocol for this connection handler. |
| | | /** The name of the protocol for this connection handler. */ |
| | | private String protocol; |
| | | |
| | | // Configuration object of the connection hanlder |
| | | /** Configuration object of the connection handler. */ |
| | | private ConnectionHandlerCfg configuration; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeConnectionHandler(LocalizableMessage finalizeReason) |
| | | { |
| | |
| | | public final class InternalLDAPInputStream |
| | | extends InputStream |
| | | { |
| | | // The queue of LDAP messages providing the data to be made |
| | | // available to the client. |
| | | /** |
| | | * The queue of LDAP messages providing the data to be made |
| | | * available to the client. |
| | | */ |
| | | private final ArrayBlockingQueue<LDAPMessage> messageQueue; |
| | | |
| | | // Indicates whether this stream has been closed. |
| | | /** Indicates whether this stream has been closed. */ |
| | | private boolean closed; |
| | | |
| | | // The byte buffer with partial data to be written to the client. |
| | | /** The byte buffer with partial data to be written to the client. */ |
| | | private final ByteStringBuilder messageBuffer; |
| | | |
| | | // The byte buffer reader. |
| | | /** The byte buffer reader. */ |
| | | private final ByteSequenceReader messageReader; |
| | | |
| | | // The byte buffer writer. |
| | | /** The byte buffer writer. */ |
| | | private final ASN1Writer writer; |
| | | |
| | | // The internal LDAP socket serviced by this input stream. |
| | | /** The internal LDAP socket serviced by this input stream. */ |
| | | private final InternalLDAPSocket socket; |
| | | |
| | | |
| | |
| | | extends OutputStream |
| | | implements InternalSearchListener |
| | | { |
| | | // Indicates whether this stream has been closed. |
| | | /** Indicates whether this stream has been closed. */ |
| | | private boolean closed; |
| | | |
| | | private final ASN1Reader reader; |
| | | |
| | | // The internal LDAP socket with which this output stream is |
| | | // associated. |
| | | /** The internal LDAP socket with which this output stream is associated. */ |
| | | private final InternalLDAPSocket socket; |
| | | |
| | | // The immediate data being written. |
| | | /** The immediate data being written. */ |
| | | private ByteSequenceReader byteBuffer; |
| | | |
| | | // The save buffer used to store any unprocessed data waiting |
| | | // to be read as ASN.1 elements. (Usually due to writing incomplete |
| | | // ASN.1 elements.) |
| | | /** |
| | | * The save buffer used to store any unprocessed data waiting |
| | | * to be read as ASN.1 elements. (Usually due to writing incomplete |
| | | * ASN.1 elements.) |
| | | */ |
| | | private final ByteStringBuilder saveBuffer; |
| | | |
| | | private final ByteSequenceReader saveBufferReader; |
| | |
| | | */ |
| | | private class CombinedBufferInputStream extends InputStream |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int available() |
| | | { |
| | |
| | | return saveBufferReader.remaining() + byteBuffer.remaining(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int read() |
| | | { |
| | |
| | | return -1; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int read(byte[] bytes) |
| | | { |
| | | return read(bytes, 0, bytes.length); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int read(byte[] value, int off, int length) |
| | | { |
| | |
| | | return bytesCopied; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public long skip(long length) |
| | | { |
| | |
| | | public final class InternalLDAPSocket |
| | | extends Socket |
| | | { |
| | | // Indicates whether this socket is closed. |
| | | /** Indicates whether this socket is closed. */ |
| | | private boolean closed; |
| | | |
| | | // The value that the client has requested for SO_KEEPALIVE. |
| | | /** The value that the client has requested for SO_KEEPALIVE. */ |
| | | private boolean keepAlive; |
| | | |
| | | // The value that the client has requested for OOBINLINE. |
| | | /** The value that the client has requested for OOBINLINE. */ |
| | | private boolean oobInline; |
| | | |
| | | // The value that the client has requested for SO_REUSEADDR. |
| | | /** The value that the client has requested for SO_REUSEADDR. */ |
| | | private boolean reuseAddress; |
| | | |
| | | // The value that the client has requested for TCP_NODELAY. |
| | | /** The value that the client has requested for TCP_NODELAY. */ |
| | | private boolean tcpNoDelay; |
| | | |
| | | // The value that the client has requested for SO_LINGER. |
| | | /** The value that the client has requested for SO_LINGER. */ |
| | | private int lingerDuration; |
| | | |
| | | // The value that the client has requested for SO_RCVBUF. |
| | | /** The value that the client has requested for SO_RCVBUF. */ |
| | | private int receiveBufferSize; |
| | | |
| | | // The value that the client has requested for SO_SNDBUF. |
| | | /** The value that the client has requested for SO_SNDBUF. */ |
| | | private int sendBufferSize; |
| | | |
| | | // The value that the client has requested for SO_TIMEOUT. |
| | | /** The value that the client has requested for SO_TIMEOUT. */ |
| | | private int timeout; |
| | | |
| | | // The value that the client has requested for the traffic class. |
| | | /** The value that the client has requested for the traffic class. */ |
| | | private int trafficClass; |
| | | |
| | | // The internal client connection used to perform the internal |
| | | // operations. It will be null until it is first used. |
| | | /** |
| | | * The internal client connection used to perform the internal |
| | | * operations. It will be null until it is first used. |
| | | */ |
| | | private InternalClientConnection conn; |
| | | |
| | | // The input stream associated with this internal LDAP socket. |
| | | /** The input stream associated with this internal LDAP socket. */ |
| | | private InternalLDAPInputStream inputStream; |
| | | |
| | | // The output stream associated with this internal LDAP socket. |
| | | /** The output stream associated with this internal LDAP socket. */ |
| | | private InternalLDAPOutputStream outputStream; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2012-2014 ForgeRock AS. |
| | | * Portions copyright 2012-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.protocols.internal; |
| | | |
| | |
| | | */ |
| | | public final class SearchRequest extends AbstractRequestImpl { |
| | | /** |
| | | * Use a LinkedHashSet to return the attributes in the same order as requested by the user |
| | | * Use a LinkedHashSet to return the attributes in the same order as requested by the user. |
| | | */ |
| | | private final Set<String> attributes = new LinkedHashSet<String>(); |
| | | private DereferenceAliasesPolicy dereferenceAliasesPolicy = DereferenceAliasesPolicy.NEVER; |
| | |
| | | public DirectoryRMIServerSocketFactory(SSLSocketFactory sslSocketFactory, |
| | | boolean needClientCertificate) |
| | | { |
| | | // |
| | | // Initialize the configuration parameters. |
| | | this.needClientCertificate = needClientCertificate; |
| | | this.sslSocketFactory = sslSocketFactory; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | JMXConnectionHandlerCfg config) { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeConnectionHandler(LocalizableMessage finalizeReason) { |
| | | // Make sure that we don't get notified of any more changes. |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getShutdownListenerName() { |
| | | return connectionHandlerName; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeConnectionHandler(JMXConnectionHandlerCfg config) |
| | | throws ConfigException, InitializationException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getConnectionHandlerName() { |
| | | return connectionHandlerName; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getProtocol() { |
| | | return protocol; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Collection<HostPort> getListeners() { |
| | | return listeners; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(ConnectionHandlerCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | JMXConnectionHandlerCfg config, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processServerShutdown(LocalizableMessage reason) { |
| | | // We should also close the RMI registry. |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void run() { |
| | | try |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void toString(StringBuilder buffer) { |
| | | buffer.append(connectionHandlerName); |
| | |
| | | |
| | | /** |
| | | * Wrapper class for the JMX's RMI connector. This class has the exact same |
| | | * functionnalities but maintain inner variables which are used during the |
| | | * functionalities but maintain inner variables which are used during the |
| | | * connection phase. |
| | | * <p> |
| | | * Note that the javadoc has been copied from the |
| | | * javax.management.remote.JMXConnector interface. |
| | | */ |
| | | public class OpendsJmxConnector implements JMXConnector |
| | | |
| | | { |
| | | |
| | | /** |
| | | * the wrapped JMX RMI connector. |
| | | */ |
| | | /** The wrapped JMX RMI connector. */ |
| | | private JMXConnector jmxc; |
| | | |
| | | /** |
| | | * the connection environment set at creation. |
| | | */ |
| | | /** The connection environment set at creation. */ |
| | | private Map<String,Object> environment; |
| | | |
| | | /** |
| | | * the JMX Service URL. |
| | | */ |
| | | /** The JMX Service URL. */ |
| | | private JMXServiceURL serviceURL; |
| | | |
| | | /** |
| | | * the host to connect to. |
| | | */ |
| | | /** The host to connect to. */ |
| | | private String serverHostname; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.protocols.jmx; |
| | | |
| | |
| | | */ |
| | | public class OpendsJmxPrincipal implements Principal |
| | | { |
| | | /** |
| | | * The authentication ID. |
| | | */ |
| | | /** The authentication ID. */ |
| | | private String authID; |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean equals(Object another) |
| | | { |
| | | return authID.equals(another); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int hashCode() |
| | | { |
| | | return authID.hashCode() ; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() |
| | | { |
| | | return authID; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public String getName() |
| | | { |
| | | return authID; |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.protocols.jmx; |
| | | |
| | |
| | | super(port, csf, ssf, env); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected RMIConnection makeClient(String connectionId, Subject subject) |
| | | throws IOException |
| | |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.protocols.jmx; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | | import java.util.*; |
| | | import static org.opends.messages.ProtocolMessages.*; |
| | | |
| | | import java.util.ArrayList; |
| | | |
| | | import javax.management.remote.JMXAuthenticator; |
| | | import javax.security.auth.Subject; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.opends.messages.CoreMessages; |
| | | import org.opends.server.api.plugin.PluginResult; |
| | | import org.opends.server.core.BindOperationBasis; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.core.PluginConfigManager; |
| | | import org.opends.messages.CoreMessages; |
| | | import org.opends.server.protocols.ldap.LDAPResultCode; |
| | | |
| | | import static org.opends.messages.ProtocolMessages.*; |
| | | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.types.*; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.opends.server.types.AuthenticationInfo; |
| | | import org.opends.server.types.Control; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.DisconnectReason; |
| | | import org.opends.server.types.LDAPException; |
| | | import org.opends.server.types.Privilege; |
| | | |
| | | /** |
| | | * A <code>RMIAuthenticator</code> manages authentication for the secure |
| | |
| | | * @return a <code>Subject</code> holding the principal(s) |
| | | * authenticated |
| | | */ |
| | | @Override |
| | | public Subject authenticate(Object credentials) |
| | | { |
| | | // |
| | | // If we are in the finalized phase, we should not accept |
| | | // new connection |
| | | if (finalizedPhase) |
| | | // If we are in the finalized phase, we should not accept new connection |
| | | if (finalizedPhase |
| | | || credentials == null) |
| | | { |
| | | SecurityException se = new SecurityException(); |
| | | throw se; |
| | | } |
| | | |
| | | // |
| | | // Credentials are null !!! |
| | | if (credentials == null) |
| | | { |
| | | SecurityException se = new SecurityException(); |
| | | throw se; |
| | | throw new SecurityException(); |
| | | } |
| | | Object c[] = (Object[]) credentials; |
| | | String authcID = (String) c[0]; |
| | | String password = (String) c[1]; |
| | | |
| | | // |
| | | // The authcID is used at forwarder level to identify the calling |
| | | // client |
| | | // The authcID is used at forwarder level to identify the calling client |
| | | if (authcID == null) |
| | | { |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace("User name is Null"); |
| | | } |
| | | SecurityException se = new SecurityException(); |
| | | throw se; |
| | | logger.trace("User name is Null"); |
| | | throw new SecurityException(); |
| | | } |
| | | if (password == null) |
| | | { |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.trace("User password is Null "); |
| | | } |
| | | |
| | | SecurityException se = new SecurityException(); |
| | | throw se; |
| | | logger.trace("User password is Null "); |
| | | throw new SecurityException(); |
| | | } |
| | | |
| | | if (logger.isTraceEnabled()) |
| | |
| | | logger.trace("UserName = %s", authcID); |
| | | } |
| | | |
| | | // |
| | | // Declare the client connection |
| | | JmxClientConnection jmxClientConnection; |
| | | |
| | | // |
| | | // Try to see if we have an Ldap Authentication |
| | | // Which should be the case in the current implementation |
| | | try |
| | |
| | | throw se; |
| | | } |
| | | |
| | | // |
| | | // If we've gotten here, then the authentication was |
| | | // successful. We'll take the connection so |
| | | // invoke the post-connect plugins. |
| | |
| | | pluginResult.getErrorMessage()); |
| | | } |
| | | |
| | | SecurityException se = new SecurityException(); |
| | | throw se; |
| | | throw new SecurityException(); |
| | | } |
| | | |
| | | // initialize a subject |
| | | Subject s = new Subject(); |
| | | |
| | | // |
| | | // Add the Principal. The current implementation doesn't use it |
| | | |
| | | s.getPrincipals().add(new OpendsJmxPrincipal(authcID)); |
| | | |
| | | // add the connection client object |
| | |
| | | s.getPrivateCredentials().add(new Credential(jmxClientConnection)); |
| | | |
| | | return s; |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | { |
| | | ArrayList<Control> requestControls = new ArrayList<Control>(); |
| | | |
| | | // |
| | | // We have a new client connection |
| | | DN bindDN; |
| | | try |
| | | { |
| | | bindDN = DN.valueOf(authcID); |
| | | DN.valueOf(authcID); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | // |
| | | // Set the initcause. |
| | | LDAPException ldapEx = new LDAPException( |
| | | LDAPResultCode.INVALID_CREDENTIALS, |
| | |
| | | { |
| | | try |
| | | { |
| | | // |
| | | // start the common registry |
| | | startCommonRegistry(); |
| | | |
| | | // |
| | | // start the RMI connector (SSL + server authentication) |
| | | startConnectorNoClientCertificate(); |
| | | |
| | | // |
| | | // start the RMI connector (SSL + server authentication + |
| | | // client authentication + identity given part SASL/PLAIN) |
| | | // TODO startConnectorClientCertificate(clientConnection); |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | final InetAddress listenAddress = jmxConnectionHandler.getListenAddress(); |
| | | int registryPort = jmxConnectionHandler.getListenPort(); |
| | | |
| | | // |
| | | // create our local RMI registry if it does not exist already |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | |
| | | } |
| | | try |
| | | { |
| | | // |
| | | // TODO Not yet implemented: If the host has several interfaces |
| | | if (registry == null) |
| | | { |
| | |
| | | } |
| | | catch (RemoteException re) |
| | | { |
| | | // |
| | | // is the registry already created ? |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | |
| | | } |
| | | try |
| | | { |
| | | // |
| | | // get a 'remote' reference on the registry |
| | | Registry reg = LocateRegistry.getRegistry(registryPort); |
| | | |
| | | // |
| | | // 'ping' the registry |
| | | reg.list(); |
| | | registry = reg; |
| | |
| | | { |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | // |
| | | // no 'valid' registry found on the specified port |
| | | logger.trace("exception thrown while pinging the RMI registry"); |
| | | |
| | | // |
| | | // throw the original exception |
| | | logger.traceException(re); |
| | | } |
| | | throw re; |
| | | } |
| | | |
| | | // |
| | | // here the registry is ok even though |
| | | // it was not created by this call |
| | | if (logger.isTraceEnabled()) |
| | |
| | | { |
| | | try |
| | | { |
| | | // |
| | | // Environment map |
| | | HashMap<String, Object> env = new HashMap<String, Object>(); |
| | | |
| | |
| | | // --------------------- |
| | | // SERVER SIDE |
| | | // --------------------- |
| | | // |
| | | // Get a Server socket factory |
| | | KeyManager[] keyManagers; |
| | | KeyManagerProvider provider = DirectoryServer |
| | |
| | | null); |
| | | SSLSocketFactory ssf = ctx.getSocketFactory(); |
| | | |
| | | // |
| | | // set the Server socket factory in the JMX map |
| | | rmiServerSockeyFactory = new DirectoryRMIServerSocketFactory(ssf, |
| | | false); |
| | | rmiServerSockeyFactory = new DirectoryRMIServerSocketFactory(ssf, false); |
| | | env.put( |
| | | "jmx.remote.rmi.server.socket.factory", |
| | | rmiServerSockeyFactory); |
| | |
| | | } |
| | | } |
| | | |
| | | // |
| | | // specify the rmi JMX authenticator to be used |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | |
| | | |
| | | env.put(JMXConnectorServer.AUTHENTICATOR, rmiAuthenticator); |
| | | |
| | | // |
| | | // Create the JMX Service URL |
| | | String uri = "org.opends.server.protocols.jmx.client-unknown"; |
| | | String serviceUrl = "service:jmx:rmi:///jndi/rmi://" |
| | |
| | | + "/" + uri; |
| | | JMXServiceURL url = new JMXServiceURL(serviceUrl); |
| | | |
| | | // |
| | | // Create and start the connector |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | |
| | | opendsRmiConnectorServer, mbs); |
| | | jmxRmiConnectorNoClientCertificate.start(); |
| | | |
| | | // |
| | | // Register the connector into the RMI registry |
| | | // TODO Should we do that? |
| | | ObjectName name = new ObjectName(jmxRmiConnectorNoClientCertificateName); |
| | |
| | | jmxRmiConnectorNoClientCertificate = null; |
| | | jmxRmiConnectorClientCertificate = null; |
| | | |
| | | // |
| | | // Unregister connectors and stop them. |
| | | try |
| | | { |
| | |
| | | |
| | | if (stopRegistry) |
| | | { |
| | | // |
| | | // Close the socket |
| | | try |
| | | { |
| | | if (rmiSsf != null) |
| | | { |
| | | rmiSsf.close(); |
| | | } |
| | | } |
| | | catch (IOException e) |
| | | { |
| | |
| | | } |
| | | registry = null; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The message ID of the operation to abandon. |
| | | /** The message ID of the operation to abandon. */ |
| | | private int idToAbandon; |
| | | |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The matched DN for this response. |
| | | /** The matched DN for this response. */ |
| | | private DN matchedDN; |
| | | |
| | | // The result code for this response. |
| | | /** The result code for this response. */ |
| | | private int resultCode; |
| | | |
| | | // The set of referral URLs for this response. |
| | | /** The set of referral URLs for this response. */ |
| | | private List<String> referralURLs; |
| | | |
| | | // The error message for this response. |
| | | /** The error message for this response. */ |
| | | private LocalizableMessage errorMessage; |
| | | |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The server SASL credentials for this response. |
| | | /** The server SASL credentials for this response. */ |
| | | private ByteString serverSASLCredentials; |
| | | |
| | | // The matched DN for this response. |
| | | /** The matched DN for this response. */ |
| | | private DN matchedDN; |
| | | |
| | | // The result code for this response. |
| | | /** The result code for this response. */ |
| | | private int resultCode; |
| | | |
| | | // The set of referral URLs for this response. |
| | | /** The set of referral URLs for this response. */ |
| | | private List<String> referralURLs; |
| | | |
| | | // The error message for this response. |
| | | /** The error message for this response. */ |
| | | private LocalizableMessage errorMessage; |
| | | |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The assertion value for this compare request. |
| | | /** The assertion value for this compare request. */ |
| | | private ByteString assertionValue; |
| | | |
| | | // The DN for this compare request. |
| | | /** The DN for this compare request. */ |
| | | private ByteString dn; |
| | | |
| | | // The attribute type for this compare request. |
| | | /** The attribute type for this compare request. */ |
| | | private String attributeType; |
| | | |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The matched DN for this response. |
| | | /** The matched DN for this response. */ |
| | | private DN matchedDN; |
| | | |
| | | // The result code for this response. |
| | | /** The result code for this response. */ |
| | | private int resultCode; |
| | | |
| | | // The set of referral URLs for this response. |
| | | /** The set of referral URLs for this response. */ |
| | | private List<String> referralURLs; |
| | | |
| | | // The error message for this response. |
| | | /** The error message for this response. */ |
| | | private LocalizableMessage errorMessage; |
| | | |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The DN for this delete request. |
| | | /** The DN for this delete request. */ |
| | | private ByteString dn; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // The matched DN for this response. |
| | | /** The matched DN for this response. */ |
| | | private DN matchedDN; |
| | | |
| | | // The result code for this response. |
| | | /** The result code for this response. */ |
| | | private int resultCode; |
| | | |
| | | // The set of referral URLs for this response. |
| | | /** The set of referral URLs for this response. */ |
| | | private List<String> referralURLs; |
| | | |
| | | // The error message for this response. |
| | | /** The error message for this response. */ |
| | | private LocalizableMessage errorMessage; |
| | | |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The value for this extended request. |
| | | /** The value for this extended request. */ |
| | | private ByteString value; |
| | | |
| | | // The OID for this extended request. |
| | | /** The OID for this extended request. */ |
| | | private String oid; |
| | | |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The value for this extended response. |
| | | /** The value for this extended response. */ |
| | | private ByteString value; |
| | | |
| | | // The matched DN for this response. |
| | | /** The matched DN for this response. */ |
| | | private DN matchedDN; |
| | | |
| | | // The result code for this response. |
| | | /** The result code for this response. */ |
| | | private int resultCode; |
| | | |
| | | // The set of referral URLs for this response. |
| | | /** The set of referral URLs for this response. */ |
| | | private List<String> referralURLs; |
| | | |
| | | // The error message for this response. |
| | | /** The error message for this response. */ |
| | | private LocalizableMessage errorMessage; |
| | | |
| | | // The OID for this extended response. |
| | | /** The OID for this extended response. */ |
| | | private String oid; |
| | | |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The value for this intermediate response. |
| | | /** The value for this intermediate response. */ |
| | | private ByteString value; |
| | | |
| | | // The OID for this intermediate response. |
| | | /** The OID for this intermediate response. */ |
| | | private String oid; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void run() |
| | | { |
| | |
| | | private static final ThreadLocal<ASN1WriterHolder> ASN1_WRITER_CACHE = |
| | | new ThreadLocal<ASN1WriterHolder>() |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected ASN1WriterHolder initialValue() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Selector getWriteSelector() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public long getMaxBlockedWriteTimeLimit() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getMonitorSummary() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean prepareTLS(LocalizableMessageBuilder unavailableReason) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int getSSF() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finishBindOrStartTLS() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | LDAPConnectionHandlerCfg config) |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeConnectionHandler(LocalizableMessage finalizeReason) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getConnectionHandlerName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Collection<String> getEnabledSSLCipherSuites() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Collection<String> getEnabledSSLProtocols() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Collection<HostPort> getListeners() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getProtocol() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getShutdownListenerName() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeConnectionHandler(LDAPConnectionHandlerCfg config) |
| | | throws ConfigException, InitializationException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable(ConnectionHandlerCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | LDAPConnectionHandlerCfg config, List<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processServerShutdown(LocalizableMessage reason) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void start() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | |
| | | */ |
| | | public class LDAPControl extends Control |
| | | { |
| | | // The control value. |
| | | /** The control value. */ |
| | | private ByteString value; |
| | | |
| | | |
| | |
| | | return (value != null); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void writeValue(ASN1Writer stream) throws IOException |
| | | { |
| | | if (value != null) |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | |
| | | |
| | | private static LDAPFilter objectClassPresent; |
| | | |
| | | // The set of subAny elements for substring filters. |
| | | /** The set of subAny elements for substring filters. */ |
| | | private ArrayList<ByteString> subAnyElements; |
| | | |
| | | // The set of filter components for AND and OR filters. |
| | | /** The set of filter components for AND and OR filters. */ |
| | | private ArrayList<RawFilter> filterComponents; |
| | | |
| | | // Indicates whether to match on DN attributes for extensible match filters. |
| | | /** Indicates whether to match on DN attributes for extensible match filters. */ |
| | | private boolean dnAttributes; |
| | | |
| | | // The assertion value for several filter types. |
| | | /** The assertion value for several filter types. */ |
| | | private ByteString assertionValue; |
| | | |
| | | // The subFinal element for substring filters. |
| | | /** The subFinal element for substring filters. */ |
| | | private ByteString subFinalElement; |
| | | |
| | | // The subInitial element for substring filters. |
| | | /** The subInitial element for substring filters. */ |
| | | private ByteString subInitialElement; |
| | | |
| | | // The filter type for this filter. |
| | | /** The filter type for this filter. */ |
| | | private FilterType filterType; |
| | | |
| | | // The filter component for NOT filters. |
| | | /** The filter component for NOT filters. */ |
| | | private RawFilter notComponent; |
| | | |
| | | // The attribute type for several filter types. |
| | | /** The attribute type for several filter types. */ |
| | | private String attributeType; |
| | | |
| | | // The matching rule ID for extensible matching filters. |
| | | /** The matching rule ID for extensible matching filters. */ |
| | | private String matchingRuleID; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | |
| | | public class LDAPMessage |
| | | implements ProtocolElement |
| | | { |
| | | // The set of controls for this LDAP message. |
| | | /** The set of controls for this LDAP message. */ |
| | | private List<Control> controls; |
| | | |
| | | // The message ID for this LDAP message. |
| | | /** The message ID for this LDAP message. */ |
| | | private final int messageID; |
| | | |
| | | // The protocol op for this LDAP message. |
| | | /** The protocol op for this LDAP message. */ |
| | | private final ProtocolOp protocolOp; |
| | | |
| | | |
| | |
| | | public class LDAPModification |
| | | extends RawModification |
| | | { |
| | | // The modification type for this modification. |
| | | /** The modification type for this modification. */ |
| | | private ModificationType modificationType; |
| | | |
| | | // The attribute for this modification. |
| | | /** The attribute for this modification. */ |
| | | private RawAttribute attribute; |
| | | |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // Indicates whether the Directory Server is in the process of shutting down. |
| | | /** Indicates whether the Directory Server is in the process of shutting down. */ |
| | | private volatile boolean shutdownRequested; |
| | | |
| | | // The current set of selection keys. |
| | | /** The current set of selection keys. */ |
| | | private volatile SelectionKey[] keys = new SelectionKey[0]; |
| | | |
| | | // The queue that will be used to hold the set of pending connections that |
| | | // need to be registered with the selector. |
| | | // TODO: revisit, see Issue 4202. |
| | | /** |
| | | * The queue that will be used to hold the set of pending connections that |
| | | * need to be registered with the selector. |
| | | * TODO: revisit, see Issue 4202. |
| | | */ |
| | | private List<LDAPClientConnection> pendingConnections = |
| | | new LinkedList<LDAPClientConnection>(); |
| | | |
| | | // Lock object for synchronizing access to the pending connections queue. |
| | | /** Lock object for synchronizing access to the pending connections queue. */ |
| | | private final Object pendingConnectionsLock = new Object(); |
| | | |
| | | // The list of connections ready for request processing. |
| | | /** The list of connections ready for request processing. */ |
| | | private LinkedList<LDAPClientConnection> readyConnections = |
| | | new LinkedList<LDAPClientConnection>(); |
| | | |
| | | // The selector that will be used to monitor the client connections. |
| | | /** The selector that will be used to monitor the client connections. */ |
| | | private final Selector selector; |
| | | |
| | | // The name to use for this request handler. |
| | | /** The name to use for this request handler. */ |
| | | private final String handlerName; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012-2014 ForgeRock AS |
| | | * |
| | | * Portions Copyright 2012-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | | |
| | | |
| | | import static org.opends.messages.ProtocolMessages.*; |
| | | import static org.opends.server.protocols.ldap.LDAPConstants.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.types.*; |
| | | |
| | | |
| | | /** |
| | | * This class defines a data structure that will be used to keep track |
| | | * of various metrics related to LDAP communication that the server has |
| | |
| | | private AtomicLong unbindRequests = new AtomicLong(0); |
| | | |
| | | |
| | | // The instance name for this monitor provider instance. |
| | | /** The instance name for this monitor provider instance. */ |
| | | private final String instanceName; |
| | | |
| | | // Monitor Objects : for Operations (count and time) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeMonitorProvider(MonitorProviderCfg configuration) |
| | | throws ConfigException |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ObjectClass getMonitorObjectClass() |
| | | { |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The current entry DN for this modify DN request. |
| | | /** The current entry DN for this modify DN request. */ |
| | | private ByteString entryDN; |
| | | |
| | | // The new RDN for this modify DN request. |
| | | /** The new RDN for this modify DN request. */ |
| | | private ByteString newRDN; |
| | | |
| | | // The new superior DN for this modify DN request. |
| | | /** The new superior DN for this modify DN request. */ |
| | | private ByteString newSuperior; |
| | | |
| | | // Indicates whether to delete the current RDN value(s). |
| | | /** Indicates whether to delete the current RDN value(s). */ |
| | | private boolean deleteOldRDN; |
| | | |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The matched DN for this response. |
| | | /** The matched DN for this response. */ |
| | | private DN matchedDN; |
| | | |
| | | // The result code for this response. |
| | | /** The result code for this response. */ |
| | | private int resultCode; |
| | | |
| | | // The set of referral URLs for this response. |
| | | /** The set of referral URLs for this response. */ |
| | | private List<String> referralURLs; |
| | | |
| | | // The error message for this response. |
| | | /** The error message for this response. */ |
| | | private LocalizableMessage errorMessage; |
| | | |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The matched DN for this response. |
| | | /** The matched DN for this response. */ |
| | | private DN matchedDN; |
| | | |
| | | // The result code for this response. |
| | | /** The result code for this response. */ |
| | | private int resultCode; |
| | | |
| | | // The set of referral URLs for this response. |
| | | /** The set of referral URLs for this response. */ |
| | | private List<String> referralURLs; |
| | | |
| | | // The error message for this response. |
| | | /** The error message for this response. */ |
| | | private LocalizableMessage errorMessage; |
| | | |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The matched DN for this response. |
| | | /** The matched DN for this response. */ |
| | | private DN matchedDN; |
| | | |
| | | // The result code for this response. |
| | | /** The result code for this response. */ |
| | | private int resultCode; |
| | | |
| | | // The set of referral URLs for this response. |
| | | /** The set of referral URLs for this response. */ |
| | | private List<String> referralURLs; |
| | | |
| | | // The error message for this response. |
| | | /** The error message for this response. */ |
| | | private LocalizableMessage errorMessage; |
| | | |
| | | |
| | |
| | | public class SearchResultEntryProtocolOp |
| | | extends ProtocolOp |
| | | { |
| | | // The set of attributes for this search entry. |
| | | /** The set of attributes for this search entry. */ |
| | | private LinkedList<LDAPAttribute> attributes; |
| | | |
| | | // The DN for this search entry. |
| | | /** The DN for this search entry. */ |
| | | private final DN dn; |
| | | |
| | | // The underlying search result entry. |
| | | /** The underlying search result entry. */ |
| | | private SearchResultEntry entry; |
| | | |
| | | // The LDAP version (determines how attribute options are handled). |
| | | /** The LDAP version (determines how attribute options are handled). */ |
| | | private final int ldapVersion; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // Generic constructor. |
| | | /** Generic constructor. */ |
| | | private SearchResultEntryProtocolOp(DN dn, |
| | | LinkedList<LDAPAttribute> attributes, SearchResultEntry searchEntry, |
| | | int ldapVersion) |
| | |
| | | |
| | | |
| | | |
| | | // Write an attribute without converting to an LDAPAttribute. |
| | | /** Write an attribute without converting to an LDAPAttribute. */ |
| | | private void writeAttribute(ASN1Writer stream, Attribute a) |
| | | throws IOException |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | // The set of referral URLs for this search result reference. |
| | | /** The set of referral URLs for this search result reference. */ |
| | | private List<String> referralURLs; |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.common; |
| | | |
| | |
| | | */ |
| | | public enum AssuredMode |
| | | { |
| | | /** |
| | | * Safe read assured mode. |
| | | */ |
| | | /** Safe read assured mode. */ |
| | | SAFE_READ_MODE((byte) 1), |
| | | /** |
| | | * Safe data assured mode. |
| | | */ |
| | | /** Safe data assured mode. */ |
| | | SAFE_DATA_MODE((byte) 2); |
| | | |
| | | // The mode value |
| | | /** The mode value. */ |
| | | private byte value = -1; |
| | | |
| | | private AssuredMode(byte value) |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.common; |
| | | |
| | |
| | | return serverId; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean equals(Object obj) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int hashCode() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.common; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * return a Set of String usable as a textual representation of |
| | | * Return a Set of String usable as a textual representation of |
| | | * a Server state. |
| | | * format : time seqnum id |
| | | * |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.common; |
| | | |
| | |
| | | */ |
| | | BAD_GEN_ID_STATUS((byte) 4); |
| | | |
| | | // The status value |
| | | /** The status value. */ |
| | | private byte value = -1; |
| | | |
| | | private ServerStatus(byte value) |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.common; |
| | | |
| | |
| | | * Event used when one wants the DS to enter the BAD_GEN_ID_STATUS. |
| | | */ |
| | | TO_BAD_GEN_ID_STATUS_EVENT((byte) 4); |
| | | // The status value |
| | | /** The status value. */ |
| | | private byte value = -1; |
| | | |
| | | private StatusMachineEvent(byte value) |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | return valuesHist; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean replayOperation(Iterator<Modification> modsIterator, CSN csn, |
| | | Entry modifiedEntry, Modification m) |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void assign(HistAttrModificationKey histKey, ByteString value, CSN csn) |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | /** Last added value. */ |
| | | private ByteString value; |
| | | |
| | | /** |
| | | * last operation applied. This is only used for multiple mods on the same |
| | | * single valued attribute in the same modification. |
| | | */ |
| | | /** |
| | | * Last operation applied. This is only used for multiple mods on the same |
| | | * single valued attribute in the same modification. |
| | | */ |
| | | private HistAttrModificationKey lastMod; |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public CSN getDeleteTime() |
| | | { |
| | | return this.deleteTime; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Map<AttrValueHistorical,AttrValueHistorical> getValuesHistorical() |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processLocalOrNonConflictModification(CSN csn, Modification mod) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean replayOperation(Iterator<Modification> modsIterator, CSN csn, |
| | | Entry modifiedEntry, Modification mod) |
| | |
| | | return conflict; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void assign(HistAttrModificationKey histKey, ByteString value, CSN csn) |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | */ |
| | | public class AttrHistoricalWithOptions |
| | | { |
| | | private HashMap<Set<String> ,AttrHistorical> attributesInfo; |
| | | private HashMap<Set<String>, AttrHistorical> attributesInfo; |
| | | |
| | | /** |
| | | * creates a new AttrInfoWithOptions. |
| | | */ |
| | | /** Creates a new AttrInfoWithOptions. */ |
| | | public AttrHistoricalWithOptions() |
| | | { |
| | | attributesInfo = new HashMap<Set<String> ,AttrHistorical>(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * get the Attributes information associated to this object. |
| | | * Get the Attributes information associated to this object. |
| | | * @return the set of informations |
| | | */ |
| | | public HashMap<Set<String>, AttrHistorical> getAttributesInfo() |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * calculates the hasCode for this object. |
| | | * Calculates the hasCode for this object. |
| | | * Only value is used when calculating the hashCode |
| | | * @return the hashcode |
| | | */ |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012-2014 ForgeRock AS |
| | | * Portions Copyright 2012-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | this.entry = entry; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public AddMsg generateMessage() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Portions copyright 2012-2013 ForgeRock AS |
| | | * Portions copyright 2012-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ReplicationMsg generateMessage() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012-2014 ForgeRock AS |
| | | * Portions Copyright 2012-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | this.entry = entry; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ReplicationMsg generateMessage() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions copyright 2012-2013 ForgeRock AS |
| | | * Portions copyright 2012-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | mods.add(mod); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ReplicationMsg generateMessage() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions copyright 2013 ForgeRock AS |
| | | * Portions copyright 2013-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | */ |
| | | public class FakeOperationComparator implements Comparator<FakeOperation> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int compare(FakeOperation op1, FakeOperation op2) |
| | | { |
| | |
| | | */ |
| | | public class GenerationIdChecksum implements Checksum |
| | | { |
| | | // Checksum to be returned. |
| | | /** Checksum to be returned. */ |
| | | private long checksum; |
| | | |
| | | /** |
| | | * This is the generation id for an empty backend. |
| | | */ |
| | | /** This is the generation id for an empty backend. */ |
| | | public static final long EMPTY_BACKEND_GENERATION_ID = 48L; |
| | | |
| | | /** |
| | | * Update the checksum with one added byte. |
| | | */ |
| | | /** Update the checksum with one added byte. */ |
| | | private void updateWithOneByte(byte b) |
| | | { |
| | | /** |
| | | /* |
| | | * The "end of line" code is CRLF under windows but LF on UNIX. So to get |
| | | * the same checksum value on every platforms, we always exclude the CR and |
| | | * LF characters from the computation. |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void update(int b) |
| | | { |
| | | updateWithOneByte((byte) b); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void update(byte[] b, int off, int len) |
| | | { |
| | | for (int i = off; i < (off + len); i++) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public long getValue() |
| | | { |
| | | if (checksum != 0L) |
| | |
| | | return checksum; |
| | | } else |
| | | { |
| | | // Computing an empty backend writes the number of entries (0) only, which |
| | | // will not be added to the checksum as no entries will follow. To treat |
| | | // this special case, and to keep consistency with old versions, in that |
| | | // case we hardcode and return the generation id value for an empty |
| | | // backend. |
| | | /* |
| | | * Computing an empty backend writes the number of entries (0) only, |
| | | * will not be added to the checksum as no entries will follow. To treat |
| | | * this special case, and to keep consistency with old versions, in that |
| | | * case we hardcode and return the generation id value for an empty |
| | | * backend. |
| | | */ |
| | | return EMPTY_BACKEND_GENERATION_ID; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void reset() |
| | | { |
| | | checksum = 0L; |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | * ds-sync-hist: attrName1:changeNumber2:del:deletedValue |
| | | * ds-sync-hist: attrName3:changeNumber3:add:newAddedvalue |
| | | * ds-sync-hist: attrName3:changeNumber4:attrDel |
| | | * |
| | | */ |
| | | public enum HistAttrModificationKey |
| | | { |
| | |
| | | */ |
| | | ADD("add"); |
| | | |
| | | // The string representation of this key. |
| | | /** The string representation of this key. */ |
| | | private String key; |
| | | |
| | | /** |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.replication.plugin; |
| | | |
| | | import java.util.Collection; |
| | |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | |
| | | //Associated Matching Rule. |
| | | /** Associated Matching Rule. */ |
| | | private MatchingRule matchingRule; |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | |
| | | .addToSchema().toSchema().getMatchingRule(oid); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * find the current DN of an entry from its entry UUID. |
| | | * Find the current DN of an entry from its entry UUID. |
| | | * |
| | | * @param uuid the Entry Unique ID. |
| | | * @return The current DN of the entry or null if there is no entry with |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | public class ReplLDIFOutputStream |
| | | extends OutputStream |
| | | { |
| | | // The number of entries to be exported |
| | | /** The number of entries to be exported. */ |
| | | long numEntries; |
| | | |
| | | // The current number of entries exported |
| | | /** The current number of entries exported. */ |
| | | private long numExportedEntries; |
| | | String entryBuffer = ""; |
| | | |
| | | // The checksum for computing the generation id |
| | | /** The checksum for computing the generation id. */ |
| | | private GenerationIdChecksum checkSum = new GenerationIdChecksum(); |
| | | |
| | | /** |
| | |
| | | this.numEntries = numEntries; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void write(int i) throws IOException |
| | | { |
| | | throw new IOException("Invalid call"); |
| | |
| | | return checkSum.getValue(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void write(byte b[], int off, int len) throws IOException |
| | | { |
| | | int endOfEntryIndex; |
| | |
| | | private static final class Decoder |
| | | implements ControlDecoder<ReplicationRepairRequestControl> |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public ReplicationRepairRequestControl decode(boolean isCritical, |
| | | ByteString value) |
| | | throws DirectoryException |
| | |
| | | return new ReplicationRepairRequestControl(isCritical); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public String getOID() |
| | | { |
| | | return OID_REPLICATION_REPAIR_CONTROL; |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions copyright 2013-2014 ForgeRock AS. |
| | | * Portions copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.protocol; |
| | | |
| | |
| | | */ |
| | | public class ChangeStatusMsg extends ReplicationMsg |
| | | { |
| | | /** The status we want the DS to enter (used when from RS to DS) */ |
| | | /** The status we want the DS to enter (used when from RS to DS). */ |
| | | private final ServerStatus requestedStatus; |
| | | /** The new status the DS just entered (used when from DS to RS) */ |
| | | /** The new status the DS just entered (used when from DS to RS). */ |
| | | private ServerStatus newStatus; |
| | | |
| | | /** |
| | |
| | | "\nnewStatus: " + newStatus + |
| | | "\nrequestedStatus: " + requestedStatus; |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | private String initiatorsName; |
| | | |
| | | /** whether the DEL operation is a subtree DEL. */ |
| | | /** Whether the DEL operation is a subtree DEL. */ |
| | | private boolean isSubtreeDelete; |
| | | |
| | | /** |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.protocol; |
| | | |
| | |
| | | { |
| | | /** The byte array containing the bytes of the entry transported. */ |
| | | private final byte[] entryByteArray; |
| | | private int msgId = -1; // from V4 |
| | | /** From V4. */ |
| | | private int msgId = -1; |
| | | |
| | | /** |
| | | * Creates a new EntryMsg. |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.protocol; |
| | | |
| | |
| | | */ |
| | | public class ErrorMsg extends RoutableMsg |
| | | { |
| | | /** The tracer object for the debug logger */ |
| | | /** The tracer object for the debug logger. */ |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | /** Specifies the messageID built from the error that was detected. */ |
| | |
| | | this.heartbeatInterval = heartbeatInterval; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void run() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.protocol; |
| | | |
| | |
| | | private String newSuperiorEntryUUID; |
| | | |
| | | /** |
| | | * construct a new Modify DN message. |
| | | * Construct a new Modify DN message. |
| | | * |
| | | * @param operation The operation to use for building the message |
| | | */ |
| | |
| | | */ |
| | | public class NotSupportedOldVersionPDUException extends Exception |
| | | { |
| | | // Suppress compile warning |
| | | /** Suppress compile warning. */ |
| | | static final long serialVersionUID = 1739875L; |
| | | private String msg; // Explicit message |
| | | private short protocolVersion = -1; // protocol version of the pdu |
| | | private byte pduType = -1; // type of the pdu |
| | | /** Explicit message. */ |
| | | private String msg; |
| | | /** Protocol version of the pdu. */ |
| | | private short protocolVersion = -1; |
| | | /** Type of the pdu. */ |
| | | private byte pduType = -1; |
| | | |
| | | /** |
| | | * Exception constructor. |
| | |
| | | return msg; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getLocalizedMessage() |
| | | { |
| | | return getMessage(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2012-2013 ForgeRock AS |
| | | * Portions copyright 2012-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.protocol; |
| | | |
| | |
| | | */ |
| | | public abstract class OperationContext |
| | | { |
| | | /** |
| | | * The identifier used to attach the context to operations. |
| | | */ |
| | | /** The identifier used to attach the context to operations. */ |
| | | public static final String SYNCHROCONTEXT = "replicationContext"; |
| | | |
| | | /** |
| | | * The CSN of the Operation. |
| | | */ |
| | | /** The CSN of the Operation. */ |
| | | private CSN csn; |
| | | |
| | | /** |
| | |
| | | return ctx.csn; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean equals(Object obj) |
| | | { |
| | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int hashCode() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.protocol; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * get the window size for the server that created this message. |
| | | * Get the window size for the server that created this message. |
| | | * |
| | | * @return The window size for the server that created this message. |
| | | */ |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.protocol; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * get the window size for the server that created this message. |
| | | * Get the window size for the server that created this message. |
| | | * |
| | | * @return The window size for the server that created this message. |
| | | */ |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.protocol; |
| | | |
| | |
| | | */ |
| | | public class ServerStartMsg extends StartMsg |
| | | { |
| | | /** Id of the LDAP server that sent this message */ |
| | | /** Id of the LDAP server that sent this message. */ |
| | | private final int serverId; |
| | | private final String serverURL; |
| | | private final DN baseDN; |
| | |
| | | } |
| | | |
| | | /** |
| | | * get the Server URL from the message. |
| | | * Get the Server URL from the message. |
| | | * @return the server URL |
| | | */ |
| | | public String getServerURL() |
| | |
| | | * initial single threaded handshake. |
| | | */ |
| | | private short protocolVersion = ProtocolVersion.getCurrentVersion(); |
| | | private boolean isEncrypted = true; // Initially encrypted. |
| | | /** Initially encrypted. */ |
| | | private boolean isEncrypted = true; |
| | | |
| | | /** |
| | | * Use a buffered input stream to avoid too many system calls. |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.protocol; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public byte[] getBytes(short protocolVersion) |
| | | { |
| | |
| | | return attributes; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getMonitorInstanceName() |
| | | { |
| | |
| | | return status; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isDataServer() |
| | | { |
| | |
| | | refUrls, eclIncludes, eclIncludesForDeletes, getProtocolVersion()); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() |
| | | { |
| | |
| | | + replServerHandler.getMonitorInstanceName() + " " + message); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeMonitorProvider(MonitorProviderCfg configuration) |
| | | throws ConfigException,InitializationException |
| | |
| | | */ |
| | | class NotAssuredUpdateMsg extends UpdateMsg |
| | | { |
| | | /** The real update message this message represents */ |
| | | /** The real update message this message represents. */ |
| | | private final UpdateMsg realUpdateMsg; |
| | | |
| | | /** |
| | |
| | | private static final Set<Integer> localPorts = |
| | | new CopyOnWriteArraySet<Integer>(); |
| | | |
| | | // Monitors for synchronizing domain creation with the connect thread. |
| | | /** Monitors for synchronizing domain creation with the connect thread. */ |
| | | private final Object domainTicketLock = new Object(); |
| | | private final Object connectThreadLock = new Object(); |
| | | private long domainTicket; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * initialization function for the replicationServer. |
| | | */ |
| | | /** Initialization function for the replicationServer. */ |
| | | private void initialize() |
| | | { |
| | | shutdown.set(false); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | |
| | |
| | | */ |
| | | public class ReplicationServerConnectThread extends DirectoryThread |
| | | { |
| | | /** |
| | | * The Replication Server that created this thread. |
| | | */ |
| | | /** The Replication Server that created this thread. */ |
| | | private final ReplicationServer server; |
| | | |
| | | /** |
| | |
| | | this.server = server; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void run() |
| | | { |
| | |
| | | return domainDB.getDomainNewestCSNs(baseDN); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeMonitorProvider(MonitorProviderCfg configuraiton) |
| | | { |
| | | // Nothing to do for now |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getMonitorInstanceName() |
| | | { |
| | |
| | | + ",cn=Replication"; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public List<Attribute> getMonitorData() |
| | | { |
| | |
| | | /** Properties filled only if remote server is a RS. */ |
| | | private String serverAddressURL; |
| | | /** |
| | | * this collection will contain as many elements as there are |
| | | * This collection will contain as many elements as there are |
| | | * LDAP servers connected to the remote replication server. |
| | | */ |
| | | private final Map<Integer, LightweightServerHandler> remoteDirectoryServers = |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isDataServer() |
| | | { |
| | |
| | | return remoteDirectoryServers.keySet(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getMonitorInstanceName() |
| | | { |
| | |
| | | return attributes; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | |
| | |
| | | this.server = server; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void run() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | * Portions Copyright 2013-2015 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.server.replication.server; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | this.safeDataLevel = safeDataLevel; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean processReceivedAck(ServerHandler ackingServer, AckMsg ackMsg) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public AckMsg createAck(boolean timeout) |
| | | { |
| | |
| | | return hasReplayError; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean processReceivedAck(ServerHandler ackingServer, AckMsg ackMsg) |
| | | { |
| | |
| | | return (numKnownAckStatus == expectedServersAckStatus.size()); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public AckMsg createAck(boolean timeout) |
| | | { |
| | |
| | | */ |
| | | private ServerReader reader; |
| | | |
| | | // window |
| | | /** Window. */ |
| | | private int rcvWindow; |
| | | private final int rcvWindowSizeHalf; |
| | | |
| | | /** |
| | | * The size of the receiving window. |
| | | */ |
| | | /** The size of the receiving window. */ |
| | | protected final int maxRcvWindow; |
| | | /** |
| | | * Semaphore that the writer uses to control the flow to the remote server. |
| | | */ |
| | | /** Semaphore that the writer uses to control the flow to the remote server. */ |
| | | private Semaphore sendWindow; |
| | | /** |
| | | * The initial size of the sending window. |
| | | */ |
| | | /** The initial size of the sending window. */ |
| | | private int sendWindowSize; |
| | | /** |
| | | * remote generation id. |
| | | */ |
| | | /** Remote generation id. */ |
| | | protected long generationId = -1; |
| | | /** |
| | | * The generation id of the hosting RS. |
| | | */ |
| | | /** The generation id of the hosting RS. */ |
| | | protected long localGenerationId = -1; |
| | | /** |
| | | * The generation id before processing a new start handshake. |
| | | */ |
| | | /** The generation id before processing a new start handshake. */ |
| | | protected long oldGenerationId = -1; |
| | | /** |
| | | * Group id of this remote server. |
| | | */ |
| | | /** Group id of this remote server. */ |
| | | protected byte groupId = -1; |
| | | /** |
| | | * The SSL encryption after the negotiation with the peer. |
| | | */ |
| | | /** The SSL encryption after the negotiation with the peer. */ |
| | | protected boolean sslEncryption; |
| | | /** |
| | | * The time in milliseconds between heartbeats from the replication |
| | |
| | | */ |
| | | protected long heartbeatInterval; |
| | | |
| | | /** |
| | | * The thread that will send heartbeats. |
| | | */ |
| | | /** The thread that will send heartbeats. */ |
| | | private HeartbeatThread heartbeatThread; |
| | | |
| | | /** |
| | | * Set when ServerWriter is stopping. |
| | | */ |
| | | /** Set when ServerWriter is stopping. */ |
| | | private volatile boolean shutdownWriter; |
| | | |
| | | /** |
| | | * Weight of this remote server. |
| | | */ |
| | | /** Weight of this remote server. */ |
| | | protected int weight = 1; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * get the Server Id. |
| | | * Get the Server Id. |
| | | * |
| | | * @return the ID of the server to which this object is linked |
| | | */ |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2013-2014 ForgeRock AS |
| | | * Copyright 2013-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server.changelog.api; |
| | | |
| | |
| | | * the exact key must be found or if any key equal or lower/higher should match. |
| | | */ |
| | | public enum KeyMatchingStrategy { |
| | | /** matches if the key or a lower key is found. */ |
| | | /** Matches if the key or a lower key is found. */ |
| | | LESS_THAN_OR_EQUAL_TO_KEY, |
| | | /** matches only if the exact key is found. */ |
| | | /** Matches only if the exact key is found. */ |
| | | EQUAL_TO_KEY, |
| | | /** matches if the key or a greater key is found. */ |
| | | /** Matches if the key or a greater key is found. */ |
| | | GREATER_THAN_OR_EQUAL_TO_KEY |
| | | } |
| | | |
| | |
| | | * key. |
| | | */ |
| | | public enum PositionStrategy { |
| | | /** start point is on the matching key. */ |
| | | /** Start point is on the matching key. */ |
| | | ON_MATCHING_KEY, |
| | | /** start point is after the matching key. */ |
| | | /** Start point is after the matching key. */ |
| | | AFTER_MATCHING_KEY |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * add one change to the underlying db. |
| | | * Add one change to the underlying db. |
| | | * |
| | | * @param change |
| | | * The change to add to the underlying db. |
| | |
| | | * @GuardedBy("stateLock") |
| | | */ |
| | | private final ChangelogState changelogState; |
| | | /** Exclusive lock to synchronize updates to in-memory and on-disk changelogState */ |
| | | /** Exclusive lock to synchronize updates to in-memory and on-disk changelogState. */ |
| | | private final Object stateLock = new Object(); |
| | | private final List<Database> allDbs = new CopyOnWriteArrayList<Database>(); |
| | | private ReplicationServer replicationServer; |
| | |
| | | this.serverId = serverId; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void run() |
| | | { |
| | | long lastHeartbeatTime = 0; |
| | | try |
| | | { |
| | | if (logger.isTraceEnabled()) |
| | |
| | | { |
| | | final CSN csn = new CSN(now, 0, serverId); |
| | | session.publish(new ChangeTimeHeartbeatMsg(csn)); |
| | | lastHeartbeatTime = csn.getTime(); |
| | | } |
| | | |
| | | long sleepTime = session.getLastPublishTime() + heartbeatInterval - now; |
| | |
| | | */ |
| | | private final long heartbeatInterval; |
| | | |
| | | // Info required for logging. |
| | | /** Info required for logging. */ |
| | | private final int serverID; |
| | | private final int replicationServerID; |
| | | private final String baseDN; |
| | | |
| | | |
| | | /** |
| | | * Thread life-cycle state. |
| | | */ |
| | | /** Thread life-cycle state. */ |
| | | private volatile boolean shutdown; |
| | | private final Object shutdownLock = new Object(); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void run() |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS. |
| | | * Portions Copyright 2014-2015 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.replication.service; |
| | | |
| | |
| | | */ |
| | | class ReplOutputStream extends OutputStream |
| | | { |
| | | /** The synchronization domain on which the export is done */ |
| | | /** The synchronization domain on which the export is done. */ |
| | | private final ReplicationDomain domain; |
| | | |
| | | /** The current number of entries exported */ |
| | | /** The current number of entries exported. */ |
| | | private final long numExportedEntries = 0; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * get the group id. |
| | | * Get the group id. |
| | | * @return The group id |
| | | */ |
| | | public byte getGroupId() |
| | |
| | | } |
| | | |
| | | /** |
| | | * restart the ReplicationBroker. |
| | | * Restart the ReplicationBroker. |
| | | * @param infiniteTry the socket which failed |
| | | */ |
| | | public void reStart(boolean infiniteTry) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * stop the server. |
| | | */ |
| | | /** Stop the server. */ |
| | | public void stop() |
| | | { |
| | | if (logger.isTraceEnabled()) |
| | |
| | | } |
| | | |
| | | /** |
| | | * get the number of updates replayed by the replication. |
| | | * Get the number of updates replayed by the replication. |
| | | * |
| | | * @return The number of updates replayed by the replication |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * get the number of updates received by the replication plugin. |
| | | * Get the number of updates received by the replication plugin. |
| | | * |
| | | * @return the number of updates received |
| | | */ |
| | |
| | | /** The backend's baseDN mapped by this object. */ |
| | | private final DN baseDN; |
| | | |
| | | /** the backend associated with the local workflow element. */ |
| | | /** The backend associated with the local workflow element. */ |
| | | private final Backend<?> backend; |
| | | |
| | | /** the set of local backend workflow elements registered with the server. */ |
| | | /** The set of local backend workflow elements registered with the server. */ |
| | | private static TreeMap<DN, LocalBackendWorkflowElement> registeredLocalBackends = |
| | | new TreeMap<DN, LocalBackendWorkflowElement>(); |
| | | |