// Path: server/core/src/main/java/org/kercoin/magrit/core/Context.java
// @Singleton
// public class Context {
// 	
// 	private final Configuration configuration = new Configuration();
// 	
// 	private Injector injector;
// 	
// 	private final GitUtils gitUtils;
// 	
// 	private final ExecutorService commandRunnerPool;
// 
// 	public Context() {
// 		gitUtils = null;
// 		commandRunnerPool = null;
// 	}
// 	
// 	public Context(GitUtils gitUtils) {
// 		this(gitUtils, null);
// 	}
// 	
// 	@Inject
// 	public Context(GitUtils gitUtils,
// 			@Named("commandRunnerPool") ExecutorService commandRunnerPool) {
// 		this.gitUtils = gitUtils;
// 		this.commandRunnerPool = commandRunnerPool;
// 	}
// 
// 	public Configuration configuration() {
// 		return configuration;
// 	}
// 	
// 	public Injector getInjector() {
// 		return injector;
// 	}
// 	
// 	public ExecutorService getCommandRunnerPool() {
// 		return commandRunnerPool;
// 	}
// 	
// 	public void setInjector(Injector injector) {
// 		this.injector = injector;
// 	}
// 	
// 	public GitUtils getGitUtils() {
// 		return gitUtils;
// 	}
// 
// }
// 
// Path: server/core/src/main/java/org/kercoin/magrit/core/build/BuildLifeCycleListener.java
// public interface BuildLifeCycleListener {
// 	
// 	void buildScheduled(Repository repo, String sha1);
// 	
// 	void buildStarted(Repository repo, String sha1);
// 
// 	void buildEnded(Repository repo, String sha1, Status status);
// }
// 
// Path: server/core/src/main/java/org/kercoin/magrit/core/build/QueueService.java
// @ImplementedBy(QueueServiceImpl.class)
// public interface QueueService {
// 	Future<BuildResult> enqueueBuild(UserIdentity committer, Repository repository,
// 			String sha1, String command, boolean force) throws Exception;
// 	
// 	void addCallback(BuildLifeCycleListener callback);
// 
// 	void removeCallback(BuildLifeCycleListener callback);
// 	
// 	Collection<Pair<Repository, String>> getScheduledTasks();
// 	Collection<Pair<Repository, String>> getCurrentTasks();
// 	
// }
// 
// Path: server/core/src/main/java/org/kercoin/magrit/core/build/Status.java
// public enum Status {
// 	RUNNING('R'),
// 	PENDING('P'),
// 	ERROR('E'),
// 	OK('O'),
// 	INTERRUPTED('I'),
// 	LOCAL('L'),
// 	NEW('N'),
// 	UNKNOWN('?');
// 	
// 	private char code;
// 	
// 	private Status(char code) { this.code = code; }
// 	
// 	public char getCode() {
// 		return code;
// 	}
// }


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.inject.Inject;
import java.io.IOException;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
import org.eclipse.jgit.lib.Repository;
import org.kercoin.magrit.core.Context;
import org.kercoin.magrit.core.build.BuildLifeCycleListener;
import org.kercoin.magrit.core.build.QueueService;
import org.kercoin.magrit.core.build.Status;
/*
Copyright 2011-2012 Frederic Menou and others referred in AUTHORS file.

This file is part of Magrit.

Magrit is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.

Magrit is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public
License along with Magrit.
If not, see <http://www.gnu.org/licenses/>.
*/
package org.kercoin.magrit.sshd.commands;




public class WaitForCommand extends AbstractCommand<WaitForCommand> implements BuildLifeCycleListener {

	private final Logger log = LoggerFactory.getLogger(getClass());

	public static class WaitForCommandProvider implements CommandProvider<WaitForCommand>,
	org.kercoin.magrit.sshd.commands.AbstractCommand.EndCallback<WaitForCommand>{
		
		private final Context ctx;
		
// Path: server/core/src/main/java/org/kercoin/magrit/core/Context.java
// @Singleton
// public class Context {
// 	
// 	private final Configuration configuration = new Configuration();
// 	
// 	private Injector injector;
// 	
// 	private final GitUtils gitUtils;
// 	
// 	private final ExecutorService commandRunnerPool;
// 
// 	public Context() {
// 		gitUtils = null;
// 		commandRunnerPool = null;
// 	}
// 	
// 	public Context(GitUtils gitUtils) {
// 		this(gitUtils, null);
// 	}
// 	
// 	@Inject
// 	public Context(GitUtils gitUtils,
// 			@Named("commandRunnerPool") ExecutorService commandRunnerPool) {
// 		this.gitUtils = gitUtils;
// 		this.commandRunnerPool = commandRunnerPool;
// 	}
// 
// 	public Configuration configuration() {
// 		return configuration;
// 	}
// 	
// 	public Injector getInjector() {
// 		return injector;
// 	}
// 	
// 	public ExecutorService getCommandRunnerPool() {
// 		return commandRunnerPool;
// 	}
// 	
// 	public void setInjector(Injector injector) {
// 		this.injector = injector;
// 	}
// 	
// 	public GitUtils getGitUtils() {
// 		return gitUtils;
// 	}
// 
// }
// 
// Path: server/core/src/main/java/org/kercoin/magrit/core/build/BuildLifeCycleListener.java
// public interface BuildLifeCycleListener {
// 	
// 	void buildScheduled(Repository repo, String sha1);
// 	
// 	void buildStarted(Repository repo, String sha1);
// 
// 	void buildEnded(Repository repo, String sha1, Status status);
// }
// 
// Path: server/core/src/main/java/org/kercoin/magrit/core/build/QueueService.java
// @ImplementedBy(QueueServiceImpl.class)
// public interface QueueService {
// 	Future<BuildResult> enqueueBuild(UserIdentity committer, Repository repository,
// 			String sha1, String command, boolean force) throws Exception;
// 	
// 	void addCallback(BuildLifeCycleListener callback);
// 
// 	void removeCallback(BuildLifeCycleListener callback);
// 	
// 	Collection<Pair<Repository, String>> getScheduledTasks();
// 	Collection<Pair<Repository, String>> getCurrentTasks();
// 	
// }
// 
// Path: server/core/src/main/java/org/kercoin/magrit/core/build/Status.java
// public enum Status {
// 	RUNNING('R'),
// 	PENDING('P'),
// 	ERROR('E'),
// 	OK('O'),
// 	INTERRUPTED('I'),
// 	LOCAL('L'),
// 	NEW('N'),
// 	UNKNOWN('?');
// 	
// 	private char code;
// 	
// 	private Status(char code) { this.code = code; }
// 	
// 	public char getCode() {
// 		return code;
// 	}
// }


// Path: server/sshd/src/main/java/org/kercoin/magrit/sshd/commands/WaitForCommand.java
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.inject.Inject;
import java.io.IOException;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
import org.eclipse.jgit.lib.Repository;
import org.kercoin.magrit.core.Context;
import org.kercoin.magrit.core.build.BuildLifeCycleListener;
import org.kercoin.magrit.core.build.QueueService;
import org.kercoin.magrit.core.build.Status;

/*
Copyright 2011-2012 Frederic Menou and others referred in AUTHORS file.

This file is part of Magrit.

Magrit is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.

Magrit is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public
License along with Magrit.
If not, see <http://www.gnu.org/licenses/>.
*/
package org.kercoin.magrit.sshd.commands;




public class WaitForCommand extends AbstractCommand<WaitForCommand> implements BuildLifeCycleListener {

	private final Logger log = LoggerFactory.getLogger(getClass());

	public static class WaitForCommandProvider implements CommandProvider<WaitForCommand>,
	org.kercoin.magrit.sshd.commands.AbstractCommand.EndCallback<WaitForCommand>{
		
		private final Context ctx;
		
		private final QueueService queueService;