Package org.cyclos.impl.system
Class CustomScheduledTaskServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.CRUDServiceImpl<CustomScheduledTask,QCustomScheduledTask,CustomScheduledTaskDTO,CustomScheduledTaskData,Void>
-
- org.cyclos.impl.system.CustomScheduledTaskServiceImpl
-
- All Implemented Interfaces:
ApplicationInitializationListener,BaseApplicationInitializationListener,CRUDServiceLocal<CustomScheduledTask,CustomScheduledTaskDTO,CustomScheduledTaskData,Void>,CustomScheduledTaskServiceLocal,CRUDService<CustomScheduledTaskDTO,CustomScheduledTaskData,Void>,CRUDWithConfirmationPasswordService<CustomScheduledTaskDTO,CustomScheduledTaskData,Void>,Service,CustomScheduledTaskService
@Service public class CustomScheduledTaskServiceImpl extends CRUDServiceImpl<CustomScheduledTask,QCustomScheduledTask,CustomScheduledTaskDTO,CustomScheduledTaskData,Void> implements CustomScheduledTaskServiceLocal, ApplicationInitializationListener
Implementation forCustomScheduledTaskService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.CRUDServiceImpl
$, ATTR_CURRENT_COPY, cacheHandler, dtoClass, entityClass, extensionPointService, idPath, internalNamePath, namePath, ownerEntityIdPath, ownerEntityPath, ownerEntityPropertyName, passwordHandler, richTextHandler, withConfirmationPassword
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, customFieldValueHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
Fields inherited from interface org.cyclos.impl.BaseApplicationInitializationListener
MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
Fields inherited from interface org.cyclos.impl.system.CustomScheduledTaskServiceLocal
ATTR_LOG, ATTR_SCHEDULED_TASK, ATTR_TASK
-
-
Constructor Summary
Constructors Constructor Description CustomScheduledTaskServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CustomScheduledTaskDatagetData(CustomScheduledTask customScheduledTask)Returns details data for the given entityDategetNextExecution(CustomScheduledTask task)Calculates the next execution date, given the parameters.com.mysema.commons.lang.CloseableIterator<CustomScheduledTask>iterateForRunningNow()Iterates all custom scheduled tasks which should start running immediatelyList<CustomScheduledTaskDetailedVO>list()Lists all available custom recurring tasksCustomScheduledTasknewEntity(Void params)Should be implemented in order to instantiate a new entity based on the given context parametersvoidonApplicationInitialization()Invoked when the application service is initializedprotected ObjectonBeforeSave(CustomScheduledTask task, CustomScheduledTask currentCopy)May be overridden in order to perform custom logic before saving an entity.protected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkprotected ValidatorresolveValidator(CustomScheduledTaskDTO dto)booleanrun(Long taskId)Runs the task with the given identifier, generating a log.voidrunNow(CustomScheduledTaskVO vo)Triggers a manual execution of the given taskPage<CustomScheduledTaskLogVO>searchLogs(CustomScheduledTaskLogQuery params)Searches for a task execution logs-
Methods inherited from class org.cyclos.impl.CRUDServiceImpl
addCustomInternalNameValidations, addCustomNameValidations, checkConfirmationPassword, doRemove, find, findAll, from, getConfirmationPasswordInput, getConfirmationPasswordInputForRemove, getData, getDataForNew, getDeviceConfirmationParams, getEntityClass, getEntityInternalNameKey, getExcludedPropertiesToDTO, getExcludedPropertiesToEntity, getNameLabel, getUniqueInternalNameQuery, getUniqueNameQuery, isEntityInternalNameRequired, isNameRequired, load, logEntity, onAfterRemove, onAfterSave, onBeforeRemove, preProcessCurrentCopy, remove, remove, removeAll, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveDTOType, resolveEntityType, resolveExtensionPointAccessor, save, saveOrder, saveSkippingEntityLog, saveWithConfirmationPassword, shouldCheckConfirmationPassword, subClassMappings, toDTO, toEntity, validate
-
Methods inherited from class org.cyclos.impl.BaseServiceImpl
initializeNetworkMappings
-
Methods inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
canManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, setAlreadyValidated, toDate, toDateTime, validate
-
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, toString, wait, wait, wait
-
Methods inherited from interface org.cyclos.impl.BaseApplicationInitializationListener
applicationInitializationPriority, getInitializationId
-
Methods inherited from interface org.cyclos.services.CRUDService
getData, getDataForNew, load, remove, removeAll, save
-
Methods inherited from interface org.cyclos.impl.CRUDServiceLocal
find, findAll, getEntityClass, remove, removeAll, saveEntity, saveSkippingEntityLog, toDTO, toEntity, validate
-
-
-
-
Method Detail
-
getNextExecution
public Date getNextExecution(CustomScheduledTask task)
Description copied from interface:CustomScheduledTaskServiceLocalCalculates the next execution date, given the parameters. Is a separated method to allow testing- Specified by:
getNextExecutionin interfaceCustomScheduledTaskServiceLocal
-
iterateForRunningNow
public com.mysema.commons.lang.CloseableIterator<CustomScheduledTask> iterateForRunningNow()
Description copied from interface:CustomScheduledTaskServiceLocalIterates all custom scheduled tasks which should start running immediately- Specified by:
iterateForRunningNowin interfaceCustomScheduledTaskServiceLocal
-
list
public List<CustomScheduledTaskDetailedVO> list() throws FrameworkException
Description copied from interface:CustomScheduledTaskServiceLists all available custom recurring tasks- Specified by:
listin interfaceCustomScheduledTaskService- Throws:
FrameworkException
-
newEntity
public CustomScheduledTask newEntity(Void params)
Description copied from class:CRUDServiceImplShould be implemented in order to instantiate a new entity based on the given context parameters- Specified by:
newEntityin interfaceCRUDServiceLocal<CustomScheduledTask,CustomScheduledTaskDTO,CustomScheduledTaskData,Void>- Specified by:
newEntityin classCRUDServiceImpl<CustomScheduledTask,QCustomScheduledTask,CustomScheduledTaskDTO,CustomScheduledTaskData,Void>
-
onApplicationInitialization
public void onApplicationInitialization()
Description copied from interface:ApplicationInitializationListenerInvoked when the application service is initialized- Specified by:
onApplicationInitializationin interfaceApplicationInitializationListener
-
run
public boolean run(Long taskId)
Description copied from interface:CustomScheduledTaskServiceLocalRuns the task with the given identifier, generating a log. Assumes there is no current transaction.- Specified by:
runin interfaceCustomScheduledTaskServiceLocal
-
runNow
public void runNow(CustomScheduledTaskVO vo) throws FrameworkException
Description copied from interface:CustomScheduledTaskServiceTriggers a manual execution of the given task- Specified by:
runNowin interfaceCustomScheduledTaskService- Throws:
FrameworkException
-
searchLogs
public Page<CustomScheduledTaskLogVO> searchLogs(CustomScheduledTaskLogQuery params) throws FrameworkException
Description copied from interface:CustomScheduledTaskServiceSearches for a task execution logs- Specified by:
searchLogsin interfaceCustomScheduledTaskService- Throws:
FrameworkException
-
getData
protected CustomScheduledTaskData getData(CustomScheduledTask customScheduledTask)
Description copied from class:CRUDServiceImplReturns details data for the given entity- Specified by:
getDatain classCRUDServiceImpl<CustomScheduledTask,QCustomScheduledTask,CustomScheduledTaskDTO,CustomScheduledTaskData,Void>
-
onBeforeSave
protected Object onBeforeSave(CustomScheduledTask task, CustomScheduledTask currentCopy)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic before saving an entity. Any returned value will be passed to theCRUDServiceImpl.onAfterSave(BaseEntity, BaseEntity, Object)method- Overrides:
onBeforeSavein classCRUDServiceImpl<CustomScheduledTask,QCustomScheduledTask,CustomScheduledTaskDTO,CustomScheduledTaskData,Void>
-
registerNetworkMappings
protected void registerNetworkMappings(NetworkPathRegistry networkPathRegistry)
Description copied from class:BaseServiceImplNeeds to be overridden by subclasses to register the path up to the network- Specified by:
registerNetworkMappingsin classBaseServiceImpl
-
resolveValidator
protected Validator resolveValidator(CustomScheduledTaskDTO dto)
- Specified by:
resolveValidatorin classCRUDServiceImpl<CustomScheduledTask,QCustomScheduledTask,CustomScheduledTaskDTO,CustomScheduledTaskData,Void>
-
-