/**
 * Copyright © 2008-2009 DRIVER PROJECT (ICM UW)
 *
 * 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.resultset.impl.containers;

import eu.dnetlib.resultset.impl.IndexResultSetFaultMessage;
import eu.dnetlib.resultset.impl.ResultSetObject;

/**
 * ResultSetObject container interface.
 * @author Marek Horst
 * @version 0.01
 *
 */
public interface IResultSetObjectContainer {

	/**
	 * Retrieves ResultSetObject from container.
	 * @param rsId
	 * @return stored object
	 */
	public ResultSetObject get(String rsId);
	
	/**
	 * Retrieves ResultSetObject from container enriched with stored all data.
	 * @param rsId
	 * @return stored object with data
	 */
	public ResultSetObject getWithStoredData(String rsId);
	
	/**
	 * Returns ResultSetObject data.
	 * @param rsId
	 * @param fromPosition
	 * @param toPosition
	 * @throws IndexResultSetFaultMessage
	 * @return ResultSetObject data
	 */
	public String[] getData(String rsId, int fromPosition, int toPosition) 
		throws IndexResultSetFaultMessage;
	
	/**
	 * Stores ResultSetObject in container.
	 * @param rsObject
	 * @throws IndexResultSetFaultMessage
	 */
	public void store(ResultSetObject rsObject)
		throws IndexResultSetFaultMessage;
	
	/**
	 * Removes ResultSetObject from container.
	 * @param rsId
	 * @return removed object
	 */
	public ResultSetObject remove(String rsId);
	
	/**
	 * Cleans all outdated ResultSetObjects.
	 * Returns number of deleted ResultSetObjects.
	 * @return number of deleted ResultSetObjects
	 */
	public int cleanup();
	
}
