1 /*******************************************************************************
2 * Copyright (c) 2009, 2014 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
37 static final int ALL_DATA
= Integer
.MAX_VALUE
;
40 * The request execution type/priority
46 * Backgroung, long-running, lower priority request
50 * Foreground, short-running, high priority request
55 // ------------------------------------------------------------------------
57 // ------------------------------------------------------------------------
60 * @return request data type (T)
62 Class
<?
extends ITmfEvent
> getDataType();
73 ExecutionType
getExecType();
76 * @return the index of the first event requested
81 * @return the number of requested events
86 * @return the number of events read so far
91 * @return the requested time range
93 TmfTimeRange
getRange();
96 * @return the event provider filter to verify if an event is provided by
97 * the relevant event provider.
99 ITmfFilter
getProviderFilter();
102 * Sets a provider filter to verify if an event is provided by the relevant
106 * event provider filter to set
108 void setProviderFilter(ITmfFilter filter
);
110 // ------------------------------------------------------------------------
111 // Request state predicates
112 // ------------------------------------------------------------------------
115 * @return true if the request is still active
120 * @return true if the request is completed
122 boolean isCompleted();
125 * @return true if the request has failed
130 * @return true if the request was cancelled
132 boolean isCancelled();
134 // ------------------------------------------------------------------------
136 // ------------------------------------------------------------------------
139 * Process the piece of data
142 * The trace event to process
144 void handleData(@NonNull ITmfEvent event
);
146 // ------------------------------------------------------------------------
147 // Request notifications
148 // ------------------------------------------------------------------------
151 * Request processing start notification
153 void handleStarted();
156 * Request processing completion notification
158 void handleCompleted();
161 * Request successful completion notification
163 void handleSuccess();
166 * Request failure notification
168 void handleFailure();
171 * Request cancellation notification
176 * To suspend the client thread until the request completes (or is
179 * @throws InterruptedException
180 * thrown if the request was cancelled
182 void waitForCompletion() throws InterruptedException
;
184 // ------------------------------------------------------------------------
185 // Request state modifiers
186 // ------------------------------------------------------------------------
189 * Put the request in the running state
194 * Put the request in the completed state
199 * Put the request in the failed completed state
204 * Put the request in the cancelled completed state
208 // ------------------------------------------------------------------------
210 // ------------------------------------------------------------------------
213 * This method is called by the event provider to set the index
214 * corresponding to the time range start time
217 * The start time index
219 void setStartIndex(int index
);
This page took 0.03517 seconds and 5 git commands to generate.