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 */ 026package org.forgerock.opendj.config; 027 028/** 029 * This interface is used to determine the "best match" managed object 030 * definition in a definition hierarchy. 031 * <p> 032 * Managed object definitions, like Java classes, are arranged in an inheritance 033 * hierarchy. When managed objects are decoded (e.g. from LDAP entries), the 034 * driver implementation is provided with an 035 * "expected managed object definition". However, the actual decoded managed 036 * object is often an instance of a sub-type of this definition. For example, 037 * when decoding a connection handler managed object, the actual type can never 038 * be a connection handler because it is an abstract managed object type. 039 * Instead, the decoded managed object must be a "concrete" sub-type: an LDAP 040 * connection handler or JMX connection handler. 041 * <p> 042 * This resolution process is coordinated by the 043 * <code>resolveManagedObjectDefinition</code> method in managed object 044 * definitions, where it is passed a <code>DefinitionResolver</code> 045 * implementation. The <code>resolveManagedObjectDefinition</code> method takes 046 * care of recursively descending through the definition hierarchy and invokes 047 * the {@link #matches(AbstractManagedObjectDefinition)} method against each 048 * potential sub-type. It is the job of the resolver to indicate whether the 049 * provided managed object definition is a candidate definition. For example, 050 * the LDAP driver provides a definition resolver which uses the decoded LDAP 051 * entry's object classes to determine the final appropriate managed object 052 * definition. 053 */ 054public interface DefinitionResolver { 055 056 /** 057 * Determines whether or not the provided managed object definition matches 058 * this resolver's criteria. 059 * 060 * @param d 061 * The managed object definition. 062 * @return Returns <code>true</code> if the the provided managed object 063 * definition matches this resolver's criteria. 064 */ 065 boolean matches(AbstractManagedObjectDefinition<?, ?> d); 066}