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