package org.opendaylight.transportpce.networkmodel.listeners;
-import org.opendaylight.transportpce.networkmodel.service.NetworkModelWavelengthService;
+import org.opendaylight.transportpce.networkmodel.service.FrequenciesService;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.servicehandler.rev201125.ServiceRpcResultSh;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.servicehandler.rev201125.TransportpceServicehandlerListener;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev190531.ServiceNotificationTypes;
public class ServiceHandlerListener implements TransportpceServicehandlerListener {
private static final Logger LOG = LoggerFactory.getLogger(ServiceHandlerListener.class);
- private final NetworkModelWavelengthService service;
+ private final FrequenciesService service;
- public ServiceHandlerListener(NetworkModelWavelengthService service) {
+ public ServiceHandlerListener(FrequenciesService service) {
LOG.info("Init service handler listener for network");
this.service = service;
}
private void onServiceCreation(ServiceRpcResultSh notification) {
if (notification.getAToZDirection() != null || notification.getZToADirection() != null) {
LOG.info("Update topology with used frequency by service {}", notification.getServiceName());
- service.useWavelengths(notification.getAToZDirection(), notification.getZToADirection());
+ service.allocateFrequencies(notification.getAToZDirection(), notification.getZToADirection());
}
}
if (notification.getAToZDirection() != null || notification.getZToADirection() != null) {
LOG.info("Update topology with no more used frequency by deleted service {}",
notification.getServiceName());
- service.freeWavelengths(notification.getAToZDirection(), notification.getZToADirection());
+ service.releaseFrequencies(notification.getAToZDirection(), notification.getZToADirection());
}
}