Fixed major issues reported by sonar (Static Variable Name)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@65398 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2014-03-22 16:03:14 +00:00
parent 166ece8ebb
commit 8732f1cc5b
3 changed files with 19 additions and 19 deletions

View File

@@ -30,31 +30,31 @@ import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
/**
* Base records management job implementation.
* Base records management job implementation.
* <p>
* Delegates job execution and ensures locking
* is enforced.
*
*
* @author Roy Wetherall
*/
public class RecordsManagementJob implements Job
{
private static long DEFAULT_TIME = 30000L;
private static final long DEFAULT_TIME = 30000L;
private JobLockService jobLockService;
private RecordsManagementJobExecuter jobExecuter;
private String jobName;
private QName getLockQName()
{
return QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, jobName);
}
/**
* Attempts to get the lock. If the lock couldn't be taken, then <tt>null</tt> is returned.
*
*
* @return Returns the lock token or <tt>null</tt>
*/
private String getLock()
@@ -68,7 +68,7 @@ public class RecordsManagementJob implements Job
return null;
}
}
@Override
public void execute(JobExecutionContext context) throws JobExecutionException
{
@@ -78,29 +78,29 @@ public class RecordsManagementJob implements Job
{
throw new AlfrescoRuntimeException("Job lock service has not been specified.");
}
// get the job executer
jobExecuter = (RecordsManagementJobExecuter)context.getJobDetail().getJobDataMap().get("jobExecuter");
if (jobExecuter == null)
{
throw new AlfrescoRuntimeException("Job executer has not been specified.");
}
// get the job name
jobName = (String)context.getJobDetail().getJobDataMap().get("jobName");
if (jobName == null)
{
throw new AlfrescoRuntimeException("Job name has not been specified.");
}
AuthenticationUtil.runAs(new RunAsWork<Void>()
{
public Void doWork() throws Exception
{
{
// try and get the lock
String lockToken = getLock();
if (lockToken != null)
{
{
try
{
// do work
@@ -111,8 +111,8 @@ public class RecordsManagementJob implements Job
jobLockService.releaseLock(lockToken, getLockQName());
}
}
// return
// return
return null;
}
}, AuthenticationUtil.getSystemUserName());

View File

@@ -41,7 +41,7 @@ import org.springframework.beans.factory.BeanNameAware;
public class RMv2ModelPatch extends ModulePatchComponent
implements BeanNameAware, RecordsManagementModel, DOD5015Model
{
private static long BATCH_SIZE = 100000L;
private static final long BATCH_SIZE = 100000L;
private PatchDAO patchDAO;
private NodeDAO nodeDAO;

View File

@@ -40,7 +40,7 @@ public class RMv22DODModelSeparationModulePatch extends AbstractModulePatch
implements RecordsManagementModel
{
/** query batch size */
private static long BATCH_SIZE = 100000L;
private static final long BATCH_SIZE = 100000L;
/** QName DAO */
private QNameDAO qnameDAO;