001/**
002 * Copyright (C) 2014  Universidade de Aveiro, DETI/IEETA, Bioinformatics Group - http://bioinformatics.ua.pt/
003 *
004 * This file is part of Dicoogle/dicoogle.
005 *
006 * Dicoogle/dicoogle is free software: you can redistribute it and/or modify
007 * it under the terms of the GNU General Public License as published by
008 * the Free Software Foundation, either version 3 of the License, or
009 * (at your option) any later version.
010 *
011 * Dicoogle/dicoogle is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014 * GNU General Public License for more details.
015 *
016 * You should have received a copy of the GNU General Public License
017 * along with Dicoogle.  If not, see <http://www.gnu.org/licenses/>.
018 */
019package pt.ua.dicoogle.rGUI.client.signals;
020
021import java.rmi.RemoteException;
022import pt.ua.dicoogle.rGUI.client.UIHelper.Result2Tree;
023import pt.ua.dicoogle.rGUI.interfaces.signals.ISearchSignal;
024
025/**
026 *
027 * @author Samuel Campos <samuelcampos@ua.pt>
028 */
029@Deprecated
030public class SearchSignal implements ISearchSignal {
031    private Result2Tree result;
032
033    public SearchSignal(Result2Tree result) throws NullPointerException{
034        if (result == null)
035            throw new NullPointerException("main can't be null");
036
037        this.result = result;
038    }
039
040    /**
041     *
042     * @param flag
043     *              0 - new ArrayList<SearchResult> with the local results
044     *              1 - new ArrayList<SearchResultP2P> with the P2P results
045     *              2 - new SearchTime
046     *              3 - new ArrayList<SearchResultP2P> with P2P Thumbnails requested
047     *              4 - new ArrayList<SearchResult> with the results
048     *              5 - Finish search
049     * @throws RemoteException
050     */
051    @Override
052    public void sendSearchSignal(int flag) throws RemoteException {
053        switch(flag){
054            case 0:
055                result.getLocalSearchResults();
056                break;
057
058            case 1:
059                result.getP2PSearchResults();
060                break;
061
062            case 2:
063                result.getSearchTime();
064                break;
065
066            case 3:
067                result.getPendingP2PThumbnails();
068                break;
069
070            case 4:
071                result.getExportSearchResults();
072                break;
073                
074            case 5:
075                result.finishSearch();
076                break;
077     
078                
079
080        }
081    }
082
083}