// Path: src/org/gearman/core/GearmanCallbackHandler.java
// public interface GearmanCallbackHandler<D,R extends GearmanCallbackResult> {
// 	public void onComplete(D data, R result);
// }
// 
// Path: src/org/gearman/core/GearmanCallbackResult.java
// public interface GearmanCallbackResult {
// 	
// 	/**
// 	 * Tests if the operation completed successfully
// 	 * @return
// 	 * 		<code>true</code> if and only if the operation was successful
// 	 */
// 	public boolean isSuccessful();
// }


import org.gearman.core.GearmanCallbackHandler;
import org.gearman.core.GearmanCallbackResult;
package org.gearman;


/**
 * A GearmanCliet submits {@link GearmanJob}s and {@link GearmanBackgroundJob}s
 * to gearman job servers
 * 
 * @author isaiah.v
 */
public interface GearmanClient extends GearmanJobServerPool {
	
	/**
	 * 
	 * @author isaiah
	 *
	 */
	public static enum SubmitCallbackResult implements GearmanCallbackResult{
		
		/**
		 * The job was sucessfuly submitted to a job server 
		 */
		SUBMIT_SUCCESSFUL,
		
		/**
		 * Failed to send the job due to there being no job servers to
		 * submit to.
		 */
		FAILED_TO_NO_SERVER,
		
		/**
		 * 
		 */
		FAILED_TO_CONNECT,
		
		/**
		 * The job has already been submitted to a client and has not yet completed 
		 */
		FAILED_TO_INVALID_JOB_STATE,
		
		/**
		 * The {@link GearmanClient} is shutdown
		 */
		FAILED_TO_SHUTDOWN;
		
		@Override
		public boolean isSuccessful() {
			return this==SUBMIT_SUCCESSFUL;
		}
		
	}
	
// Path: src/org/gearman/core/GearmanCallbackHandler.java
// public interface GearmanCallbackHandler<D,R extends GearmanCallbackResult> {
// 	public void onComplete(D data, R result);
// }
// 
// Path: src/org/gearman/core/GearmanCallbackResult.java
// public interface GearmanCallbackResult {
// 	
// 	/**
// 	 * Tests if the operation completed successfully
// 	 * @return
// 	 * 		<code>true</code> if and only if the operation was successful
// 	 */
// 	public boolean isSuccessful();
// }


// Path: src/org/gearman/GearmanClient.java
import org.gearman.core.GearmanCallbackHandler;
import org.gearman.core.GearmanCallbackResult;

package org.gearman;


/**
 * A GearmanCliet submits {@link GearmanJob}s and {@link GearmanBackgroundJob}s
 * to gearman job servers
 * 
 * @author isaiah.v
 */
public interface GearmanClient extends GearmanJobServerPool {
	
	/**
	 * 
	 * @author isaiah
	 *
	 */
	public static enum SubmitCallbackResult implements GearmanCallbackResult{
		
		/**
		 * The job was sucessfuly submitted to a job server 
		 */
		SUBMIT_SUCCESSFUL,
		
		/**
		 * Failed to send the job due to there being no job servers to
		 * submit to.
		 */
		FAILED_TO_NO_SERVER,
		
		/**
		 * 
		 */
		FAILED_TO_CONNECT,
		
		/**
		 * The job has already been submitted to a client and has not yet completed 
		 */
		FAILED_TO_INVALID_JOB_STATE,
		
		/**
		 * The {@link GearmanClient} is shutdown
		 */
		FAILED_TO_SHUTDOWN;
		
		@Override
		public boolean isSuccessful() {
			return this==SUBMIT_SUCCESSFUL;
		}
		
	}
	
	public interface GearmanSubmitHandler extends GearmanCallbackHandler<GearmanJob, SubmitCallbackResult>{}