2010-09-17 Francois Chouinard <fchouinard@gmail.com> Contribution for Bug325662
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf / src / org / eclipse / linuxtools / tmf / request / ITmfDataRequest.java
1 /*******************************************************************************
2 * Copyright (c) 2009, 2010 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Francois Chouinard - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.request;
14
15 import org.eclipse.linuxtools.tmf.event.TmfData;
16
17 /**
18 * <b><u>ITmfDataRequest</u></b>
19 * <p>
20 * TODO: Implement me. Please.
21 */
22 public interface ITmfDataRequest<T extends TmfData> {
23
24 // ------------------------------------------------------------------------
25 // Constants
26 // ------------------------------------------------------------------------
27
28 public enum ExecutionType { BACKGROUND, FOREGROUND };
29
30 // ------------------------------------------------------------------------
31 // Accessors
32 // ------------------------------------------------------------------------
33
34 /**
35 * @return request data type (T)
36 */
37 public Class<T> getDataType();
38
39 /**
40 * @return request ID
41 */
42 public int getRequestId();
43
44 /**
45 * @return request ID
46 */
47 public ExecutionType getExecType();
48
49 /**
50 * @return the index of the first event requested
51 */
52 public int getIndex();
53
54 /**
55 * @return the number of requested events
56 */
57 public int getNbRequested();
58
59 /**
60 * @return the number of events read so far
61 */
62 public int getNbRead();
63
64 // ------------------------------------------------------------------------
65 // Request state
66 // ------------------------------------------------------------------------
67
68 public boolean isRunning();
69 public boolean isCompleted();
70 public boolean isFailed();
71 public boolean isCancelled();
72
73 // ------------------------------------------------------------------------
74 // Data handling
75 // ------------------------------------------------------------------------
76
77 public void handleData(T data);
78
79 // ------------------------------------------------------------------------
80 // Request handling
81 // ------------------------------------------------------------------------
82
83 public void handleStarted();
84 public void handleCompleted();
85 public void handleSuccess();
86 public void handleFailure();
87 public void handleCancel();
88
89 /**
90 * To suspend the client thread until the request completes
91 * (or is canceled).
92 */
93 public void waitForCompletion() throws InterruptedException;
94
95 // ------------------------------------------------------------------------
96 // Request state modifiers
97 // ------------------------------------------------------------------------
98
99 public void start();
100 public void done();
101 public void fail();
102 public void cancel();
103 }
This page took 0.036442 seconds and 5 git commands to generate.