Statistics
| Revision:

gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.lib / src / main / java / org / gvsig / tools / task / TaskStatusManager.java @ 1719

History | View | Annotate | Download (3.2 KB)

1 802 cordinyana
/**
2
 * gvSIG. Desktop Geographic Information System.
3 445 jjdelcerro
 *
4 802 cordinyana
 * Copyright (C) 2007-2013 gvSIG Association.
5 445 jjdelcerro
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21 802 cordinyana
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23 445 jjdelcerro
 */
24
package org.gvsig.tools.task;
25
26 449 jjdelcerro
import java.util.Map;
27
28 445 jjdelcerro
import org.gvsig.tools.observer.Observable;
29
30
/**
31
 * @author gvSIG Team
32
 * @version $Id$
33 450 jjdelcerro
 *
34 445 jjdelcerro
 */
35
public interface TaskStatusManager extends Observable {
36
37 450 jjdelcerro
        /**
38
         * Add the TaskStatus to the TaskStatusManager. If TaskStatus already in the
39
         * manager this is updated.
40
         *
41
         * @param taskStatus to add to the manager
42
         */
43
        public void add(TaskStatus taskStatus);
44
45
        /**
46
         * Retrieve a TaskStatus from the manager by code.
47
         *
48
         * @param code of the TaskStatus to retrieve
49
         * @return
50
         */
51
        public TaskStatus get(String code);
52
53
        /**
54
         * Remove the TaskStatus by the passed code from the manager
55
         *
56
         * @param code of the TaskStatus to remove
57
         */
58
        public void remove(String code);
59
60
        /**
61
         * Remove the TaskStatus from the mananger.
62
         *
63
         * @param taskStatus
64
         */
65
        public void remove(TaskStatus taskStatus);
66
67
        /**
68
         * Get a unmodifiable Map with all the TaskStatus in the
69
         * manager. The keys of map are the code of TaskStatus.
70
         *
71
         * @return Map of TaskStatus.
72
         */
73
        public Map getAll();
74
75 1719 jjdelcerro
        public boolean isEmpty();
76
77 450 jjdelcerro
        /**
78
         * Return a new code to a TaskStatus.
79
         *
80
         * @return
81
         */
82
        public String getNewCode();
83
84
        /**
85
         * Inform to the manager that this task status has changed.
86
         * This method has used by the implementation of TaskStatus
87
         * to inform to the manager of changes in a TaskStatus.
88
         *
89
         * @param taskstatus
90
         */
91
        public void update(TaskStatus taskstatus);
92
93 594 cordinyana
            /**
94
     * Create a new instance of the default implementation of a
95
     * SimpleTaskStatus.
96
     *
97
     * @param label
98
     *            used in the title of the new TaskStatus.
99
     *
100
     * @deprecated @see
101
     *             {@link TaskStatusManager#createDefaultSimpleTaskStatus(String)}
102
     *
103
     * @return the new SimpleTaskStatus.
104
     */
105 450 jjdelcerro
        public SimpleTaskStatus creteDefaultSimpleTaskStatus(String label);
106
107 594 cordinyana
    /**
108
     * Create a new instance of the default implementation of a
109
     * SimpleTaskStatus.
110
     *
111
     * @param label
112
     *            used in the title of the new TaskStatus.
113
     *
114
     * @return the new SimpleTaskStatus.
115
     */
116
    public SimpleTaskStatus createDefaultSimpleTaskStatus(String label);
117
118 457 jjdelcerro
        /**
119
         * Return the running task status most recent.
120
         *
121
         * @return
122
         */
123
        public TaskStatus getRunningTaskStatusMostRecent();
124 445 jjdelcerro
}