Commit 83f45ffbdc881910de5171ec690ea59e0eaf5149

Authored by Steven Glover
1 parent 55a23d394f
Exists in master

REPO-1485 "Align code with Alfresco coding best practice" clean up Javadocs, rem…

…ove JobLockService related code (added in error)
src/main/java/org/alfresco/trashcan/TrashcanCleaner.java
... ... @@ -31,10 +31,8 @@ import java.time.ZoneOffset;
31 31 import java.util.ArrayList;
32 32 import java.util.Date;
33 33 import java.util.List;
34   -import java.util.concurrent.atomic.AtomicBoolean;
35 34  
36 35 import org.alfresco.model.ContentModel;
37   -import org.alfresco.repo.lock.JobLockService.JobLockRefreshCallback;
38 36 import org.alfresco.repo.security.authentication.AuthenticationUtil;
39 37 import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
40 38 import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
... ... @@ -50,36 +48,29 @@ import org.apache.commons.logging.LogFactory;
50 48 *
51 49 * This class is capable of cleaning the trashcan without depending on searches
52 50 * over the archive store. So the corresponding index core could be deactivated
53   - * with no impact on its execution. It will clean (<b>clean</b> method the
54   - * trashcan according to defined <b>deleteBatchCount</b> and <b>daysToKeep</b>.
55   - *
56   - * <b>deleteBatchCount</b>: It will set how many nodes in trashcan to delete at
57   - * maximum during <b>clean</b> execution. By default the value is 1000.
58   - * <b>daysToKeep</b>: The number of days to keep a document in trashcan since
59   - * its deletion. Any node archived less than the value specified won't be
60   - * deleted during <b>clean</b> execution. If the value is 0 or negative any
61   - * archived will be eligible for deletion (default behavior if no positive value
62   - * is explicitly set).
63   - *
64   - * By default the cleaning will be executed against the standard store for
65   - * trashcan: archive://SpacesStore. If you want you can also specify a different
66   - * <b>archiveStoreUrl</b> than the default.
  51 + * with no impact on its execution. It will {@link #clean} the trashcan according
  52 + * to defined {@link deleteBatchCount} and {@link keepPeriod} properties.
  53 + * <p>
  54 + * {@link deleteBatchCount}: It will set how many nodes in trashcan to delete at
  55 + * maximum during {@link clean} execution. By default the value is 1000.
  56 + * <p>
  57 + * {@link keepPeriod}: The time period (in {@link java.time.Duration} format) for which documents in
  58 + * trashcan are kept. Any nodes archived less than the value specified won't be deleted during {@link #clean} execution.
67 59 *
68 60 * @author Rui Fernandes
69 61 * @author sglover
70   - *
71   - * TODO: fetch child associations using the deleteBatchCount rather than all associations?
72   - *
73 62 */
74   -public class TrashcanCleaner implements JobLockRefreshCallback
  63 +public class TrashcanCleaner
75 64 {
  65 + /*
  66 + * TODO: fetch child associations using the deleteBatchCount rather than all associations?
  67 + */
  68 +
76 69 private static final Log logger = LogFactory.getLog(TrashcanCleaner.class);
77 70  
78 71 private final NodeService nodeService;
79 72 private final TransactionService transactionService;
80 73  
81   - private final AtomicBoolean isActive = new AtomicBoolean(true);
82   -
83 74 private final String archiveStoreUrl = "archive://SpacesStore";
84 75 private final int deleteBatchCount;
85 76 private final Duration keepPeriod;
... ... @@ -282,15 +273,4 @@ public class TrashcanCleaner implements JobLockRefreshCallback
282 273 logger.debug("TrashcanCleaner finished");
283 274 }
284 275 }
285   -
286   - @Override
287   - public boolean isActive()
288   - {
289   - return isActive.get();
290   - }
291   -
292   - @Override
293   - public void lockReleased()
294   - {
295   - }
296 276 }
... ...