@Override
@ActionEvent(eventType = EventTypes.EVENT_TRAFFIC_TYPE_UPDATE, eventDescription = "Updating physical network TrafficType", async = true)
public PhysicalNetworkTrafficType updatePhysicalNetworkTrafficType(Long id, String xenLabel, String kvmLabel, String vmwareLabel, String hypervLabel) {
PhysicalNetworkTrafficTypeVO trafficType = _pNTrafficTypeDao.findById(id);
if (trafficType == null) {
throw new InvalidParameterValueException("Traffic Type with id=" + id + "doesn't exist in the system");
}
if (xenLabel != null) {
if ("".equals(xenLabel)) {
xenLabel = null;
}
trafficType.setXenNetworkLabel(xenLabel);
}
if (kvmLabel != null) {
if ("".equals(kvmLabel)) {
kvmLabel = null;
}
trafficType.setKvmNetworkLabel(kvmLabel);
}
if (vmwareLabel != null) {
if ("".equals(vmwareLabel)) {
vmwareLabel = null;
}
trafficType.setVmwareNetworkLabel(vmwareLabel);
}
if (hypervLabel != null) {
if ("".equals(hypervLabel)) {
hypervLabel = null;
}
trafficType.setHypervNetworkLabel(hypervLabel);
}
_pNTrafficTypeDao.update(id, trafficType);
return trafficType;
}