package de.afbb.bibo.share;

import java.net.ConnectException;
import java.util.Collection;

import de.afbb.bibo.share.model.Borrower;
import de.afbb.bibo.share.model.Copy;
import de.afbb.bibo.share.model.Medium;

public interface ICopyService {

	/**
	 * tries to read the medium information for given isbn number (database first -> if not found amazon API)
	 * 
	 * @param isbn
	 * @return
	 */
	Medium getMedium(String isbn) throws ConnectException;

	/**
	 * registers new copies and mediums as necessary
	 * 
	 * @param copy
	 *            collection of grouped copies.
	 * @throws ConnectException
	 */
	void registerCopy(Collection<Collection<Copy>> copy) throws ConnectException;

	/**
	 * gets a list of all copies of all mediums
	 * 
	 * @return
	 */
	Collection<Collection<Copy>> listAll() throws ConnectException;

	/**
	 * gets a list of all copies for a given medium
	 * 
	 * @return
	 */
	Collection<Collection<Copy>> listCopies(String isbn) throws ConnectException;

	/**
	 * returns a collection of borrowers that currently have lent a copy with the given isbn
	 * 
	 * @param isbn
	 * @return
	 * @throws ConnectException
	 */
	Collection<Borrower> listLent(String isbn) throws ConnectException;

}

@@ -247,24 +247,351 @@
 ervice %7B%0D%0A%0D%0A
+%09void update(Copy copy) throws ConnectException;%0D%0A%0D%0A%09/**%0D%0A%09 * gets all copies that are grouped to the given id%0D%0A%09 * %0D%0A%09 * @param id%0D%0A%09 *            of copy%0D%0A%09 * @return collection of all copies that are in the same group%0D%0A%09 * @throws ConnectException%0D%0A%09 */%0D%0A%09Collection%3CCopy%3E getGrouped(Integer id) throws ConnectException;%0D%0A%0D%0A
 %09/**%0D%0A%09 * tr

add new method to service