Merge branch 'release/5.0.0'
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / IProgressMonitorService.java
1 /**
2 * Copyright (C) 2015 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9 package eu.etaxonomy.cdm.api.service;
10
11 import java.io.Serializable;
12 import java.util.UUID;
13
14 import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor;
15 import eu.etaxonomy.cdm.common.monitor.RemotingProgressMonitorThread;
16
17 /**
18 *
19 * Service interface to manage progress monitors
20 *
21 * @author cmathew
22 * @since 14 Oct 2015
23 *
24 */
25 public interface IProgressMonitorService {
26
27 /**
28 * Registers new remoting progress monitor
29 *
30 * @return uuid of remoting monitor
31 */
32 public UUID registerNewRemotingMonitor(RemotingProgressMonitorThread monitorThread);
33
34
35 /**
36 * Return remoting monitor corresponding to give uuid
37 *
38 * @param uuid of remoting monitor
39 * @return remoting monitor
40 */
41 public IRemotingProgressMonitor getRemotingMonitor(UUID uuid);
42
43 /**
44 * Sets the cancel flag to true for the monitor corresponding to the
45 * given uuid
46 *
47 * @param uuid of remoting monitor
48 */
49 public void cancel(UUID uuid);
50
51 /**
52 * Interrupt thread corresponding to remoting monitor with
53 * given uuid
54 *
55 * @param uuid of remoting monitor
56 */
57 public void interrupt(UUID uuid);
58
59 /**
60 * Checks whether thread corresponding to remoting monitor with
61 * given uuid is currently in progress
62 *
63 * @param uuid of remoting monitor
64 * @return true if corresponding thread is in progres, o/w false
65 */
66 public boolean isMonitorThreadRunning(UUID uuid);
67
68 public void setFeedback(UUID uuid, Serializable feedback);
69
70 }