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.v3po.translate.v3po.interfacesstate.ip;
19 import io.fd.honeycomb.v3po.translate.read.ReadContext;
20 import io.fd.honeycomb.v3po.translate.read.ReadFailedException;
21 import io.fd.honeycomb.v3po.translate.spi.read.ChildReaderCustomizer;
22 import io.fd.honeycomb.v3po.translate.v3po.util.FutureJVppCustomizer;
23 import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext;
24 import javax.annotation.Nonnull;
25 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.Interface2Builder;
26 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.Ipv4;
27 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.Ipv4Builder;
28 import org.opendaylight.yangtools.concepts.Builder;
29 import org.opendaylight.yangtools.yang.binding.DataObject;
30 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
31 import org.openvpp.jvpp.future.FutureJVpp;
32 import org.slf4j.Logger;
33 import org.slf4j.LoggerFactory;
35 public class Ipv4Customizer extends FutureJVppCustomizer implements ChildReaderCustomizer<Ipv4, Ipv4Builder> {
37 private static final Logger LOG = LoggerFactory.getLogger(Ipv4Customizer.class);
39 //do not remove,it will be needed in future implementation
40 private final NamingContext interfaceContext;
42 public Ipv4Customizer(@Nonnull final FutureJVpp futureJvpp, final NamingContext interfaceContext) {
44 this.interfaceContext = interfaceContext;
48 public void merge(@Nonnull final Builder<? extends DataObject> parentBuilder, @Nonnull final Ipv4 readValue) {
49 ((Interface2Builder) parentBuilder).setIpv4(readValue);
54 public Ipv4Builder getBuilder(@Nonnull final InstanceIdentifier<Ipv4> id) {
55 return new Ipv4Builder();
59 public void readCurrentAttributes(@Nonnull final InstanceIdentifier<Ipv4> id, @Nonnull final Ipv4Builder builder,
60 @Nonnull final ReadContext ctx) throws ReadFailedException {
61 //TODO add reading of isForwarding flag when there is dump for it
62 LOG.warn("Operation not supported");