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-2009 Sun Microsystems, Inc.
015 */
016package org.opends.server.admin;
017
018
019
020/**
021 * A strategy for serializing managed object paths.
022 * <p>
023 * This interface provides a generic means for serializing managed
024 * object paths into application specific forms. For example, a JNDI
025 * client would use this interface to construct <code>LdapName</code>
026 * objects from a path. Similarly, on the server side, a serialization
027 * strategy is used to construct <code>DN</code> instances from a
028 * path.
029 * <p>
030 * During serialization the serializer is invoked for each element in
031 * the managed object path in big-endian order, starting from the root
032 * and proceeding down to the leaf element.
033 */
034public interface ManagedObjectPathSerializer {
035
036  /**
037   * Append a managed object path element identified by an
038   * instantiable relation and an instance name.
039   *
040   * @param <C>
041   *          The type of client managed object configuration that
042   *          this path element references.
043   * @param <S>
044   *          The type of server managed object configuration that
045   *          this path element references.
046   * @param r
047   *          The instantiable relation.
048   * @param d
049   *          The managed object definition.
050   * @param name
051   *          The instance name.
052   */
053  <C extends ConfigurationClient, S extends Configuration>
054      void appendManagedObjectPathElement(
055      InstantiableRelationDefinition<? super C, ? super S> r,
056      AbstractManagedObjectDefinition<C, S> d, String name);
057
058
059
060  /**
061   * Append a managed object path element identified by an optional
062   * relation.
063   *
064   * @param <C>
065   *          The type of client managed object configuration that
066   *          this path element references.
067   * @param <S>
068   *          The type of server managed object configuration that
069   *          this path element references.
070   * @param r
071   *          The optional relation.
072   * @param d
073   *          The managed object definition.
074   */
075  <C extends ConfigurationClient, S extends Configuration>
076      void appendManagedObjectPathElement(
077      OptionalRelationDefinition<? super C, ? super S> r,
078      AbstractManagedObjectDefinition<C, S> d);
079
080
081
082  /**
083   * Append a managed object path element identified by a singleton
084   * relation.
085   *
086   * @param <C>
087   *          The type of client managed object configuration that
088   *          this path element references.
089   * @param <S>
090   *          The type of server managed object configuration that
091   *          this path element references.
092   * @param r
093   *          The singleton relation.
094   * @param d
095   *          The managed object definition.
096   */
097  <C extends ConfigurationClient, S extends Configuration>
098      void appendManagedObjectPathElement(
099      SingletonRelationDefinition<? super C, ? super S> r,
100      AbstractManagedObjectDefinition<C, S> d);
101
102
103
104  /**
105   * Append a managed object path element identified by a
106   * set relation.
107   *
108   * @param <C>
109   *          The type of client managed object configuration that
110   *          this path element references.
111   * @param <S>
112   *          The type of server managed object configuration that
113   *          this path element references.
114   * @param r
115   *          The set relation.
116   * @param d
117   *          The managed object definition.
118   */
119  <C extends ConfigurationClient, S extends Configuration>
120      void appendManagedObjectPathElement(
121      SetRelationDefinition<? super C, ? super S> r,
122      AbstractManagedObjectDefinition<C, S> d);
123
124}