/* * Copyright © 2017 AT&T and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.transportpce.olm; import com.google.common.base.Optional; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.MountPointService; import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction; import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; import org.opendaylight.transportpce.olm.spanloss.RoadmLinks; import org.opendaylight.transportpce.olm.spanloss.SpanLoss; import org.opendaylight.transportpce.renderer.mapping.PortMapping; import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev161014.CurrentPmlist; import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev161014.current.pm.Measurements; import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev161014.currentpmlist.CurrentPm; import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev161014.PmNamesEnum; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmOutput; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.GetPmOutputBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.OlmService; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupOutput; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupOutputBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.get.pm.output.MeasurementsBuilder; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.common.RpcResultBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * The Class OlmPowerSetupImpl. */ public class OlmPowerSetupImpl implements OlmService { /** The Constant LOG. */ private static final Logger LOG = LoggerFactory.getLogger(OlmPowerSetupImpl.class); /** The db. */ private final DataBroker db; /** The mps. */ private final MountPointService mps; /** * Instantiates a new olm power setup impl. * * @param db * the db * @param mps * the mps */ public OlmPowerSetupImpl(DataBroker db, MountPointService mps) { this.db = db; this.mps = mps; } /** * This method is the implementation of the 'get-pm' RESTCONF service, which * is one of the external APIs into the olm application. * *
* 1. get-pm This operation traverse through current PM list and gets PM for * given NodeId and Resource name * *
* The signature for this method was generated by yang tools from the
* renderer API model.
*
* @param input
* Input parameter from the olm yang model
*
* @return Result of the request
*/
@Override
public Future
* 1. service-power-setup: This operation performs following steps:
* Step1: Calculate Spanloss on all links which are part of service.
* TODO Step2: Calculate power levels for each Tp-Id
* TODO Step3: Post power values on roadm connections
*
*
* The signature for this method was generated by yang tools from the
* renderer API model.
*
* @param input
* Input parameter from the olm yang model
* Input will contain nodeId and termination point
*
* @return Result of the request
*/
@Override
public Future