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