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