// 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/Pair.java
// public class Pair<T, U> {
// 	private T t;
// 	private U u;
// 
// 	public Pair(T t, U u) {
// 		super();
// 		this.t = t;
// 		this.u = u;
// 	}
// 	
// 	public T getT() {
// 		return t;
// 	}
// 
// 	public U getU() {
// 		return u;
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + ((t == null) ? 0 : t.hashCode());
// 		result = prime * result + ((u == null) ? 0 : u.hashCode());
// 		return result;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		@SuppressWarnings("unchecked")
// 		Pair<T, U> other = (Pair<T, U>) obj;
// 		if (t == null) {
// 			if (other.t != null)
// 				return false;
// 		} else if (!t.equals(other.t))
// 			return false;
// 		if (u == null) {
// 			if (other.u != null)
// 				return false;
// 		} else if (!u.equals(other.u))
// 			return false;
// 		return true;
// 	}
// 
// }
// 
// 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 com.google.inject.Inject;
import com.google.inject.Singleton;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Date;
import org.eclipse.jgit.lib.Repository;
import org.kercoin.magrit.core.Context;
import org.kercoin.magrit.core.Pair;
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 MonitorCommand extends AbstractCommand<MonitorCommand> implements BuildLifeCycleListener {

	@Singleton
// 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/Pair.java
// public class Pair<T, U> {
// 	private T t;
// 	private U u;
// 
// 	public Pair(T t, U u) {
// 		super();
// 		this.t = t;
// 		this.u = u;
// 	}
// 	
// 	public T getT() {
// 		return t;
// 	}
// 
// 	public U getU() {
// 		return u;
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + ((t == null) ? 0 : t.hashCode());
// 		result = prime * result + ((u == null) ? 0 : u.hashCode());
// 		return result;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		@SuppressWarnings("unchecked")
// 		Pair<T, U> other = (Pair<T, U>) obj;
// 		if (t == null) {
// 			if (other.t != null)
// 				return false;
// 		} else if (!t.equals(other.t))
// 			return false;
// 		if (u == null) {
// 			if (other.u != null)
// 				return false;
// 		} else if (!u.equals(other.u))
// 			return false;
// 		return true;
// 	}
// 
// }
// 
// 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/MonitorCommand.java
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Date;
import org.eclipse.jgit.lib.Repository;
import org.kercoin.magrit.core.Context;
import org.kercoin.magrit.core.Pair;
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 MonitorCommand extends AbstractCommand<MonitorCommand> implements BuildLifeCycleListener {

	@Singleton
	public static class MonitorCommandProvider implements CommandProvider<MonitorCommand>, org.kercoin.magrit.sshd.commands.AbstractCommand.EndCallback<MonitorCommand> {