2 * Copyright © 2015 ZTE and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package com.highstreet.technologies.odl.app.impl;
10 import com.highstreet.technologies.odl.app.impl.delegates.LtpInOdlCreator;
11 import com.highstreet.technologies.odl.app.impl.delegates.PathDelegate;
12 import com.highstreet.technologies.odl.app.impl.tools.NeExecutor;
13 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
14 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
16 import java.util.ArrayList;
19 * Created by odl on 17-6-2.
21 public class PathHolder
23 public PathHolder(DataBroker dataBroker, Integer vlanId)
25 this.pathDelegate = new PathDelegate(dataBroker, vlanId);
28 private final PathDelegate pathDelegate;
29 private ArrayList<NeExecutor> list = new ArrayList<>();
30 private LtpInOdlCreator ltpCreator = new LtpInOdlCreator();
32 public void add(NeExecutor to)
35 pathDelegate.add(to.getLtp());
38 public void commit() throws TransactionCommitFailedException
40 list.forEach(NeExecutor::commit);
41 pathDelegate.commit();
44 public void clear(int vlanId) throws TransactionCommitFailedException
46 list.forEach(neExecutor -> neExecutor.clear(vlanId));
50 public LtpInOdlCreator getLtpCreator()