this.openRoadmInterfaces = openRoadmInterfaces;
}
- public String createOpenRoadmEthInterface(String nodeId, String logicalConnPoint)
+ public String createOpenRoadmEthInterface(String nodeId, String logicalConnPoint,String serviceName)
throws OpenRoadmInterfaceException {
Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
ethIfBuilder.setMtu(9000L);
InterfaceBuilder ethInterfaceBldr = createGenericInterfaceBuilder(portMap, EthernetCsmacd.class,
- logicalConnPoint + "-ETHERNET");
+ logicalConnPoint + "-ETHERNET",serviceName);
// Create Interface1 type object required for adding as augmentation
Interface1Builder ethIf1Builder = new Interface1Builder();
* @return Name of the interface if successful, otherwise return null.
*/
- public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber)
+ public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber,
+ String serviceName)
throws OpenRoadmInterfaceException {
Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
}
// Create generic interface
InterfaceBuilder ochInterfaceBldr = createGenericInterfaceBuilder(portMap, OpticalChannel.class,
- createOpenRoadmOchInterfaceName(logicalConnPoint, waveNumber));
+ createOpenRoadmOchInterfaceName(logicalConnPoint, waveNumber),serviceName);
// OCH interface specific data
OchBuilder ocIfBuilder = new OchBuilder();
}
public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber, Class<
- ? extends RateIdentity> rate, OchAttributes.ModulationFormat format) throws OpenRoadmInterfaceException {
+ ? extends RateIdentity> rate, OchAttributes.ModulationFormat format,String serviceName)
+ throws OpenRoadmInterfaceException {
Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
throw new OpenRoadmInterfaceException(String.format("Unable to get mapping from PortMapping for node %s and"
.interfaces.rev161014.Interface1Builder();
// Create generic interface
InterfaceBuilder ochInterfaceBldr = createGenericInterfaceBuilder(portMap, OpticalChannel.class,
- createOpenRoadmOchInterfaceName(logicalConnPoint, waveNumber));
+ createOpenRoadmOchInterfaceName(logicalConnPoint, waveNumber),serviceName);
ochInterfaceBldr.addAugmentation(
org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.Interface1.class,
ochIf1Builder.setOch(ocIfBuilder.build()).build());
* @return Name of the interface if successful, otherwise return null.
*/
- public String createOpenRoadmOdu4Interface(String nodeId, String logicalConnPoint, String supportingOtuInterface)
+ public String createOpenRoadmOdu4Interface(String nodeId, String logicalConnPoint, String supportingOtuInterface,
+ String serviceName)
throws OpenRoadmInterfaceException {
Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
+ " logical connection port %s", nodeId, logicalConnPoint));
}
InterfaceBuilder oduInterfaceBldr = createGenericInterfaceBuilder(portMap, OtnOdu.class, logicalConnPoint
- + "-ODU");
+ + "-ODU",serviceName);
oduInterfaceBldr.setSupportingInterface(supportingOtuInterface);
// ODU interface specific data
* @throws OpenRoadmInterfaceException OpenRoadmInterfaceException
*/
- public String createOpenRoadmOtu4Interface(String nodeId, String logicalConnPoint, String supportOchInterface)
+ public String createOpenRoadmOtu4Interface(String nodeId, String logicalConnPoint, String supportOchInterface,
+ String serviceName)
throws OpenRoadmInterfaceException {
Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
if (portMap == null) {
}
// Create generic interface
InterfaceBuilder otuInterfaceBldr = createGenericInterfaceBuilder(portMap, OtnOtu.class, logicalConnPoint
- + "-OTU");
+ + "-OTU",serviceName);
otuInterfaceBldr.setSupportingInterface(supportOchInterface);
// OTU interface specific data
if (mapping.getSupportingOts() == null) {
// Create generic interface
InterfaceBuilder otsInterfaceBldr = createGenericInterfaceBuilder(mapping, OpticalTransport.class, "OTS-"
- + mapping.getLogicalConnectionPoint());
+ + mapping.getLogicalConnectionPoint(),"");
// OTS interface augmentation specific data
OtsBuilder otsIfBuilder = new OtsBuilder();
otsIfBuilder.setFiberType(FiberType.Smf);
if (mapping.getSupportingOms() == null) {
// Create generic interface
InterfaceBuilder omsInterfaceBldr = createGenericInterfaceBuilder(mapping, OpenROADMOpticalMultiplex.class,
- "OMS-" + mapping.getLogicalConnectionPoint());
+ "OMS-" + mapping.getLogicalConnectionPoint(),"");
if (mapping.getSupportingOts() != null) {
omsInterfaceBldr.setSupportingInterface(mapping.getSupportingOts());
} else {
}
private InterfaceBuilder createGenericInterfaceBuilder(Mapping portMap, Class<? extends InterfaceType> type,
- String key) {
+ String key,String serviceName) {
InterfaceBuilder interfaceBuilder = new InterfaceBuilder();
interfaceBuilder.setDescription(" TBD ");
- interfaceBuilder.setCircuitId(" TBD ");
+ interfaceBuilder.setCircuitId(serviceName);
interfaceBuilder.setSupportingCircuitPackName(portMap.getSupportingCircuitPackName());
interfaceBuilder.setSupportingPort(portMap.getSupportingPort());
interfaceBuilder.setAdministrativeState(AdminStates.InService);
private final OpenRoadmInterfaces openRoadmInterfaces;
private final CrossConnect crossConnect;
private final PortMapping portMapping;
+ private String serviceName;
public DeviceRendererServiceImpl(DataBroker dataBroker, DeviceTransactionManager deviceTransactionManager,
- OpenRoadmInterfaceFactory openRoadmInterfaceFactory, OpenRoadmInterfaces openRoadmInterfaces,
- CrossConnect crossConnect, PortMapping portMapping) {
+ OpenRoadmInterfaceFactory openRoadmInterfaceFactory,
+ OpenRoadmInterfaces openRoadmInterfaces, CrossConnect crossConnect,
+ PortMapping portMapping) {
this.dataBroker = dataBroker;
this.deviceTransactionManager = deviceTransactionManager;
this.openRoadmInterfaceFactory = openRoadmInterfaceFactory;
this.openRoadmInterfaces = openRoadmInterfaces;
this.crossConnect = crossConnect;
this.portMapping = portMapping;
+ serviceName = "Undefined";
}
@Override
public ServicePathOutput setupServicePath(ServicePathInput input, ServicePathDirection direction) {
+ this.serviceName = input.getServiceName();
List<Nodes> nodes = input.getNodes();
// Register node for suppressing alarms
if (!alarmSuppressionNodeRegistration(input)) {
crossConnectFlag++;
// create OpenRoadm Xponder Line Interfaces
String supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
- nodeId, destTp, waveNumber, R100G.class, ModulationFormat.DpQpsk);
+ nodeId, destTp, waveNumber, R100G.class, ModulationFormat.DpQpsk,serviceName);
createdOchInterfaces.add(supportingOchInterface);
String supportingOtuInterface = this.openRoadmInterfaceFactory.createOpenRoadmOtu4Interface(
- nodeId, destTp, supportingOchInterface);
+ nodeId, destTp, supportingOchInterface,serviceName);
createdOtuInterfaces.add(supportingOtuInterface);
createdOduInterfaces.add(this.openRoadmInterfaceFactory.createOpenRoadmOdu4Interface(nodeId,
- destTp, supportingOtuInterface));
+ destTp, supportingOtuInterface,serviceName));
}
if ((srcTp != null) && srcTp.contains(OpenRoadmInterfacesImpl.CLIENT_TOKEN)) {
crossConnectFlag++;
// create OpenRoadm Xponder Client Interfaces
createdEthInterfaces.add(this.openRoadmInterfaceFactory.createOpenRoadmEthInterface(nodeId,
- srcTp));
+ srcTp,serviceName));
}
if ((srcTp != null) && srcTp.contains(OpenRoadmInterfacesImpl.NETWORK_TOKEN)) {
crossConnectFlag++;
// create OpenRoadm Xponder Line Interfaces
String supportingOchInterface = this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(
- nodeId, srcTp, waveNumber, R100G.class, ModulationFormat.DpQpsk);
+ nodeId, srcTp, waveNumber, R100G.class, ModulationFormat.DpQpsk,serviceName);
createdOchInterfaces.add(supportingOchInterface);
String supportingOtuInterface = this.openRoadmInterfaceFactory.createOpenRoadmOtu4Interface(
- nodeId, srcTp, supportingOchInterface);
+ nodeId, srcTp, supportingOchInterface,serviceName);
createdOtuInterfaces.add(supportingOtuInterface);
createdOduInterfaces.add(this.openRoadmInterfaceFactory.createOpenRoadmOdu4Interface(nodeId,
- srcTp, supportingOtuInterface));
+ srcTp, supportingOtuInterface,serviceName));
}
if ((destTp != null) && destTp.contains(OpenRoadmInterfacesImpl.CLIENT_TOKEN)) {
crossConnectFlag++;
// create OpenRoadm Xponder Client Interfaces
createdEthInterfaces.add(this.openRoadmInterfaceFactory.createOpenRoadmEthInterface(nodeId,
- destTp));
+ destTp,serviceName));
}
if ((srcTp != null) && (srcTp.contains(OpenRoadmInterfacesImpl.TTP_TOKEN) || srcTp.contains(
OpenRoadmInterfacesImpl.PP_TOKEN))) {
createdOchInterfaces.add(this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(nodeId,
- srcTp, waveNumber));
+ srcTp, waveNumber,serviceName));
}
if ((destTp != null) && (destTp.contains(OpenRoadmInterfacesImpl.TTP_TOKEN) || destTp.contains(
OpenRoadmInterfacesImpl.PP_TOKEN))) {
createdOchInterfaces.add(this.openRoadmInterfaceFactory.createOpenRoadmOchInterface(nodeId,
- destTp, waveNumber));
+ destTp, waveNumber,serviceName));
}
if (crossConnectFlag < 1) {
LOG.info("Creating cross connect between source {} and destination {} for node {}", srcTp,
srcTp, destTp);
if (connectionNameOpt.isPresent()) {
nodesProvisioned.add(nodeId);
- List<Ports> ports = this.crossConnect.getConnectionPortTrail(nodeId, waveNumber, srcTp,
- destTp);
+ List<Ports> ports = this.crossConnect
+ .getConnectionPortTrail(nodeId, waveNumber, srcTp, destTp);
if (ServicePathDirection.A_TO_Z.equals(direction)) {
topology.updateAtoZTopologyList(ports, nodeId);
}
}
private ConcurrentLinkedQueue<String> processErrorMessage(String message, ForkJoinPool forkJoinPool,
- ConcurrentLinkedQueue<String> messages) {
+ ConcurrentLinkedQueue<String> messages) {
LOG.warn(message);
messages.add(message);
forkJoinPool.shutdown();
InstanceIdentifier<
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression.rev171102.service.nodelist
.Nodelist> nodeListIID = InstanceIdentifier.create(ServiceNodelist.class).child(org.opendaylight.yang
- .gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression.rev171102.service.nodelist
- .Nodelist.class, new NodelistKey(input.getServiceName()));
+ .gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression.rev171102.service.nodelist
+ .Nodelist.class, new NodelistKey(input.getServiceName()));
final WriteTransaction writeTransaction = this.dataBroker.newWriteOnlyTransaction();
writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, nodeListIID, nodeListBuilder.build());
Future<Void> submit = writeTransaction.submit();
}
}
- private boolean alarmSuppressionNodeRemoval(String serviceName) {
+ private boolean alarmSuppressionNodeRemoval(String name) {
InstanceIdentifier<
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression.rev171102.service.nodelist
.Nodelist> nodeListIID = InstanceIdentifier.create(ServiceNodelist.class).child(org.opendaylight.yang
- .gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression.rev171102.service.nodelist
- .Nodelist.class, new NodelistKey(serviceName));
+ .gen.v1.urn.opendaylight.params.xml.ns.yang.alarmsuppression.rev171102.service.nodelist
+ .Nodelist.class, new NodelistKey(name));
final WriteTransaction writeTransaction = this.dataBroker.newWriteOnlyTransaction();
writeTransaction.delete(LogicalDatastoreType.CONFIGURATION, nodeListIID);
Future<Void> submit = writeTransaction.submit();
try {
submit.get(Timeouts.DATASTORE_DELETE, TimeUnit.MILLISECONDS);
- LOG.info("Nodes are unregister for alarm suppression for service: {}", serviceName);
+ LOG.info("Nodes are unregister for alarm suppression for service: {}", name);
return true;
} catch (InterruptedException | TimeoutException | ExecutionException e) {
- LOG.warn("Failed to alarm suppresslist for service: {}", serviceName, e);
+ LOG.warn("Failed to alarm suppresslist for service: {}", name, e);
return false;
}
}
- private void setTopologyForService(String serviceName, Topology topo) throws InterruptedException,
+ private void setTopologyForService(String name, Topology topo) throws InterruptedException,
ExecutionException, TimeoutException {
ServicesBuilder servicesBuilder;
// Get the service from the service list inventory
- ServicesKey serviceKey = new ServicesKey(serviceName);
+ ServicesKey serviceKey = new ServicesKey(name);
InstanceIdentifier<Services> iid = InstanceIdentifier.create(ServiceList.class).child(Services.class,
serviceKey);
Optional<Services> services;
}
return output.setResult(result).setSuccess(success).build();
}
-}
+}
\ No newline at end of file