1 /*******************************************************************************
2 * Copyright (c) 2010 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 * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation
11 * Marc Dumais (marc.dumais@ericsson.com) - Fix for 316455 (first part)
12 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.lttng
.request
;
15 import org
.eclipse
.linuxtools
.lttng
.event
.LttngEvent
;
16 import org
.eclipse
.linuxtools
.tmf
.event
.TmfTimeRange
;
17 import org
.eclipse
.linuxtools
.tmf
.event
.TmfTimestamp
;
18 import org
.eclipse
.linuxtools
.tmf
.experiment
.TmfExperiment
;
19 import org
.eclipse
.linuxtools
.tmf
.request
.ITmfDataRequest
;
20 import org
.eclipse
.linuxtools
.tmf
.request
.TmfEventRequest
;
23 * This class is an extension of Tmf Event Request which includes specific
24 * references i.e. a status listener to indicate the start and end of the
30 public abstract class LttngBaseEventRequest
extends TmfEventRequest
<LttngEvent
> {
32 // ========================================================================
34 // =======================================================================
35 private long numOfEvents
= 0;
36 private boolean clearDataInd
= false;
38 * The time to send events to the application as requested, Note: The start
39 * time of the request for base events is adjusted to the nearest check
42 private final TmfTimestamp fDispatchTime
;
44 // ========================================================================
46 // =======================================================================
56 public LttngBaseEventRequest(TmfTimeRange range
, TmfTimestamp dispatchTime
, long offset
, int nbEvents
,
57 int maxBlockSize
, ITmfDataRequest
.ExecutionType execType
) {
58 super(LttngEvent
.class, range
, (int) offset
, nbEvents
, maxBlockSize
, execType
);
59 fDispatchTime
= dispatchTime
;
63 public void cancel() {
67 // ========================================================================
69 // =======================================================================
72 * Trigger the start to process this request right after the notification to
73 * the interested listeners
77 * true: All views, false: only to registered listeners
79 public void startRequestInd(TmfExperiment
<LttngEvent
> experiment
,
81 // trigger the start to process this request
82 experiment
.sendRequest(this);
87 * the numOfEvents to set
89 public void setNumOfEvents(long numOfEvents
) {
90 this.numOfEvents
= numOfEvents
;
94 * @return the numOfEvents
96 public long getNumOfEvents() {
101 * @param clearAllData
102 * indicates the need to clear all previous data e.g. a new
103 * experiment selection
105 public void setclearDataInd(boolean clearAllData
) {
106 this.clearDataInd
= clearAllData
;
110 * Returns indication - clearing of all existing data model is required e.g
111 * from the selection of a new experiment
115 public boolean isclearDataInd() {
120 * @return The time to start dispatching events to the application
122 public TmfTimestamp
getDispatchTime() {
123 return fDispatchTime
;