1 /*******************************************************************************
2 * Copyright (c) 2009, 2015 Ericsson
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
10 * Francois Chouinard - Initial API and implementation
11 * Alexandre Montplaisir - Merge with ITmfDataRequest
12 *******************************************************************************/
14 package org
.eclipse
.tracecompass
.tmf
.core
.request
;
16 import org
.eclipse
.jdt
.annotation
.NonNull
;
17 import org
.eclipse
.tracecompass
.tmf
.core
.event
.ITmfEvent
;
18 import org
.eclipse
.tracecompass
.tmf
.core
.filter
.ITmfFilter
;
19 import org
.eclipse
.tracecompass
.tmf
.core
.timestamp
.TmfTimeRange
;
22 * The TMF event request
24 * @author Francois Chouinard
26 public interface ITmfEventRequest
{
28 // ------------------------------------------------------------------------
30 // ------------------------------------------------------------------------
33 * The request count for all the events
35 static final int ALL_DATA
= Integer
.MAX_VALUE
;
38 * The request execution type/priority
42 * Background, long-running, lower priority request.
46 * Foreground, short-running, high priority request.
51 // ------------------------------------------------------------------------
53 // ------------------------------------------------------------------------
56 * @return request data type (T)
58 Class
<?
extends ITmfEvent
> getDataType();
68 ExecutionType
getExecType();
71 * Gets the dependency level. Use different dependency level for requests
72 * that have a dependency with each other. They will be serviced separately.
77 default int getDependencyLevel() {
82 * @return the index of the first event requested
87 * @return the number of requested events
92 * @return the number of events read so far
97 * @return the requested time range
99 TmfTimeRange
getRange();
102 * @return the event provider filter to verify if an event is provided by
103 * the relevant event provider.
105 ITmfFilter
getProviderFilter();
108 * Sets a provider filter to verify if an event is provided by the relevant
112 * event provider filter to set
114 void setProviderFilter(ITmfFilter filter
);
116 // ------------------------------------------------------------------------
117 // Request state predicates
118 // ------------------------------------------------------------------------
121 * @return true if the request is still active
126 * @return true if the request is completed
128 boolean isCompleted();
131 * @return true if the request has failed
136 * @return true if the request was cancelled
138 boolean isCancelled();
140 // ------------------------------------------------------------------------
142 // ------------------------------------------------------------------------
145 * Process the piece of data
148 * The trace event to process
150 void handleData(@NonNull ITmfEvent event
);
152 // ------------------------------------------------------------------------
153 // Request notifications
154 // ------------------------------------------------------------------------
157 * Request processing start notification
159 void handleStarted();
162 * Request processing completion notification
164 void handleCompleted();
167 * Request successful completion notification
169 void handleSuccess();
172 * Request failure notification
174 void handleFailure();
177 * Request cancellation notification
182 * To suspend the client thread until the request completes (or is
185 * @throws InterruptedException
186 * thrown if the request was cancelled
188 void waitForCompletion() throws InterruptedException
;
190 // ------------------------------------------------------------------------
191 // Request state modifiers
192 // ------------------------------------------------------------------------
195 * Put the request in the running state
200 * Put the request in the completed state
205 * Put the request in the failed completed state
210 * Put the request in the cancelled completed state
214 // ------------------------------------------------------------------------
216 // ------------------------------------------------------------------------
219 * This method is called by the event provider to set the index
220 * corresponding to the time range start time
223 * The start time index
225 void setStartIndex(int index
);
This page took 0.035162 seconds and 5 git commands to generate.