001package es.ucm.fdi.gaia.jcolibri.cbrcore; 002 003import java.util.Collection; 004 005import es.ucm.fdi.gaia.jcolibri.exception.InitializingException; 006 007/** 008 * Connector interface declares the methods required to access the cases stored in a persistence media. 009 * jCOLIBRI splits the managing of cases into persistence media and in-memory organization. This interface defines 010 * the access to de persistence and the CBRCaseBase interface defines the in-memory organization. Both interfaces 011 * are related as the CBRCaseBase manages the Connector. 012 * 013 * Implementations should read/write cases from Data Bases, Plain Text files, Ontologies, XML files, etc. 014 * 015 * @author Juan A. Recio-Garc�a 016 * @see CBRCaseBase 017 */ 018public interface Connector { 019 020 /** 021 * Initialices the connector with the given XML file 022 * 023 * @param file XMl file with the settings 024 * @throws InitializingException Raised if the connector can not be initialezed. 025 */ 026 void initFromXMLfile(java.net.URL file) throws InitializingException; 027 028 /** 029 * Cleanup any resource that the connector might be using, and suspends the 030 * service 031 */ 032 void close(); 033 034 /** 035 * Stores given classes on the storage media 036 * @param cases List of cases 037 */ 038 void storeCases(Collection<CBRCase> cases); 039 040 /** 041 * Deletes given cases for the storage media 042 * @param cases List of cases 043 */ 044 void deleteCases(Collection<CBRCase> cases); 045 046 /** 047 * Returns max cases without any special consideration 048 * @return The list of retrieved cases 049 */ 050 Collection<CBRCase> retrieveAllCases(); 051 052 /** 053 * Retrieves some cases depending on the filter. TODO. 054 */ 055 Collection<CBRCase> retrieveSomeCases(CaseBaseFilter filter); 056 057}