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.initializers;
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;
28 * Initializes vpp-classfier node in config data tree based on operational state.
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);
35 public VppClasifierInitializer(@Nonnull final DataBroker bindingDataBroker) {
36 super(bindingDataBroker, OPER_ID, CFG_ID);
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();