Package org.cyclos.impl.users
Class PurgeUnconfirmedUsersPollingTask
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractGlobalServerComponent
-
- org.cyclos.impl.utils.tasks.AbstractTask
-
- org.cyclos.impl.utils.tasks.AbstractPollingTask
-
- org.cyclos.impl.utils.tasks.EntityBatchPollingTask<BasicUser>
-
- org.cyclos.impl.users.PurgeUnconfirmedUsersPollingTask
-
- All Implemented Interfaces:
Runnable,PollingTask,HasMessageKey
@Component public class PurgeUnconfirmedUsersPollingTask extends EntityBatchPollingTask<BasicUser>
APollingTaskwhich removes the users pending registration confirmation after a given timeout
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.utils.tasks.EntityBatchPollingTask
BATCH_SIZE, entityType
-
Fields inherited from class org.cyclos.impl.utils.tasks.AbstractTask
clusterHandler, errorLogService, invokerHandler, loggingHandler
-
Fields inherited from class org.cyclos.impl.AbstractGlobalServerComponent
rawEntityManagerHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
-
Constructor Summary
Constructors Constructor Description PurgeUnconfirmedUsersPollingTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfinish(BasicUser entity, Throwable error)Must be implemented in order to mark the given entity as finished.MessageKeygetMessageKey()protected Collection<Long>nextIds()Must be implemented in order to return the ids of the next entities to be processed, without actually processing them.protected voidprocess(BasicUser user)Must be implemented in order to actually process the given entity, without change it's state to already processedprotected booleanshouldSkipFinish(Long id, Throwable error)Returns whether the entity with the given id, having the given error whenEntityBatchPollingTask.process(IEntity)was executed, needs or not theEntityBatchPollingTask.finish(IEntity, Throwable)method.-
Methods inherited from class org.cyclos.impl.utils.tasks.EntityBatchPollingTask
doRun, find, generateErrorLog, generateErrorLog, logProcessingErrors, onFinish, resolveNetwork, shouldGenerateErrorLog, shouldGenerateErrorLog
-
Methods inherited from class org.cyclos.impl.utils.tasks.AbstractPollingTask
getFirstExecution, getRecurrence, getStorage, isVerbose, logName, run, toString
-
Methods inherited from class org.cyclos.impl.utils.tasks.AbstractTask
getLogConfiguration, getName, logTaskError, logTaskSuccess, resolveName
-
Methods inherited from class org.cyclos.impl.AbstractGlobalServerComponent
getBaseEntityManagerHandler, getEntityManager
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, dataTranslationProxy, delete, detach, doDataTranslationProxy, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.cyclos.impl.utils.tasks.PollingTask
getName
-
-
-
-
Method Detail
-
getMessageKey
public MessageKey getMessageKey()
-
finish
protected void finish(BasicUser entity, Throwable error) throws Throwable
Description copied from class:EntityBatchPollingTaskMust be implemented in order to mark the given entity as finished. Even when {@link #process(IEntity))} fails, this method is invoked. Runs in another transaction, passing the error ifEntityBatchPollingTask.process(IEntity)yielded an error.- Specified by:
finishin classEntityBatchPollingTask<BasicUser>- Throws:
Throwable
-
nextIds
protected Collection<Long> nextIds() throws Throwable
Description copied from class:EntityBatchPollingTaskMust be implemented in order to return the ids of the next entities to be processed, without actually processing them. Returning null or an empty list means there is no more data for now, and will make this task sleep- Specified by:
nextIdsin classEntityBatchPollingTask<BasicUser>- Throws:
Throwable
-
process
protected void process(BasicUser user) throws Throwable
Description copied from class:EntityBatchPollingTaskMust be implemented in order to actually process the given entity, without change it's state to already processed- Specified by:
processin classEntityBatchPollingTask<BasicUser>- Throws:
Throwable
-
shouldSkipFinish
protected boolean shouldSkipFinish(Long id, Throwable error)
Description copied from class:EntityBatchPollingTaskReturns whether the entity with the given id, having the given error whenEntityBatchPollingTask.process(IEntity)was executed, needs or not theEntityBatchPollingTask.finish(IEntity, Throwable)method. If this method returns true, finish() is not executed- Overrides:
shouldSkipFinishin classEntityBatchPollingTask<BasicUser>
-
-