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