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.delegates;
10 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId;
11 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.network.element.Ltp;
12 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.ltp.path.rev170526.ltp.path.ltp.path.list.LogicalTerminationPointList;
13 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.ltp.path.rev170526.ltp.path.ltp.path.list.LogicalTerminationPointListBuilder;
14 import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.ltp.path.rev170526.ltp.path.ltp.path.list.LogicalTerminationPointListKey;
17 * Created by odl on 17-5-30.
19 public class LtpInOdlCreator
21 public LtpInOdlCreator()
25 private int index = 0;
27 public LogicalTerminationPointList create(String neName, String clientLtpName, Ltp serverLtp)
29 LogicalTerminationPointListBuilder builder = new LogicalTerminationPointListBuilder();
30 builder.setPhysicalPortReference(
31 serverLtp.getPhysicalPortReference() == null ? null : serverLtp.getPhysicalPortReference().get(0));
32 builder.setNodeReference(new UniversalId(neName));
33 builder.setLtpIndex(String.valueOf(index++));
34 builder.setKey(new LogicalTerminationPointListKey(builder.getLtpIndex()));
35 builder.setLtpReference(new UniversalId(clientLtpName));
36 return builder.build();