Package org.cyclos.impl.system
Class InternetAddressResolutionPollingTask
- 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<InternetAddressList>
-
- org.cyclos.impl.system.InternetAddressResolutionPollingTask
-
- All Implemented Interfaces:
Runnable,PollingTask
@Component public class InternetAddressResolutionPollingTask extends EntityBatchPollingTask<InternetAddressList>
PollingTask which resolves the IP addresses
-
-
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
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 InternetAddressResolutionPollingTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfinish(InternetAddressList list, Throwable error)Must be implemented in order to mark the given entity as finished.IntegergetInitialSleepSeconds()The number of seconds before the first execution.StringgetName()Returns the task nameintgetSleepSeconds()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(InternetAddressList list)Must be implemented in order to actually process the given entity, without change it's state to already processed-
Methods inherited from class org.cyclos.impl.utils.tasks.EntityBatchPollingTask
doRun, find, generateErrorLog, generateErrorLog, logProcessingErrors, onFinish, resolveNetwork, shouldGenerateErrorLog, shouldGenerateErrorLog, shouldSkipFinish
-
Methods inherited from class org.cyclos.impl.utils.tasks.AbstractPollingTask
dateFromDelay, getFirstExecution, getNextExecution, getSecondsUntilNextDay, getSecondsUntilNextHour, getStorage, initialize, isExclusiveInCluster, run
-
Methods inherited from class org.cyclos.impl.utils.tasks.AbstractTask
getLogConfiguration, logName, logTaskError, logTaskSuccess, toString
-
Methods inherited from class org.cyclos.impl.AbstractGlobalServerComponent
getBaseEntityManagerHandler, getEntityManager
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, delete, detach, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
-
-
-
Method Detail
-
getInitialSleepSeconds
public Integer getInitialSleepSeconds()
Description copied from class:AbstractPollingTaskThe number of seconds before the first execution. By default is a random time between 0 andAbstractPollingTask.getSleepSeconds(). If returns null, the polling task is disabled.- Overrides:
getInitialSleepSecondsin classAbstractPollingTask
-
getName
public String getName()
Description copied from interface:PollingTaskReturns the task name- Specified by:
getNamein interfacePollingTask- Specified by:
getNamein classAbstractTask
-
getSleepSeconds
public int getSleepSeconds()
- Overrides:
getSleepSecondsin classAbstractPollingTask
-
finish
protected void finish(InternetAddressList list, 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<InternetAddressList>- 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<InternetAddressList>- Throws:
Throwable
-
process
protected void process(InternetAddressList list) 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<InternetAddressList>- Throws:
Throwable
-
-