2 * Copyright (c) 2016 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package io.fd.honeycomb.translate;
19 import org.opendaylight.yangtools.yang.binding.DataObject;
20 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
22 import javax.annotation.Nonnull;
23 import java.util.Collection;
27 * Registry builder where {@link SubtreeManager}s can be added with or without relationships between them.
28 * The relationships express what the order of execution should be.
30 public interface ModifiableSubtreeManagerRegistryBuilder<S extends SubtreeManager<? extends DataObject>> {
33 * Add a handler responsible for writing only a single complex node.
35 ModifiableSubtreeManagerRegistryBuilder<S> add(@Nonnull S handler);
38 * Add a handler responsible for writing multiple complex nodes within a subtree its responsible for. Identifiers for
39 * subtree nodes handled by a single handler have to be relative from {@link DataObject} that represents subtree
42 ModifiableSubtreeManagerRegistryBuilder<S> subtreeAdd(@Nonnull Set<InstanceIdentifier<?>> handledChildren,
46 * Add a handler responsible for writing all complex nodes within a subtree its responsible for.
48 ModifiableSubtreeManagerRegistryBuilder<S> wildcardedSubtreeAdd(@Nonnull S handler);
51 * Add a handler and make sure it will be executed before handler identifier by relatedType is executed.
53 ModifiableSubtreeManagerRegistryBuilder<S> addBefore(@Nonnull S handler,
54 @Nonnull InstanceIdentifier<?> relatedType);
56 ModifiableSubtreeManagerRegistryBuilder<S> addBefore(@Nonnull S handler,
57 @Nonnull Collection<InstanceIdentifier<?>> relatedTypes);
59 ModifiableSubtreeManagerRegistryBuilder<S> wildcardedSubtreeAddBefore(@Nonnull S handler,
60 @Nonnull InstanceIdentifier<?> relatedType);
62 ModifiableSubtreeManagerRegistryBuilder<S> wildcardedSubtreeAddBefore(@Nonnull S handler,
63 @Nonnull Collection<InstanceIdentifier<?>> relatedTypes);
65 ModifiableSubtreeManagerRegistryBuilder<S> subtreeAddBefore(@Nonnull Set<InstanceIdentifier<?>> handledChildren,
67 @Nonnull InstanceIdentifier<?> relatedType);
69 ModifiableSubtreeManagerRegistryBuilder<S> subtreeAddBefore(@Nonnull Set<InstanceIdentifier<?>> handledChildren,
71 @Nonnull Collection<InstanceIdentifier<?>> relatedTypes);
74 * Add a handler and make sure it will be executed after handler identifier by relatedType is executed.
76 ModifiableSubtreeManagerRegistryBuilder<S> addAfter(@Nonnull S handler,
77 @Nonnull InstanceIdentifier<?> relatedType);
79 ModifiableSubtreeManagerRegistryBuilder<S> addAfter(@Nonnull S handler,
80 @Nonnull Collection<InstanceIdentifier<?>> relatedTypes);
82 ModifiableSubtreeManagerRegistryBuilder<S> wildcardedSubtreeAddAfter(@Nonnull S handler,
83 @Nonnull InstanceIdentifier<?> relatedType);
85 ModifiableSubtreeManagerRegistryBuilder<S> wildcardedSubtreeAddAfter(@Nonnull S handler,
86 @Nonnull Collection<InstanceIdentifier<?>> relatedTypes);
88 ModifiableSubtreeManagerRegistryBuilder<S> subtreeAddAfter(@Nonnull Set<InstanceIdentifier<?>> handledChildren,
90 @Nonnull InstanceIdentifier<?> relatedType);
92 ModifiableSubtreeManagerRegistryBuilder<S> subtreeAddAfter(@Nonnull Set<InstanceIdentifier<?>> handledChildren,
94 @Nonnull Collection<InstanceIdentifier<?>> relatedTypes);