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 */
019
020package pt.ua.dicoogle.rGUI.server.controllers;
021
022import java.rmi.RemoteException;
023import java.util.ArrayList;
024import java.util.concurrent.LinkedBlockingQueue;
025import org.apache.commons.lang.NotImplementedException;
026
027import pt.ua.dicoogle.rGUI.interfaces.controllers.ITaskList;
028import pt.ua.dicoogle.rGUI.interfaces.signals.ITaskListSignal;
029import pt.ua.dicoogle.sdk.task.Task;
030
031/**
032 *
033 * @author Luís A. Bastião Silva <bastiao@ua.pt>
034 */
035@Deprecated
036public class TaskList implements ITaskList
037{
038
039    private ITaskListSignal signalBack;
040    private static TaskList instance = null;
041
042    public static synchronized TaskList getInstance()
043    {
044
045        if (instance == null)
046        {
047            instance = new TaskList();
048        }
049        return instance;
050    }
051
052    public void resetSignalBack()
053    {
054        signalBack = null;
055    }
056
057    @Override
058    public void RegisterSignalBack(ITaskListSignal signalBack) throws RemoteException
059    {
060        this.signalBack = signalBack;
061    }
062
063    @Override
064    public ArrayList<String> getTaskList()  throws RemoteException
065    {
066
067        throw new NotImplementedException("Deprecated: RMI", null);
068    }
069
070
071    @Override
072    public void updatedTasks() throws RemoteException
073    {
074        if (signalBack!=null)
075            this.signalBack.sendTaskSignal(0);
076    }
077
078    @Override
079    public boolean isIndexing() throws RemoteException
080    {
081        throw new NotImplementedException("Deprecated: RMI", null);
082    }
083
084    @Override
085    public int getPercentCompleted() throws RemoteException
086    {
087        throw new NotImplementedException("Deprecated: RMI", null);
088
089    }
090
091}