| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin; |
| | | |
| | |
| | | */ |
| | | private class ClientHandler extends ClientConstraintHandler { |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private ClientHandler() { |
| | | // No implementation required. |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isAddAcceptable(ManagementContext context, |
| | | ManagedObject<?> managedObject, Collection<LocalizableMessage> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isModifyAcceptable(ManagementContext context, |
| | | ManagedObject<?> managedObject, Collection<LocalizableMessage> unacceptableReasons) |
| | |
| | | */ |
| | | private class ServerHandler extends ServerConstraintHandler { |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private ServerHandler() { |
| | | // No implementation required. |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isUsable(ServerManagedObject<?> managedObject, |
| | | Collection<LocalizableMessage> unacceptableReasons) throws ConfigException { |
| | |
| | | |
| | | }; |
| | | |
| | | // The client-side constraint handler. |
| | | /** The client-side constraint handler. */ |
| | | private final ClientConstraintHandler clientHandler = new ClientHandler(); |
| | | |
| | | // The condition associated with this constraint. |
| | | /** The condition associated with this constraint. */ |
| | | private final Condition condition; |
| | | |
| | | // The managed object definition associated with this constraint. |
| | | /** The managed object definition associated with this constraint. */ |
| | | private final AbstractManagedObjectDefinition<?, ?> definition; |
| | | |
| | | // The constraint ID. |
| | | /** The constraint ID. */ |
| | | private final int id; |
| | | |
| | | // The server-side constraint handler. |
| | | /** The server-side constraint handler. */ |
| | | private final ServerConstraintHandler serverHandler = new ServerHandler(); |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<ClientConstraintHandler> getClientConstraintHandlers() { |
| | | return Collections.singleton(clientHandler); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<ServerConstraintHandler> getServerConstraintHandlers() { |
| | | return Collections.singleton(serverHandler); |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void initialize() throws Exception { |
| | | condition.initialize(definition); |