/**
 * Copyright 2008-2009 DRIVER PROJECT (ICM UW)
 * Original author: Marek Horst
 *
 * 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.index.ws.yadda;

public class DriverQuery {
	
	public static final int DEFAULT_SIZE = 100;
	
	private String cqlQuery;
	private String[] sruClauses;
	
//	mh: zmienilem schema na mdFormatId i dodalem layoutId
	private String mdFormatId;
	private String layoutId;
	public int startPosition;	
	public int size = DEFAULT_SIZE;
	private boolean iterateAll = false;

	/** Returns CQL query string */
	public String getCqlQuery() {
		return cqlQuery;
	}

	public void setCqlQuery(String cqlQuery) {
		this.cqlQuery = cqlQuery;
	}

	/** Returns SRU clauses */
	public String[] getSruClauses() {
		return sruClauses;
	}

	public void setSruClauses(String[] sruClauses) {
		this.sruClauses = sruClauses;
	}

	/** Returns position among all results from which returned results 
	 * should start (counting from 0).
	 */
	public int getStartPosition() {
		return startPosition;
	}
	public void setStartPosition(int startPosition) {
		this.startPosition = startPosition;
	}

	/** Returns maximal number of returned results. Number of returned results is smaller
	 * if and only if there is not enough results matching query.
	 */
	public int getSize() {
		return size;
	}
	public void setSize(int size) {
		this.size = size;
	}

	public String getLayoutId() {
		return layoutId;
	}
	public void setLayoutId(String layoutId) {
		this.layoutId = layoutId;
	}

	public String getMdFormatId() {
		return mdFormatId;
	}
	public void setMdFormatId(String mdFormatId) {
		this.mdFormatId = mdFormatId;
	}

	/**
	 * Returns iterateAll flag. If true efficient iteration over all documents
	 * in the index is triggered. Note that, if the flag is true
	 * cqlQuery should be empty.
	 * @return true if iterateAll flag enabled.
	 */
	public boolean isIterateAll() {
		return iterateAll;
	}
	public void setIterateAll(boolean iterateAll) {
		this.iterateAll = iterateAll;
	}

}
