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 */
016
017package org.opends.server.admin;
018
019
020
021/**
022 * A visitor of default behavior providers, in the style of the visitor design
023 * pattern. Classes implementing this interface can query default behavior
024 * providers in a type-safe manner when the kind of default behavior provider
025 * is unknown at compile time. When a visitor is passed to a default behavior
026 * provider's accept method, the corresponding visit method most applicable to
027 * that default behavior provider is invoked.
028 *
029 * @param <T>
030 *          The type of values represented by the default value provider.
031 * @param <R>
032 *          The return type of this visitor's methods. Use
033 *          {@link java.lang.Void} for visitors that do not need to return
034 *          results.
035 * @param <P>
036 *          The type of the additional parameter to this visitor's methods. Use
037 *          {@link java.lang.Void} for visitors that do not need an additional
038 *          parameter.
039 */
040public interface DefaultBehaviorProviderVisitor<T, R, P> {
041
042  /**
043   * Visit an absolute inherited default behavior provider.
044   *
045   * @param d
046   *          The absolute inherited default behavior provider to visit.
047   * @param p
048   *          A visitor specified parameter.
049   * @return Returns a visitor specified result.
050   */
051  R visitAbsoluteInherited(AbsoluteInheritedDefaultBehaviorProvider<T> d, P p);
052
053
054
055  /**
056   * Visit an alias default behavior provider.
057   *
058   * @param d
059   *          The alias default behavior provider to visit.
060   * @param p
061   *          A visitor specified parameter.
062   * @return Returns a visitor specified result.
063   */
064  R visitAlias(AliasDefaultBehaviorProvider<T> d, P p);
065
066
067
068  /**
069   * Visit an defined default behavior provider.
070   *
071   * @param d
072   *          The defined default behavior provider to visit.
073   * @param p
074   *          A visitor specified parameter.
075   * @return Returns a visitor specified result.
076   */
077  R visitDefined(DefinedDefaultBehaviorProvider<T> d, P p);
078
079
080
081  /**
082   * Visit a relative inherited default behavior provider.
083   *
084   * @param d
085   *          The relative inherited default behavior provider to visit.
086   * @param p
087   *          A visitor specified parameter.
088   * @return Returns a visitor specified result.
089   */
090  R visitRelativeInherited(RelativeInheritedDefaultBehaviorProvider<T> d, P p);
091
092
093
094  /**
095   * Visit an undefined default behavior provider.
096   *
097   * @param d
098   *          The undefined default behavior provider to visit.
099   * @param p
100   *          A visitor specified parameter.
101   * @return Returns a visitor specified result.
102   */
103  R visitUndefined(UndefinedDefaultBehaviorProvider<T> d, P p);
104
105}