1b53e9223a24365aa1dc7d52732bb481b57c99e7
[honeycomb.git] / v3po / v3po2vpp / src / main / java / io / fd / honeycomb / translate / v3po / interfaces / EthernetCustomizer.java
1 /*
2  * Copyright (c) 2016 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.translate.v3po.interfaces;
18
19 import io.fd.honeycomb.translate.spi.write.WriterCustomizer;
20 import io.fd.honeycomb.translate.vpp.util.FutureJVppCustomizer;
21 import io.fd.honeycomb.translate.write.WriteContext;
22 import io.fd.honeycomb.translate.write.WriteFailedException;
23 import javax.annotation.Nonnull;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces._interface.Ethernet;
25 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
26 import io.fd.vpp.jvpp.core.future.FutureJVppCore;
27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory;
29
30 public class EthernetCustomizer extends FutureJVppCustomizer implements WriterCustomizer<Ethernet> {
31
32     private static final Logger LOG = LoggerFactory.getLogger(EthernetCustomizer.class);
33
34     public EthernetCustomizer(final FutureJVppCore vppApi) {
35         super(vppApi);
36     }
37
38     @Override
39     public void writeCurrentAttributes(@Nonnull final InstanceIdentifier<Ethernet> id,
40                                        @Nonnull final Ethernet dataAfter, @Nonnull final WriteContext writeContext)
41             throws WriteFailedException {
42         LOG.warn("Unsupported, ignoring configuration {}", dataAfter);
43         // VPP API does not support setting MTU
44     }
45
46     @Override
47     public void updateCurrentAttributes(@Nonnull final InstanceIdentifier<Ethernet> id,
48                                         @Nonnull final Ethernet dataBefore, @Nonnull final Ethernet dataAfter,
49                                         @Nonnull final WriteContext writeContext) {
50         LOG.warn("Unsupported, ignoring configuration {}", dataAfter);
51     }
52
53     @Override
54     public void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<Ethernet> id,
55                                         @Nonnull final Ethernet dataBefore, @Nonnull final WriteContext writeContext) {
56         LOG.warn("Unsupported, ignoring configuration delete {}", id);
57     }
58 }