Commit 748addb3a784a3b680a4dd4156d1c71e98acddfe

Authored by Rui Fernandes
1 parent 7ddec10aa1
Exists in master

constant review

alfresco-trashcan-cleaner-amp/src/main/java/org/alfresco/trashcan/TrashcanCleaner.java
... ... @@ -61,13 +61,16 @@ import org.apache.commons.logging.LogFactory;
61 61 public class TrashcanCleaner
62 62 {
63 63  
  64 + protected static final int DEFAULT_DAYS_TO_KEEP = -1;
  65 + protected static final int DEFAULT_DELETE_BATCH_COUNT = 1000;
  66 + private static final long DAYS_TO_MILLIS = 1000 * 60 * 60 * 24;
  67 +
64 68 private static Log logger = LogFactory.getLog(TrashcanCleaner.class);
65 69  
66 70 private NodeService nodeService;
67 71 private String archiveStoreUrl = "archive://SpacesStore";
68   - private int deleteBatchCount = 1000;
69   - private int daysToKeep = -1;
70   - private static final long DAYS_TO_MILLIS = 1000 * 60 * 60 * 24;
  72 + private int deleteBatchCount = DEFAULT_DELETE_BATCH_COUNT;
  73 + private int daysToKeep = DEFAULT_DAYS_TO_KEEP;
71 74  
72 75 /**
73 76 *
... ...
alfresco-trashcan-cleaner-amp/src/main/java/org/alfresco/trashcan/TrashcanCleanerJob.java
... ... @@ -58,8 +58,8 @@ public class TrashcanCleanerJob extends AbstractScheduledLockedJob
58 58 protected NodeService nodeService;
59 59 protected TransactionService transactionService;
60 60 protected AuthenticationComponent authenticationComponent;
61   - private int deleteBatchCount = 1000;
62   - private int daysToKeep = -1;
  61 + private int deleteBatchCount;
  62 + private int daysToKeep;
63 63  
64 64 /**
65 65 * The implementation of the
... ... @@ -117,10 +117,10 @@ public class TrashcanCleanerJob extends AbstractScheduledLockedJob
117 117 .getJobDataMap().get("transactionService");
118 118 authenticationComponent = (AuthenticationComponent) jobContext
119 119 .getJobDetail().getJobDataMap().get("authenticationComponent");
120   - daysToKeep = getSetupValue("trashcan.daysToKeep", daysToKeep,
121   - jobContext);
  120 + daysToKeep = getSetupValue("trashcan.daysToKeep",
  121 + TrashcanCleaner.DEFAULT_DAYS_TO_KEEP, jobContext);
122 122 deleteBatchCount = getSetupValue("trashcan.deleteBatchCount",
123   - deleteBatchCount, jobContext);
  123 + TrashcanCleaner.DEFAULT_DELETE_BATCH_COUNT, jobContext);
124 124  
125 125 }
126 126  
... ...