001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2008 Sun Microsystems, Inc.
015 */
016package org.forgerock.opendj.config;
017
018/**
019 * A visitor of default behavior providers, in the style of the visitor design
020 * pattern. Classes implementing this interface can query default behavior
021 * providers in a type-safe manner when the kind of default behavior provider is
022 * unknown at compile time. When a visitor is passed to a default behavior
023 * provider's accept method, the corresponding visit method most applicable to
024 * that default behavior provider is invoked.
025 *
026 * @param <T>
027 *            The type of values represented by the default value provider.
028 * @param <R>
029 *            The return type of this visitor's methods. Use
030 *            {@link java.lang.Void} for visitors that do not need to return
031 *            results.
032 * @param <P>
033 *            The type of the additional parameter to this visitor's methods.
034 *            Use {@link java.lang.Void} for visitors that do not need an
035 *            additional parameter.
036 */
037public interface DefaultBehaviorProviderVisitor<T, R, P> {
038
039    /**
040     * Visit an absolute inherited default behavior provider.
041     *
042     * @param d
043     *            The absolute inherited default behavior provider to visit.
044     * @param p
045     *            A visitor specified parameter.
046     * @return Returns a visitor specified result.
047     */
048    R visitAbsoluteInherited(AbsoluteInheritedDefaultBehaviorProvider<T> d, P p);
049
050    /**
051     * Visit an alias default behavior provider.
052     *
053     * @param d
054     *            The alias default behavior provider to visit.
055     * @param p
056     *            A visitor specified parameter.
057     * @return Returns a visitor specified result.
058     */
059    R visitAlias(AliasDefaultBehaviorProvider<T> d, P p);
060
061    /**
062     * Visit an defined default behavior provider.
063     *
064     * @param d
065     *            The defined default behavior provider to visit.
066     * @param p
067     *            A visitor specified parameter.
068     * @return Returns a visitor specified result.
069     */
070    R visitDefined(DefinedDefaultBehaviorProvider<T> d, P p);
071
072    /**
073     * Visit a relative inherited default behavior provider.
074     *
075     * @param d
076     *            The relative inherited default behavior provider to visit.
077     * @param p
078     *            A visitor specified parameter.
079     * @return Returns a visitor specified result.
080     */
081    R visitRelativeInherited(RelativeInheritedDefaultBehaviorProvider<T> d, P p);
082
083    /**
084     * Visit an undefined default behavior provider.
085     *
086     * @param d
087     *            The undefined default behavior provider to visit.
088     * @param p
089     *            A visitor specified parameter.
090     * @return Returns a visitor specified result.
091     */
092    R visitUndefined(UndefinedDefaultBehaviorProvider<T> d, P p);
093
094}