Re-structure LTTng sub-project as per the Linux Tools guidelines
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / 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.core.request;
14
15 import org.eclipse.linuxtools.tmf.core.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 block size (for BG requests)
61 */
62 public int getBlockSize();
63
64 /**
65 * @return the number of events read so far
66 */
67 public int getNbRead();
68
69 // ------------------------------------------------------------------------
70 // Request state
71 // ------------------------------------------------------------------------
72
73 public boolean isRunning();
74 public boolean isCompleted();
75 public boolean isFailed();
76 public boolean isCancelled();
77
78 // ------------------------------------------------------------------------
79 // Data handling
80 // ------------------------------------------------------------------------
81
82 public void handleData(T data);
83
84 // ------------------------------------------------------------------------
85 // Request handling
86 // ------------------------------------------------------------------------
87
88 public void handleStarted();
89 public void handleCompleted();
90 public void handleSuccess();
91 public void handleFailure();
92 public void handleCancel();
93
94 /**
95 * To suspend the client thread until the request completes
96 * (or is canceled).
97 */
98 public void waitForCompletion() throws InterruptedException;
99
100 // ------------------------------------------------------------------------
101 // Request state modifiers
102 // ------------------------------------------------------------------------
103
104 public void start();
105 public void done();
106 public void fail();
107 public void cancel();
108 }
This page took 0.033918 seconds and 5 git commands to generate.