2 * Copyright (c) 2015 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.lisp.translate.read;
20 import io.fd.honeycomb.translate.read.ReadContext;
21 import io.fd.honeycomb.translate.read.ReadFailedException;
22 import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
23 import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
24 import java.util.Collections;
25 import java.util.List;
26 import javax.annotation.Nonnull;
27 import javax.naming.OperationNotSupportedException;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.AdjacenciesBuilder;
29 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.Adjacency;
30 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.AdjacencyBuilder;
31 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev161214.adjacencies.grouping.adjacencies.AdjacencyKey;
32 import org.opendaylight.yangtools.concepts.Builder;
33 import org.opendaylight.yangtools.yang.binding.DataObject;
34 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
35 import io.fd.vpp.jvpp.core.future.FutureJVppCore;
38 public class AdjacencyCustomizer extends FutureJVppCustomizer
39 implements ListReaderCustomizer<Adjacency, AdjacencyKey, AdjacencyBuilder> {
41 public AdjacencyCustomizer(@Nonnull final FutureJVppCore futureJvpp) {
47 public List<AdjacencyKey> getAllIds(@Nonnull final InstanceIdentifier<Adjacency> id,
48 @Nonnull final ReadContext context) throws ReadFailedException {
50 //does not throw exception to not disturb lisp state reading
51 return Collections.emptyList();
55 public void merge(@Nonnull final Builder<? extends DataObject> builder, @Nonnull final List<Adjacency> readData) {
56 ((AdjacenciesBuilder) builder).setAdjacency(readData);
61 public AdjacencyBuilder getBuilder(@Nonnull final InstanceIdentifier<Adjacency> id) {
62 return new AdjacencyBuilder();
66 public void readCurrentAttributes(@Nonnull final InstanceIdentifier<Adjacency> id,
67 @Nonnull final AdjacencyBuilder builder, @Nonnull final ReadContext ctx)
68 throws ReadFailedException {
69 // TODO - finish after https://jira.fd.io/browse/VPP-362
70 throw new ReadFailedException(id, new OperationNotSupportedException("Operation not supported"));