diff --git a/modules/dcache/src/main/java/org/dcache/pool/migration/Job.java b/modules/dcache/src/main/java/org/dcache/pool/migration/Job.java index 0043e17feb7..3679f42e37a 100644 --- a/modules/dcache/src/main/java/org/dcache/pool/migration/Job.java +++ b/modules/dcache/src/main/java/org/dcache/pool/migration/Job.java @@ -785,6 +785,18 @@ public void taskCompleted(Task task) { } } + @Override + public void taskCompletedWithNote(Task task, String msg) { + _lock.lock(); + try { + taskCompleted(task); + + addNote(new Note(task.getId(), task.getPnfsId(), msg)); + } finally { + _lock.unlock(); + } + } + public Object messageArrived(CellMessage envelope, PoolMigrationJobCancelMessage message) { DelayedReply reply = new DelayedReply(); _lock.lock(); diff --git a/modules/dcache/src/main/java/org/dcache/pool/migration/TaskCompletionHandler.java b/modules/dcache/src/main/java/org/dcache/pool/migration/TaskCompletionHandler.java index 8ed0083ce1d..547be54f6a5 100644 --- a/modules/dcache/src/main/java/org/dcache/pool/migration/TaskCompletionHandler.java +++ b/modules/dcache/src/main/java/org/dcache/pool/migration/TaskCompletionHandler.java @@ -26,4 +26,5 @@ public interface TaskCompletionHandler { * The task completed without error. */ void taskCompleted(Task task); + default void taskCompletedWithNote(Task task, String msg) { taskCompleted(task); } }