(no commit message)
[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 // Accessors
26 // ------------------------------------------------------------------------
27
28 /**
29 * @return request data type (T)
30 */
31 public Class<T> getDataType();
32
33 /**
34 * @return request ID
35 */
36 public int getRequestId();
37
38 /**
39 * @return the index of the first event requested
40 */
41 public int getIndex();
42
43 /**
44 * @return the number of requested events
45 */
46 public int getNbRequested();
47
48 /**
49 * @return the block size
50 */
51 public int getBlockize();
52
53 /**
54 * @return the number of events read so far
55 */
56 public int getNbRead();
57
58 // ------------------------------------------------------------------------
59 // Request state
60 // ------------------------------------------------------------------------
61
62 public boolean isCompleted();
63 public boolean isFailed();
64 public boolean isCancelled();
65
66 // ------------------------------------------------------------------------
67 // Data handling
68 // ------------------------------------------------------------------------
69
70 public void setData(T[] data);
71 public T[] getData();
72 public void handleData();
73
74 // ------------------------------------------------------------------------
75 // Request handling
76 // ------------------------------------------------------------------------
77
78 public void handleCompleted();
79 public void handleSuccess();
80 public void handleFailure();
81 public void handleCancel();
82
83 /**
84 * To suspend the client thread until the request completes
85 * (or is canceled).
86 */
87 public void waitForCompletion() throws InterruptedException;
88
89 // ------------------------------------------------------------------------
90 // Request state modifiers
91 // ------------------------------------------------------------------------
92
93 public void done();
94 public void fail();
95 public void cancel();
96 }
This page took 0.032794 seconds and 5 git commands to generate.