if (context == null)
throw new RuntimeException("Local entity passed was NULL.");
if (dataDurationObj == null)
throw new RuntimeException("Data duration object passed was NULL.");
DataObj dataObj = null;
if ((dataObj = dataDurationObj.getDataObj()) == null)
throw new RuntimeException("Data duration object's DataObj was NULL.");
if (dataObj.getId() == null)
throw new RuntimeException("Data object's ID was NULL.");
if (dataObj.getLocalLocation() == null)
throw new RuntimeException("Local file URL passed in DataDurationObj.getDataObj was NULL.");
if (dataDurationObj.getRemoteLocation() == null)
throw new RuntimeException("Remote file URL passed in DataDurationObj was NULL.");
// mark computation end
dataDurationObj.markEndTimeMillis();
// create activity
DataReceiveDurationDocument activity = DataReceiveDurationDocument.Factory.newInstance();
DataTransferDurationType activityType = activity.addNewDataReceiveDuration();
activityType.setId(dataObj.getId().toString());
activityType.setDurationInMillis(dataDurationObj.getDurationMillis());
activityType.setSizeInBytes(dataObj.getSizeInBytes());
activityType.setSource(dataObj.getLocalLocation().toString());
activityType.setTarget(dataDurationObj.getRemoteLocation().toString());
sendNotification(context, activity, descriptionAndAnnotation,
"[Data from " + dataDurationObj.getRemoteLocation() + " was received at " + dataObj.getLocalLocation()
+ "]");
return dataDurationObj;
}