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 * Backgroung, 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 * @return the index of the first event requested
76 * @return the number of requested events
81 * @return the number of events read so far
86 * @return the requested time range
88 TmfTimeRange
getRange();
91 * @return the event provider filter to verify if an event is provided by
92 * the relevant event provider.
94 ITmfFilter
getProviderFilter();
97 * Sets a provider filter to verify if an event is provided by the relevant
101 * event provider filter to set
103 void setProviderFilter(ITmfFilter filter
);
105 // ------------------------------------------------------------------------
106 // Request state predicates
107 // ------------------------------------------------------------------------
110 * @return true if the request is still active
115 * @return true if the request is completed
117 boolean isCompleted();
120 * @return true if the request has failed
125 * @return true if the request was cancelled
127 boolean isCancelled();
129 // ------------------------------------------------------------------------
131 // ------------------------------------------------------------------------
134 * Process the piece of data
137 * The trace event to process
139 void handleData(@NonNull ITmfEvent event
);
141 // ------------------------------------------------------------------------
142 // Request notifications
143 // ------------------------------------------------------------------------
146 * Request processing start notification
148 void handleStarted();
151 * Request processing completion notification
153 void handleCompleted();
156 * Request successful completion notification
158 void handleSuccess();
161 * Request failure notification
163 void handleFailure();
166 * Request cancellation notification
171 * To suspend the client thread until the request completes (or is
174 * @throws InterruptedException
175 * thrown if the request was cancelled
177 void waitForCompletion() throws InterruptedException
;
179 // ------------------------------------------------------------------------
180 // Request state modifiers
181 // ------------------------------------------------------------------------
184 * Put the request in the running state
189 * Put the request in the completed state
194 * Put the request in the failed completed state
199 * Put the request in the cancelled completed state
203 // ------------------------------------------------------------------------
205 // ------------------------------------------------------------------------
208 * This method is called by the event provider to set the index
209 * corresponding to the time range start time
212 * The start time index
214 void setStartIndex(int index
);
This page took 0.034943 seconds and 5 git commands to generate.