Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a963fc06d72e45a76f54d387a844797d4b7a42c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
/*******************************************************************************
 * Copyright (c) 2011 Ericsson
 * 
 * All rights reserved. This program and the accompanying materials are
 * made available under the terms of the Eclipse Public License v1.0 which
 * accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *   Polytechnique Montréal - Initial API and implementation
 *   Bernd Hufmann - Productification, enhancements and fixes
 *   
 *******************************************************************************/
package org.eclipse.linuxtools.lttng.tracecontrol.model.config;

import org.eclipse.core.resources.IProject;


/**
 * <b><u>TraceChannel</u></b>
 * <p>
 *  This models a trace representing a trace resource for a particular remote system.
 * </p>
 */
public class TraceConfig {

    // ------------------------------------------------------------------------
    // Constants
    // ------------------------------------------------------------------------
	public static final int NORMAL_MODE = 0;
	public static final int FLIGHT_RECORDER_MODE = 1;
	
	public static final String InvalidTracePath = "network"; //$NON-NLS-1$
	
    // ------------------------------------------------------------------------
    // Attributes
    // ------------------------------------------------------------------------

    private String fTraceName = null;
    private String fTraceTransport = null;
    private String fTracePath = null;
    private boolean fIsNetworkTrace = false;
    private boolean fIsAppend = false;
    private int fMode = 0;
    private int fNumChannel = 0;
    private TraceChannels fChannels = null;
    private IProject fProject = null;

    // ------------------------------------------------------------------------
    // Constructors
    // ------------------------------------------------------------------------
    public TraceConfig() {
    }

    // ------------------------------------------------------------------------
    // Operations
    // ------------------------------------------------------------------------

    /**
     * Gets the number of threads
     * 
     * @return number of threads
     */
    public int getNumChannel() {
        return fNumChannel;
    }

    /**
     * Sets the number of threads (channels)
     * @param numChannel
     */
    public void setNumChannel(int numChannel) {
        fNumChannel = numChannel;
    }

    /**
     * Gets the trace name.
     * 
     * @return trace name
     */
    public String getTraceName() {
        return fTraceName;
    }

    /**
     * Sets the trace name.
     * 
     * @param traceName
     */
    public void setTraceName(String traceName) {
        fTraceName = traceName;
    }

    /** 
     * Gets the trace transport.
     * 
     * @return trace transport
     */
    public String getTraceTransport() {
        return fTraceTransport;
    }

    /**
     * Sets the trace transport.
     * 
     * @param traceTransport
     */
    public void setTraceTransport(String traceTransport) {
        fTraceTransport = traceTransport;
    }

    /**
     * Returns wether trace is a network trace (i.e. trace will be stored 
     * on local host where client resides) or a local trace (i.e. trace will
     * be stored on same machine where the actual trace is collected) 
     * 
     * @return isNetworktrace
     */
    public boolean isNetworkTrace() {
        return fIsNetworkTrace;
    }

    /**
     * Sets whether trace is a network trace (i.e. trace will be stored 
     * on local host where client resides) or a local trace (i.e. trace will
     * be stored on same machine where the actual trace is collected) 
     * 
     * @param isNetworkTrace
     */
    public void setNetworkTrace(boolean isNetworkTrace) {
        fIsNetworkTrace = isNetworkTrace;
    }

    /**
     * Returns whether trace should append an existing trace or not.
     *  
     * @return true if append else false
     */
    public boolean getIsAppend() {
        return fIsAppend;
    }

    /**
     * Sets whether trace should append an existing trace or not.
     * 
     * @param isAppend
     */
    public void setIsAppend(boolean isAppend) {
        fIsAppend = isAppend;
    }

    /** 
     * Gets the trace mode.
     * 
     * @return trace mode
     */
    public int getMode() {
        return fMode;
    }

    /** 
     * Sets the trace mode.
     * 
     * @param mode
     */
    public void setMode(int mode) {
        fMode = mode;
    }

    /**
     * Gets the path where trace will be stored.
     * 
     * @return trace path
     */
    public String getTracePath() {
        return fTracePath;
    }

    /**
     * Sets the path where trace will be stored.
     * 
     * @param path
     */
    public void setTracePath(String path) {
        fTracePath = path;
    }
    
    /**
     * Gets the trace channels collection.
     * 
     * @return trace channels
     */
    public TraceChannels getTraceChannels() {
        return fChannels;
    }
    
    /**
     * Sets the trace channels collection.
     * 
     * @param channels
     */
    public void setTraceChannels(TraceChannels channels) {
        fChannels = channels;
    }
    
    /**
     * Sets the trace channels collection with given names
     * and creates default trace channels.
     * 
     * @param channels
     */
    public void setTraceChannels(String[] channels) {
        fChannels = new TraceChannels();
        fChannels.putAll(channels);
    }
    
    /**
     * Gets the trace project.
     * 
     * @return project
     */
    public IProject getProject() {
        return fProject;
    }
    
    /**
     * Sets the trace project.
     * 
     * @param project
     */
    public void setProject(IProject project) {
        fProject = project;
    }
    
}

Back to the top