/** * Sets the task id as a private task parameter. * * @param task a nexus task * @param id task id */ public static void setId( final SchedulerTask<?> task, final String id ) { if( id == null || id.trim().length() == 0 ) { task.getParameters().remove( NexusTask.ID_KEY ); } else { task.addParameter( NexusTask.ID_KEY, id ); } }
public Map<String, String> getTaskParams() { if (SchedulerTask.class.isAssignableFrom(getCallable().getClass())) { return ((SchedulerTask<?>) getCallable()).getParameters(); } return Collections.emptyMap(); }
if (!((SchedulerTask<?>) getCallable()).allowConcurrentExecution(getScheduler().getActiveTasks())) { if (nextRun != null) {
nexusTask.addParameter( prop.getKey(), prop.getValue() );
public Map<String, String> getTaskParams() { if ( SchedulerTask.class.isAssignableFrom( getCallable().getClass() ) ) { return ( (SchedulerTask<?>) getCallable() ).getParameters(); } return Collections.emptyMap(); }
if ( !( (SchedulerTask<?>) getCallable() ).allowConcurrentExecution( getScheduler().getActiveTasks() ) )
/** * Sets the task name as a private task parameter. * * @param task a nexus task * @param name task name */ public static void setName( final SchedulerTask<?> task, final String name ) { if( name == null || name.trim().length() == 0 ) { task.getParameters().remove( NexusTask.NAME_KEY ); } else { task.addParameter( NexusTask.NAME_KEY, name ); } }
/** * Sets the email address to which an email should be sent in case of task failure. * If the alert email is not set (null or empty) no email should be sent.<br/> * The alert email is stored as a private task parameter. * * @param task a nexus task * @param email alert email address */ public static void setAlertEmail( final SchedulerTask<?> task, final String email ) { if( email == null || email.trim().length() == 0 ) { task.getParameters().remove( NexusTask.ALERT_EMAIL_KEY ); } else { task.addParameter( NexusTask.ALERT_EMAIL_KEY, email ); } }