/**
 * Copyright 2009-2012 OpenAIRE PROJECT (Bielefeld University)
 * Original author: Marek Imialek <marek.imialek at uni-bielefeld.de>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package eu.dnetlib.data.udm;

/**
 * The Class DeliveryPreferences keeps properties required for handling ResultSet
 * iterator and managing mdstore delivering threads. 
 * 
 * @author <a href="mailto:marek.imialek at uni-bielefeld.de">Marek Imialek</a>
 */
public class DeliveryPreferences {

	/** The maximal number of mdstore delivering threads. */
	private int maxMdstoreRequestThreads;

	/** The wait for closing threads. */
	private long waitForClosingThreads;

	/** The max wait for closing threads. */
	private long  maxWaitForClosingThreads;
	
	/** The rs queue size. */
	private int rsIteratorQueueSize;

	/** The rs package size. */
	private int rsPackageSize;

	/** The max rs iterator queue timeout. */
	private int maxQueueTimeout;

	/** The rs closing timeout. */
	private long rsClosingTimeout;

	/**
	 * Gets the maximal number of parallel mdstore deliver threads.
	 * 
	 * @return the maxMdstoreRequestThreads
	 */
	public int getMaxMdstoreRequestThreads() {
		return maxMdstoreRequestThreads;
	}

	/**
	 * Sets the maximal number of parallel mdstore deliver threads.
	 * 
	 * @param maxMdstoreRequestThreads the maxMdstoreRequestThreads to set
	 */
	public void setMaxMdstoreRequestThreads(int maxMdstoreRequestThreads) {
		this.maxMdstoreRequestThreads = maxMdstoreRequestThreads;
	}

	/**
	 * Getsthe temporary waiting time of single delivering thread 
	 * 
	 * @return the waitForClosingThreads
	 */
	public long getWaitForClosingThreads() {
		return waitForClosingThreads;
	}

	/**
	 * Sets the temporary waiting time of single delivering thread 
	 * 
	 * @param waitForClosingThreads the waitForClosingThreads to set
	 */
	public void setWaitForClosingThreads(long waitForClosingThreads) {
		this.waitForClosingThreads = waitForClosingThreads;
	}

	/**
	 * Gets the maximal waiting time of single delivering thread 
	 * 
	 * @return the maxWaitForClosingThreads
	 */
	public long getMaxWaitForClosingThreads() {
		return maxWaitForClosingThreads;
	}

	/**
	 * Sets the maximal waiting time of single delivering thread 
	 * 
	 * @param maxWaitForClosingThreads the maxWaitForClosingThreads to set
	 */
	public void setMaxWaitForClosingThreads(long maxWaitForClosingThreads) {
		this.maxWaitForClosingThreads = maxWaitForClosingThreads;
	}

	/**
	 * Gets the ResultSet iterator queue size
	 * 
	 * @return the rsIteratorQueueSize
	 */
	public int getRsIteratorQueueSize() {
		return rsIteratorQueueSize;
	}

	/**
	 * Sets the ResultSet iterator queue size
	 * 
	 * @param rsIteratorQueueSize the rsIteratorQueueSize to set
	 */
	public void setRsIteratorQueueSize(int rsIteratorQueueSize) {
		this.rsIteratorQueueSize = rsIteratorQueueSize;
	}

	/**
	 * Gets the size of package downloaded from Resultset 
	 * by the single request
	 * 
	 * @return the rsPackageSize
	 */
	public int getRsPackageSize() {
		return rsPackageSize;
	}

	/**
	 * Sets the size of package downloaded from Resultset 
	 * by the single request
	 * 
	 * @param rsPackageSize the rsPackageSize to set
	 */
	public void setRsPackageSize(int rsPackageSize) {
		this.rsPackageSize = rsPackageSize;
	}

	/**
	 * Gets the ResultSet iterator queue timeout.
	 * 
	 * @return the maxRSIteratorTimeout
	 */
	public int getMaxQueueTimeout() {
		return maxQueueTimeout;
	}

	/**
	 * Sets the ResultSet iterator queue timeout.
	 * 
	 * @param maxRSIteratorTimeout the maxRSIteratorTimeout to set
	 */
	public void setMaxQueueTimeout(int maxQueueTimeout) {
		this.maxQueueTimeout = maxQueueTimeout;
	}

	/**
	 * Gets the ResultSet closing timeout.
	 * 
	 * @return the rsClosingTimeout
	 */
	public long getRsClosingTimeout() {
		return rsClosingTimeout;
	}

	/**
	 * Sets the ResultSet closing timeout.
	 * 
	 * @param rsClosingTimeout the rsClosingTimeout to set
	 */
	public void setRsClosingTimeout(long rsClosingTimeout) {
		this.rsClosingTimeout = rsClosingTimeout;
	}
}
