| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | package org.forgerock.opendj.config; |
| | | |
| | |
| | | */ |
| | | public class GenericConstraint extends Constraint { |
| | | |
| | | /** |
| | | * The client-side constraint handler. |
| | | */ |
| | | /** The client-side constraint handler. */ |
| | | private final class ClientHandler extends ClientConstraintHandler { |
| | | |
| | | /** Private constructor. */ |
| | |
| | | // No implementation required. |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAddAcceptable(ManagementContext context, ManagedObject<?> managedObject, |
| | | Collection<LocalizableMessage> unacceptableReasons) throws LdapException { |
| | |
| | | } |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isModifyAcceptable(ManagementContext context, ManagedObject<?> managedObject, |
| | | Collection<LocalizableMessage> unacceptableReasons) throws LdapException { |
| | |
| | | // No implementation required. |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isUsable(ServerManagedObject<?> managedObject, |
| | | Collection<LocalizableMessage> unacceptableReasons) throws ConfigException { |
| | |
| | | this.condition = condition; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Collection<ClientConstraintHandler> getClientConstraintHandlers() { |
| | | return Collections.singleton(clientHandler); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Collection<ServerConstraintHandler> getServerConstraintHandlers() { |
| | | return Collections.singleton(serverHandler); |
| | | } |
| | |
| | | return resource.getMessage(definition, property, locale); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void initialize() throws Exception { |
| | | condition.initialize(definition); |