コード例 #1
0
 @Override
 public void execute() {
   CallContext.current().setEventDetails("TrafficType Id: " + getEntityId());
   PhysicalNetworkTrafficType result =
       _networkService.getPhysicalNetworkTrafficType(getEntityId());
   if (result != null) {
     TrafficTypeResponse response = _responseGenerator.createTrafficTypeResponse(result);
     response.setResponseName(getCommandName());
     this.setResponseObject(response);
   } else {
     throw new ServerApiException(
         ApiErrorCode.INTERNAL_ERROR, "Failed to add traffic type to physical network");
   }
 }
コード例 #2
0
 @Override
 public void execute() {
   PhysicalNetworkTrafficType result =
       _networkService.updatePhysicalNetworkTrafficType(
           getId(),
           getXenLabel(),
           getKvmLabel(),
           getVmwareLabel(),
           getHypervLabel(),
           getOvm3Label());
   if (result != null) {
     TrafficTypeResponse response = _responseGenerator.createTrafficTypeResponse(result);
     response.setResponseName(getCommandName());
     this.setResponseObject(response);
   } else {
     throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update traffic type");
   }
 }