HONEYCOMB-154: update revison of models that changed since 16.09
[honeycomb.git] / lisp / lisp2vpp / src / main / java / io / fd / honeycomb / lisp / translate / read / AdjacencyCustomizer.java
1 /*
2  * Copyright (c) 2015 Cisco and/or its affiliates.
3  *
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:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 package io.fd.honeycomb.lisp.translate.read;
18
19
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;
36
37
38 public class AdjacencyCustomizer extends FutureJVppCustomizer
39         implements ListReaderCustomizer<Adjacency, AdjacencyKey, AdjacencyBuilder> {
40
41     public AdjacencyCustomizer(@Nonnull final FutureJVppCore futureJvpp) {
42         super(futureJvpp);
43     }
44
45     @Nonnull
46     @Override
47     public List<AdjacencyKey> getAllIds(@Nonnull final InstanceIdentifier<Adjacency> id,
48                                         @Nonnull final ReadContext context) throws ReadFailedException {
49
50         //does not throw exception to not disturb lisp state reading
51         return Collections.emptyList();
52     }
53
54     @Override
55     public void merge(@Nonnull final Builder<? extends DataObject> builder, @Nonnull final List<Adjacency> readData) {
56         ((AdjacenciesBuilder) builder).setAdjacency(readData);
57     }
58
59     @Nonnull
60     @Override
61     public AdjacencyBuilder getBuilder(@Nonnull final InstanceIdentifier<Adjacency> id) {
62         return new AdjacencyBuilder();
63     }
64
65     @Override
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"));
71     }
72 }