package pl.lusch.elastic.dc.collectors;

import org.elasticsearch.client.Client;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.RestController;

import pl.lusch.elastic.dc.scheduler.EveryFiveSeconds;

public class StatsCollector extends BaseCollector {
	
    @Inject	
    public StatsCollector(Settings settings, RestController controller, Client client) {
		super(settings, client);
	}

	@Override
	protected void getCollectorProperties() {
		// TODO get properties
	}
	
	@Override
	public void sheduleCollectionJob() {
		
		// Collection job
		final Runnable job = new Runnable() {
			public void run() {
				logger.info("running collection job");
			}
		};
		
		// run job every 5 seconds
		(new EveryFiveSeconds(job)).getJobHandle();
		
		logger.info("Stats Collector scheduled");
	}

}

@@ -34,16 +34,62 @@
 ctors;%0A%0A
+import java.util.concurrent.ScheduledFuture;%0A%0A
 import o
@@ -590,17 +590,16 @@
 ties%0A%09%7D%0A
-%09
 %0A%09@Overr
@@ -813,16 +813,47 @@
 conds%0A%09%09
+ScheduledFuture%3C?%3E jobHandle = 
 (new Eve
@@ -897,49 +897,71 @@
 %09%0A%09%09
-logger.info(%22Stats Collector scheduled%22);
+if(jobHandle.isDone()) %7B%0A%09%09%09logger.info(%22The job is done%22);%0A%09%09%7D
 %0A%09%7D%0A

add jobHandle