Ray Milkey
Committed by Gerrit Code Review

Remove deprecated Optical provider

Change-Id: Ifaa67ec9a5eb93a8b6b16fda3351db381ac47590
/*
* Copyright 2014 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.optical.cfg;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.onlab.packet.ChassisId;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.DefaultAnnotations;
import org.onosproject.net.Device;
import org.onosproject.net.DeviceId;
import org.onosproject.net.Link;
import org.onosproject.net.MastershipRole;
import org.onosproject.net.PortNumber;
import org.onosproject.net.device.DefaultDeviceDescription;
import org.onosproject.net.device.DeviceDescription;
import org.onosproject.net.device.DeviceProvider;
import org.onosproject.net.device.DeviceProviderRegistry;
import org.onosproject.net.device.DeviceProviderService;
import org.onosproject.net.link.DefaultLinkDescription;
import org.onosproject.net.link.LinkProvider;
import org.onosproject.net.link.LinkProviderRegistry;
import org.onosproject.net.link.LinkProviderService;
import org.onosproject.net.provider.AbstractProvider;
import org.onosproject.net.provider.ProviderId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static org.onosproject.net.DeviceId.deviceId;
/**
* OpticalConfigProvider emulates the SB network provider for optical switches,
* optical links and any other state that needs to be configured for correct network
* operations.
*
* @deprecated in Cardinal Release
*/
@Deprecated
@JsonIgnoreProperties(ignoreUnknown = true)
//@Component(immediate = true)
public class OpticalConfigProvider extends AbstractProvider implements DeviceProvider, LinkProvider {
protected static final Logger log = LoggerFactory
.getLogger(OpticalConfigProvider.class);
// TODO: fix hard coded file path later.
private static final String DEFAULT_CONFIG_FILE =
"config/demo-3-roadm-2-ps.json";
private String configFileName = DEFAULT_CONFIG_FILE;
// @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected LinkProviderRegistry linkProviderRegistry;
// @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected DeviceProviderRegistry deviceProviderRegistry;
private static final String OPTICAL_ANNOTATION = "optical.";
private LinkProviderService linkProviderService;
private DeviceProviderService deviceProviderService;
private static final List<Roadm> RAW_ROADMS = new ArrayList<>();
private static final List<WdmLink> RAW_WDMLINKS = new ArrayList<>();
private static final List<PktOptLink> RAW_PKTOPTLINKS = new ArrayList<>();
private static final String ROADM = "Roadm";
private static final String WDM_LINK = "wdmLink";
private static final String PKT_OPT_LINK = "pktOptLink";
protected OpticalNetworkConfig opticalNetworkConfig;
public OpticalConfigProvider() {
super(new ProviderId("optical", "org.onosproject.provider" +
".opticalConfig"));
}
// @Activate
protected void activate() {
linkProviderService = linkProviderRegistry.register(this);
deviceProviderService = deviceProviderRegistry.register(this);
log.info("Starting optical network configuration process...");
log.info("Optical config file set to {}", configFileName);
loadOpticalConfig();
parseOpticalConfig();
publishOpticalConfig();
}
// @Deactivate
protected void deactivate() {
linkProviderRegistry.unregister(this);
linkProviderService = null;
deviceProviderRegistry.unregister(this);
deviceProviderService = null;
RAW_ROADMS.clear();
RAW_WDMLINKS.clear();
RAW_PKTOPTLINKS.clear();
log.info("Stopped");
}
private void loadOpticalConfig() {
ObjectMapper mapper = new ObjectMapper();
opticalNetworkConfig = new OpticalNetworkConfig();
try {
opticalNetworkConfig = mapper.readValue(new File(configFileName), OpticalNetworkConfig.class);
} catch (JsonParseException e) {
String err = String.format("JsonParseException while loading network "
+ "config from file: %s: %s", configFileName, e.getMessage());
log.error(err, e);
} catch (JsonMappingException e) {
String err = String.format(
"JsonMappingException while loading network config "
+ "from file: %s: %s", configFileName, e.getMessage());
log.error(err, e);
} catch (IOException e) {
String err = String.format("IOException while loading network config "
+ "from file: %s %s", configFileName, e.getMessage());
log.error(err, e);
}
}
private void parseOpticalConfig() {
List<OpticalSwitchDescription> swList = opticalNetworkConfig.getOpticalSwitches();
List<OpticalLinkDescription> lkList = opticalNetworkConfig.getOpticalLinks();
for (OpticalSwitchDescription sw : swList) {
String swtype = sw.getType();
boolean allow = sw.isAllowed();
if (swtype.equals(ROADM) && allow) {
int regNum = 0;
Set<Map.Entry<String, JsonNode>> m = sw.params.entrySet();
for (Map.Entry<String, JsonNode> e : m) {
String key = e.getKey();
JsonNode j = e.getValue();
if (key.equals("numRegen")) {
regNum = j.asInt();
}
}
Roadm newRoadm = new Roadm();
newRoadm.setName(sw.name);
newRoadm.setNodeId(sw.nodeDpid);
newRoadm.setLongtitude(sw.longitude);
newRoadm.setLatitude(sw.latitude);
newRoadm.setRegenNum(regNum);
RAW_ROADMS.add(newRoadm);
log.info(newRoadm.toString());
}
}
for (OpticalLinkDescription lk : lkList) {
String lktype = lk.getType();
switch (lktype) {
case WDM_LINK:
WdmLink newWdmLink = new WdmLink();
newWdmLink.setSrcNodeId(lk.getNodeDpid1());
newWdmLink.setSnkNodeId(lk.getNodeDpid2());
newWdmLink.setAdminWeight(1000); // default weight for each WDM link.
Set<Map.Entry<String, JsonNode>> m = lk.params.entrySet();
for (Map.Entry<String, JsonNode> e : m) {
String key = e.getKey();
JsonNode j = e.getValue();
if (key.equals("nodeName1")) {
newWdmLink.setSrcNodeName(j.asText());
} else if (key.equals("nodeName2")) {
newWdmLink.setSnkNodeName(j.asText());
} else if (key.equals("port1")) {
newWdmLink.setSrcPort(j.asInt());
} else if (key.equals("port2")) {
newWdmLink.setSnkPort(j.asInt());
} else if (key.equals("distKms")) {
newWdmLink.setDistance(j.asDouble());
} else if (key.equals("numWaves")) {
newWdmLink.setWavelengthNumber(j.asInt());
} else {
log.error("error found");
// TODO add exception processing;
}
}
RAW_WDMLINKS.add(newWdmLink);
log.info(newWdmLink.toString());
break;
case PKT_OPT_LINK:
PktOptLink newPktOptLink = new PktOptLink();
newPktOptLink.setSrcNodeId(lk.getNodeDpid1());
newPktOptLink.setSnkNodeId(lk.getNodeDpid2());
newPktOptLink.setAdminWeight(10); // default weight for each packet-optical link.
Set<Map.Entry<String, JsonNode>> ptm = lk.params.entrySet();
for (Map.Entry<String, JsonNode> e : ptm) {
String key = e.getKey();
JsonNode j = e.getValue();
if (key.equals("nodeName1")) {
newPktOptLink.setSrcNodeName(j.asText());
} else if (key.equals("nodeName2")) {
newPktOptLink.setSnkNodeName(j.asText());
} else if (key.equals("port1")) {
newPktOptLink.setSrcPort(j.asInt());
} else if (key.equals("port2")) {
newPktOptLink.setSnkPort(j.asInt());
} else if (key.equals("bandWidth")) {
newPktOptLink.setBandwdith(j.asDouble());
} else {
log.error("error found");
// TODO add exception processing;
}
}
RAW_PKTOPTLINKS.add(newPktOptLink);
log.info(newPktOptLink.toString());
break;
default:
}
}
}
private void publishOpticalConfig() {
if (deviceProviderService == null || linkProviderService == null) {
return;
}
// Discover the optical ROADM objects
Iterator<Roadm> iterWdmNode = RAW_ROADMS.iterator();
while (iterWdmNode.hasNext()) {
Roadm value = iterWdmNode.next();
DeviceId did = deviceId("of:" + value.getNodeId().replace(":", ""));
ChassisId cid = new ChassisId();
DefaultAnnotations extendedAttributes = DefaultAnnotations.builder()
.set(OPTICAL_ANNOTATION + "switchType", "ROADM")
.set(OPTICAL_ANNOTATION + "switchName", value.getName())
.set(OPTICAL_ANNOTATION + "latitude", Double.toString(value.getLatitude()))
.set(OPTICAL_ANNOTATION + "longtitude", Double.toString(value.getLongtitude()))
.set(OPTICAL_ANNOTATION + "regNum", Integer.toString(value.getRegenNum()))
.build();
DeviceDescription description =
new DefaultDeviceDescription(did.uri(),
Device.Type.SWITCH,
"",
"",
"",
"",
cid,
extendedAttributes);
deviceProviderService.deviceConnected(did, description);
}
// Discover the optical WDM link objects
Iterator<WdmLink> iterWdmlink = RAW_WDMLINKS.iterator();
while (iterWdmlink.hasNext()) {
WdmLink value = iterWdmlink.next();
DeviceId srcNodeId = deviceId("of:" + value.getSrcNodeId().replace(":", ""));
DeviceId snkNodeId = deviceId("of:" + value.getSnkNodeId().replace(":", ""));
PortNumber srcPort = PortNumber.portNumber(value.getSrcPort());
PortNumber snkPort = PortNumber.portNumber(value.getSnkPort());
ConnectPoint srcPoint = new ConnectPoint(srcNodeId, srcPort);
ConnectPoint snkPoint = new ConnectPoint(snkNodeId, snkPort);
DefaultAnnotations extendedAttributes = DefaultAnnotations.builder()
.set(OPTICAL_ANNOTATION + "linkType", "WDM")
.set(OPTICAL_ANNOTATION + "distance", Double.toString(value.getDistance()))
.set(OPTICAL_ANNOTATION + "cost", Double.toString(value.getDistance()))
.set(OPTICAL_ANNOTATION + "adminWeight", Double.toString(value.getAdminWeight()))
.set(OPTICAL_ANNOTATION + "wavelengthNum", Integer.toString(value.getWavelengthNumber()))
.build();
DefaultLinkDescription linkDescription =
new DefaultLinkDescription(srcPoint,
snkPoint,
Link.Type.OPTICAL,
extendedAttributes);
linkProviderService.linkDetected(linkDescription);
log.info(String.format("WDM link: %s : %s",
linkDescription.src().toString(), linkDescription.dst().toString()));
DefaultLinkDescription linkDescriptionReverse =
new DefaultLinkDescription(snkPoint,
srcPoint,
Link.Type.OPTICAL,
extendedAttributes);
linkProviderService.linkDetected(linkDescriptionReverse);
log.info(String.format("WDM link: %s : %s",
linkDescriptionReverse.src().toString(), linkDescriptionReverse.dst().toString()));
}
// Discover the packet optical link objects
Iterator<PktOptLink> iterPktOptlink = RAW_PKTOPTLINKS.iterator();
while (iterPktOptlink.hasNext()) {
PktOptLink value = iterPktOptlink.next();
DeviceId srcNodeId = deviceId("of:" + value.getSrcNodeId().replace(":", ""));
DeviceId snkNodeId = deviceId("of:" + value.getSnkNodeId().replace(":", ""));
PortNumber srcPort = PortNumber.portNumber(value.getSrcPort());
PortNumber snkPort = PortNumber.portNumber(value.getSnkPort());
ConnectPoint srcPoint = new ConnectPoint(srcNodeId, srcPort);
ConnectPoint snkPoint = new ConnectPoint(snkNodeId, snkPort);
DefaultAnnotations extendedAttributes = DefaultAnnotations.builder()
.set(OPTICAL_ANNOTATION + "linkType", "PktOptLink")
.set(OPTICAL_ANNOTATION + "bandwidth", Double.toString(value.getBandwidth()))
.set(OPTICAL_ANNOTATION + "cost", Double.toString(value.getBandwidth()))
.set(OPTICAL_ANNOTATION + "adminWeight", Double.toString(value.getAdminWeight()))
.build();
DefaultLinkDescription linkDescription =
new DefaultLinkDescription(srcPoint,
snkPoint,
Link.Type.OPTICAL,
extendedAttributes);
linkProviderService.linkDetected(linkDescription);
log.info(String.format("Packet-optical link: %s : %s",
linkDescription.src().toString(), linkDescription.dst().toString()));
DefaultLinkDescription linkDescriptionReverse =
new DefaultLinkDescription(snkPoint,
srcPoint,
Link.Type.OPTICAL,
extendedAttributes);
linkProviderService.linkDetected(linkDescriptionReverse);
log.info(String.format("Packet-optical link: %s : %s",
linkDescriptionReverse.src().toString(), linkDescriptionReverse.dst().toString()));
}
}
@Override
public void triggerProbe(DeviceId deviceId) {
// TODO We may want to consider re-reading config files and publishing them based on this event.
}
@Override
public void roleChanged(DeviceId device, MastershipRole newRole) {
}
@Override
public boolean isReachable(DeviceId device) {
return false;
}
}
/*
* Copyright 2014 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.optical.cfg;
import com.fasterxml.jackson.databind.JsonNode;
import org.onlab.util.HexString;
import java.util.Map;
/**
* Public class corresponding to JSON described data model.
*
* @deprecated in Cardinal Release
*/
@Deprecated
public class OpticalLinkDescription {
protected String type;
protected Boolean allowed;
protected long dpid1;
protected long dpid2;
protected String nodeDpid1;
protected String nodeDpid2;
protected Map<String, JsonNode> params;
protected Map<String, String> publishAttributes;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Boolean isAllowed() {
return allowed;
}
public void setAllowed(Boolean allowed) {
this.allowed = allowed;
}
public String getNodeDpid1() {
return nodeDpid1;
}
public void setNodeDpid1(String nodeDpid1) {
this.nodeDpid1 = nodeDpid1;
this.dpid1 = HexString.toLong(nodeDpid1);
}
public String getNodeDpid2() {
return nodeDpid2;
}
public void setNodeDpid2(String nodeDpid2) {
this.nodeDpid2 = nodeDpid2;
this.dpid2 = HexString.toLong(nodeDpid2);
}
public long getDpid1() {
return dpid1;
}
public void setDpid1(long dpid1) {
this.dpid1 = dpid1;
this.nodeDpid1 = HexString.toHexString(dpid1);
}
public long getDpid2() {
return dpid2;
}
public void setDpid2(long dpid2) {
this.dpid2 = dpid2;
this.nodeDpid2 = HexString.toHexString(dpid2);
}
public Map<String, JsonNode> getParams() {
return params;
}
public void setParams(Map<String, JsonNode> params) {
this.params = params;
}
public Map<String, String> getPublishAttributes() {
return publishAttributes;
}
public void setPublishAttributes(Map<String, String> publishAttributes) {
this.publishAttributes = publishAttributes;
}
}
/*
* Copyright 2014 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.optical.cfg;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Public class corresponding to JSON described data model.
*
* @deprecated in Cardinal Release
*/
@Deprecated
public class OpticalNetworkConfig {
protected static final Logger log = LoggerFactory.getLogger(OpticalNetworkConfig.class);
private List<OpticalSwitchDescription> opticalSwitches;
private List<OpticalLinkDescription> opticalLinks;
public OpticalNetworkConfig() {
opticalSwitches = new ArrayList<>();
opticalLinks = new ArrayList<>();
}
public List<OpticalSwitchDescription> getOpticalSwitches() {
return opticalSwitches;
}
public void setOpticalSwitches(List<OpticalSwitchDescription> switches) {
this.opticalSwitches = switches;
}
public List<OpticalLinkDescription> getOpticalLinks() {
return opticalLinks;
}
public void setOpticalLinks(List<OpticalLinkDescription> links) {
this.opticalLinks = links;
}
}
/*
* Copyright 2014 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.optical.cfg;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JsonNode;
import org.onlab.util.HexString;
import java.util.Map;
/**
* Public class corresponding to JSON described data model.
*
* @deprecated in Cardinal Release
*/
@Deprecated
public class OpticalSwitchDescription {
protected String name;
protected long dpid;
protected String nodeDpid;
protected String type;
protected double latitude;
protected double longitude;
protected boolean allowed;
protected Map<String, JsonNode> params;
protected Map<String, String> publishAttributes;
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
public long getDpid() {
return dpid;
}
@JsonProperty("dpid")
public void setDpid(long dpid) {
this.dpid = dpid;
this.nodeDpid = HexString.toHexString(dpid);
}
public String getNodeDpid() {
return nodeDpid;
}
public String getHexDpid() {
return nodeDpid;
}
public void setNodeDpid(String nodeDpid) {
this.nodeDpid = nodeDpid;
this.dpid = HexString.toLong(nodeDpid);
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public double getLatitude() {
return latitude;
}
public void setLatitude(double latitude) {
this.latitude = latitude;
}
public double getLongitude() {
return longitude;
}
public void setLongitude(double longitude) {
this.longitude = longitude;
}
public boolean isAllowed() {
return allowed;
}
public void setAllowed(boolean allowed) {
this.allowed = allowed;
}
public Map<String, JsonNode> getParams() {
return params;
}
public void setParams(Map<String, JsonNode> params) {
this.params = params;
}
public Map<String, String> getPublishAttributes() {
return publishAttributes;
}
public void setPublishAttributes(Map<String, String> publishAttributes) {
this.publishAttributes = publishAttributes;
}
}
/*
* Copyright 2014 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.optical.cfg;
/**
* Packet-optical link Java data object.
*
* @deprecated in Cardinal Release
*/
@Deprecated
class PktOptLink {
private String srcNodeName;
private String snkNodeName;
private String srcNodeId;
private String snkNodeId;
private int srcPort;
private int snkPort;
private double bandwidth;
private double cost;
private long adminWeight;
public PktOptLink(String srcName, String snkName) {
this.srcNodeName = srcName;
this.snkNodeName = snkName;
}
public PktOptLink() {
}
public void setSrcNodeName(String name) {
this.srcNodeName = name;
}
public String getSrcNodeName() {
return this.srcNodeName;
}
public void setSnkNodeName(String name) {
this.snkNodeName = name;
}
public String getSnkNodeName() {
return this.snkNodeName;
}
public void setSrcNodeId(String nodeId) {
this.srcNodeId = nodeId;
}
public String getSrcNodeId() {
return this.srcNodeId;
}
public void setSnkNodeId(String nodeId) {
this.snkNodeId = nodeId;
}
public String getSnkNodeId() {
return this.snkNodeId;
}
public void setSrcPort(int port) {
this.srcPort = port;
}
public int getSrcPort() {
return this.srcPort;
}
public void setSnkPort(int port) {
this.snkPort = port;
}
public int getSnkPort() {
return this.snkPort;
}
public void setBandwdith(double x) {
this.bandwidth = x;
}
public double getBandwidth() {
return this.bandwidth;
}
public void setCost(double x) {
this.cost = x;
}
public double getCost() {
return this.cost;
}
public void setAdminWeight(long x) {
this.adminWeight = x;
}
public long getAdminWeight() {
return this.adminWeight;
}
@Override
public String toString() {
return new StringBuilder(" srcNodeName: ").append(this.srcNodeName)
.append(" snkNodeName: ").append(this.snkNodeName)
.append(" srcNodeId: ").append(this.srcNodeId)
.append(" snkNodeId: ").append(this.snkNodeId)
.append(" srcPort: ").append(this.srcPort)
.append(" snkPort: ").append(this.snkPort)
.append(" bandwidth: ").append(this.bandwidth)
.append(" cost: ").append(this.cost)
.append(" adminWeight: ").append(this.adminWeight).toString();
}
}
/*
* Copyright 2014 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.optical.cfg;
/**
* ROADM java data object converted from a JSON file.
*
* @deprecated in Cardinal Release
*/
@Deprecated
class Roadm {
private String name;
private String nodeID;
private double longtitude;
private double latitude;
private int regenNum;
//TODO use the following attributes when needed for configurations
private int tPort10G;
private int tPort40G;
private int tPort100G;
private int wPort;
public Roadm() {
}
public Roadm(String name) {
this.name = name;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return this.name;
}
public void setNodeId(String nameId) {
this.nodeID = nameId;
}
public String getNodeId() {
return this.nodeID;
}
public void setLongtitude(double x) {
this.longtitude = x;
}
public double getLongtitude() {
return this.longtitude;
}
public void setLatitude(double y) {
this.latitude = y;
}
public double getLatitude() {
return this.latitude;
}
public void setRegenNum(int num) {
this.regenNum = num;
}
public int getRegenNum() {
return this.regenNum;
}
public void setTport10GNum(int num) {
this.tPort10G = num;
}
public int getTport10GNum() {
return this.tPort10G;
}
public void setTport40GNum(int num) {
this.tPort40G = num;
}
public int getTport40GNum() {
return this.tPort40G;
}
public void setTport100GNum(int num) {
this.tPort100G = num;
}
public int getTport100GNum() {
return this.tPort100G;
}
public void setWportNum(int num) {
this.wPort = num;
}
public int getWportNum() {
return this.wPort;
}
@Override
public String toString() {
return new StringBuilder(" ROADM Name: ").append(this.name)
.append(" nodeID: ").append(this.nodeID)
.append(" longtitude: ").append(this.longtitude)
.append(" latitude: ").append(this.latitude)
.append(" regenNum: ").append(this.regenNum)
.append(" 10GTportNum: ").append(this.tPort10G)
.append(" 40GTportNum: ").append(this.tPort40G)
.append(" 100GTportNum: ").append(this.tPort100G)
.append(" WportNum: ").append(this.wPort).toString();
}
}
/*
* Copyright 2014 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.optical.cfg;
/**
* WDM Link Java data object converted from a JSON file.
*
* @deprecated in Cardinal Release
*/
@Deprecated
class WdmLink {
private String srcNodeName;
private String snkNodeName;
private String srcNodeId;
private String snkNodeId;
private int srcPort;
private int snkPort;
private double distance;
private double cost;
private int wavelengthNumber;
private long adminWeight;
public WdmLink(String name1, String name2) {
this.srcNodeName = name1;
this.snkNodeName = name2;
}
public WdmLink() {
}
public void setSrcNodeName(String name) {
this.srcNodeName = name;
}
public String getSrcNodeName() {
return this.srcNodeName;
}
public void setSnkNodeName(String name) {
this.snkNodeName = name;
}
public String getSnkNodeName() {
return this.snkNodeName;
}
public void setSrcNodeId(String nodeId) {
this.srcNodeId = nodeId;
}
public String getSrcNodeId() {
return this.srcNodeId;
}
public void setSnkNodeId(String nodeId) {
this.snkNodeId = nodeId;
}
public String getSnkNodeId() {
return this.snkNodeId;
}
public void setSrcPort(int port) {
this.srcPort = port;
}
public int getSrcPort() {
return this.srcPort;
}
public void setSnkPort(int port) {
this.snkPort = port;
}
public int getSnkPort() {
return this.snkPort;
}
public void setDistance(double x) {
this.distance = x;
}
public double getDistance() {
return this.distance;
}
public void setCost(double x) {
this.cost = x;
}
public double getCost() {
return this.cost;
}
public void setWavelengthNumber(int x) {
this.wavelengthNumber = x;
}
public int getWavelengthNumber() {
return this.wavelengthNumber;
}
public void setAdminWeight(long x) {
this.adminWeight = x;
}
public long getAdminWeight() {
return this.adminWeight;
}
@Override
public String toString() {
return new StringBuilder(" srcNodeName: ").append(this.srcNodeName)
.append(" snkNodeName: ").append(this.snkNodeName)
.append(" srcNodeId: ").append(this.srcNodeId)
.append(" snkNodeId: ").append(this.snkNodeId)
.append(" srcPort: ").append(this.srcPort)
.append(" snkPort: ").append(this.snkPort)
.append(" distance: ").append(this.distance)
.append(" cost: ").append(this.cost)
.append(" wavelengthNumber: ").append(this.wavelengthNumber)
.append(" adminWeight: ").append(this.adminWeight).toString();
}
}
/*
* Copyright 2014 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Packet/Optical configuration.
*/
@Deprecated
package org.onosproject.optical.cfg;