String refId = getPersistenceManager().getExportReferenceId(type, version, ExportData.getInternalBytes(exportContextBytes));
ExportContext exportContext = getPersistenceManager().getExportContext(refId);
if (exportContext.isExportByValue())
{
throw new OperationFailedException("Cannot set the lifetime for an export that was exported by value.");
}
exportContext.setCurrentTime(currentTime);
exportContext.setTerminationTime(terminationTime);
exportContext.setRefreshDuration(refreshDuration);
ExportContext updatedExportContext = getPersistenceManager().updateExportContext(refId, exportContext);
return updatedExportContext;
}
else
{
throw new OperationFailedException("Byte array format not recognized.");
}
}
catch (IOException e)
{
throw new OperationFailedException("Could not decode the byte array.");
}
}