package org.opendaylight.transportpce.pce.networkanalyzer;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
import java.util.List;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev181130.Link1;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class PceLink {
+public class PceLink implements Serializable {
+ private static final long serialVersionUID = 1L;
/* Logging. */
private static final Logger LOG = LoggerFactory.getLogger(PceLink.class);
///////////////////////// LINKS ////////////////////
private final OpenroadmLinkType linkType;
private final NodeId sourceId;
private final NodeId destId;
- private final Object sourceTP;
- private final Object destTP;
+ private transient Object sourceTP;
+ private transient Object destTP;
private final String sourceNetworkSupNodeId;
private final String destNetworkSupNodeId;
private final String sourceCLLI;
private final Long usedBandwidth;
private final List<Long> srlgList;
private final double osnr;
- private final Span omsAttributesSpan;
+ private final transient Span omsAttributesSpan;
private static final double CELERITY = 2.99792458 * 1e5; //meter per ms
private static final double NOISE_MASK_A = 0.571429;
private static final double NOISE_MASK_B = 39.285714;
this.availableBandwidth = 0L;
this.usedBandwidth = 0L;
}
- LOG.debug("PceLink: created PceLink {}", toString());
+ LOG.debug("PceLink: created PceLink {}", linkId);
}
//Retrieve the opposite link
}
public Long getUsedBandwidth() {
- return availableBandwidth;
+ return usedBandwidth;
}
public String getsourceNetworkSupNodeId() {
return false;
}
- long neededBW = 0L;
+ long neededBW;
OtnLinkType neededType = null;
switch (serviceType) {
return true;
}
+ @Override
public String toString() {
return "PceLink type=" + linkType + " ID=" + linkId.getValue() + " latency=" + latency;
}
+ private void writeObject(ObjectOutputStream out) throws IOException {
+ out.defaultWriteObject();
+ out.writeObject(this.sourceTP);
+ out.writeObject(this.destTP);
+ }
+
+ private void readObject(ObjectInputStream in) throws IOException,ClassNotFoundException {
+ in.defaultReadObject();
+ this.sourceTP = in.readObject();
+ this.destTP = in.readObject();
+ }
}