SingletonRelationDefinition.java revision bb8874d71cdd8e5288297b9727703437c6dfcfed
0N/A/*
0N/A * CDDL HEADER START
0N/A *
0N/A * The contents of this file are subject to the terms of the
0N/A * Common Development and Distribution License, Version 1.0 only
0N/A * (the "License"). You may not use this file except in compliance
0N/A * with the License.
0N/A *
0N/A * You can obtain a copy of the license at
0N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE
0N/A * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
0N/A * See the License for the specific language governing permissions
0N/A * and limitations under the License.
0N/A *
0N/A * When distributing Covered Code, include this CDDL HEADER in each
0N/A * file and include the License file at
0N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
0N/A * add the following below this CDDL HEADER, with the fields enclosed
0N/A * by brackets "[]" replaced with your own identifying information:
0N/A * Portions Copyright [yyyy] [name of copyright owner]
0N/A *
0N/A * CDDL HEADER END
0N/A *
0N/A *
0N/A * Portions Copyright 2007 Sun Microsystems, Inc.
0N/A */
0N/A
0N/Apackage org.opends.server.admin;
0N/A
0N/A
0N/A
0N/A/**
0N/A * A managed object composite relationship definition which represents
0N/A * a compososition of a single managed object (i.e. the managed object
0N/A * must be present).
0N/A *
0N/A * @param <C>
0N/A * The type of client managed object configuration that this
0N/A * relation definition refers to.
0N/A * @param <S>
0N/A * The type of server managed object configuration that this
0N/A * relation definition refers to.
0N/A */
0N/Apublic final class SingletonRelationDefinition
0N/A <C extends ConfigurationClient, S extends Configuration>
0N/A extends RelationDefinition<C, S> {
0N/A
0N/A /**
0N/A * Create a new singleton managed object relation definition.
0N/A *
0N/A * @param pd
0N/A * The parent managed object definition.
0N/A * @param name
0N/A * The name of the relation.
0N/A * @param cd
0N/A * The child managed object definition.
0N/A */
0N/A public SingletonRelationDefinition(AbstractManagedObjectDefinition<?, ?> pd,
0N/A String name, AbstractManagedObjectDefinition<C, S> cd) {
0N/A super(pd, name, cd);
0N/A }
113N/A
0N/A
0N/A
0N/A /**
0N/A * {@inheritDoc}
0N/A */
0N/A @Override
0N/A public final void toString(StringBuilder builder) {
0N/A builder.append("name=");
0N/A builder.append(getName());
0N/A builder.append(" type=composition parent=");
0N/A builder.append(getParentDefinition().getName());
0N/A builder.append(" child=");
0N/A builder.append(getChildDefinition().getName());
0N/A builder.append(" minOccurs=1 maxOccurs=1");
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * {@inheritDoc}
0N/A */
0N/A @Override
0N/A public <R, P> R accept(RelationDefinitionVisitor<R, P> v, P p) {
0N/A return v.visitSingleton(this, p);
0N/A }
0N/A
0N/A}
0N/A