0881f1aee0d27bef9206ba13adaab80c38d2fa2d
[honeycomb.git] / v3po / v3po2vpp / src / main / java / io / fd / honeycomb / v3po / translate / v3po / initializers / VppClasifierInitializer.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.v3po.translate.v3po.initializers;
18
19 import io.fd.honeycomb.v3po.vpp.data.init.AbstractDataTreeConverter;
20 import javax.annotation.Nonnull;
21 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.VppClassifier;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.VppClassifierBuilder;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.vpp.classifier.rev150603.VppClassifierState;
25 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
26
27 /**
28  * Initializes vpp-classfier node in config data tree based on operational state.
29  */
30 public class VppClasifierInitializer extends AbstractDataTreeConverter<VppClassifierState, VppClassifier> {
31     private static final InstanceIdentifier<VppClassifierState> OPER_ID =
32         InstanceIdentifier.create(VppClassifierState.class);
33     private static final InstanceIdentifier<VppClassifier> CFG_ID = InstanceIdentifier.create(VppClassifier.class);
34
35     public VppClasifierInitializer(@Nonnull final DataBroker bindingDataBroker) {
36         super(bindingDataBroker, OPER_ID, CFG_ID);
37     }
38
39     @Override
40     protected VppClassifier convert(final VppClassifierState operationalData) {
41         final VppClassifierBuilder builder = new VppClassifierBuilder();
42         // TODO finish translation classify table key + mandatory fields at least must be set
43 //        builder.setClassifyTable(operationalData.getClassifyTable().stream()
44 //            .map(oper -> new ClassifyTableBuilder(oper).build())
45 //            .collect(Collectors.toList()));
46         return builder.build();
47     }
48 }