summaryrefslogblamecommitdiffstats
path: root/src/main/java/org/openslx/taskmanager/tasks/SleepTask.java
blob: 77c7a807b853b6c300d19292ff3ee41a3d8a1100 (plain) (tree)

































                                                                   
package org.openslx.taskmanager.tasks;

import org.openslx.taskmanager.api.AbstractTask;

import com.google.gson.annotations.Expose;

/**
 * Sleep Task that will just do what the name says.
 * Useful only when chaining tasks and you want a pause in between.
 */
public class SleepTask extends AbstractTask
{

	@Expose
	private int seconds = 0;

	@Override
	protected boolean initTask()
	{
		return true;
	}

	@Override
	protected boolean execute()
	{
		try {
			Thread.sleep( this.seconds * 1000 );
		} catch ( InterruptedException e ) {
			return false;
		}
		return true;
	}

}