KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jmeter > save > DataSource


1 // $Header: /home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/save/DataSource.java,v 1.6 2004/02/13 02:21:36 sebb Exp $
2
/*
3  * Copyright 2001-2004 The Apache Software Foundation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17 */

18
19 package org.apache.jmeter.save;
20
21 import java.io.IOException JavaDoc;
22 import java.util.Collection JavaDoc;
23
24 import org.apache.jmeter.samplers.SampleResult;
25
26
27 /**
28  * TODO - does not appear to be used ...
29  *
30  * @version $Revision: 1.6 $
31  */

32 public interface DataSource
33 {
34     /** Content mask indicating the basic data points (label, time, success). */
35     public final static int BASE_INFO_MASK = 1;
36     
37     /**
38      * Content mask indicating various miscellenous data (thread_name,
39      * timstamp, response code, response message, data type).
40      */

41     public final static int EXTRA_INFO_MASK = 1 << 1;
42     
43     /**
44      * Content mask indicating that sub results should be included. The level
45      * of detail of the sub results will match that chosen for the main result.
46      */

47     public final static int SUB_RESULTS_MASK = 1 << 2;
48     
49     /** Content mask indicating that response data should be recorded. */
50     public final static int RESPONSE_MASK = 1 << 3;
51
52     /** Content mask indicating that request data should be recorded. */
53     public final static int REQUEST_DATA_MASK = 1 << 4;
54     
55     /** Content mask indicating that assertion messages should be recorded. */
56     public final static int ASSERTION_RESULTS_MASK = 1 << 5;
57
58     public final static int APPEND = 1;
59     public final static int OVERWRITE = 2;
60
61     /**
62      * Opens a file for recording sample results.
63      *
64      * @param mode indicates whether the file is opened for appending
65      * data to the end of the file or overwriting the file
66      * contents.
67      * @param contentMask mask defining what data is recorded. This is a
68      * combination of one or more of the content mask
69      * constants defined in this class (combined with bitwise
70      * 'or').
71      */

72     public void openSource(int mode, int contentMask) throws IOException JavaDoc;
73
74     /**
75      * Closes a file that had been opened for recording.
76      */

77     public void closeSource() throws IOException JavaDoc;
78
79     /**
80      * Load a file of previously recorded sample results and return them all in
81      * a collection.
82      */

83     public Collection JavaDoc loadLog() throws IOException JavaDoc;
84
85     /**
86      * Load a number of samples from the data source, starting from the next
87      * sample.
88      */

89     public Collection JavaDoc loadLog(int length) throws IOException JavaDoc;
90
91     /**
92      * Save a SampleResult object to the specified file. The file must have
93      * been initialized with a (link beginRecording(String,int,int,int)) call.
94      */

95     public void recordSample(SampleResult result) throws IOException JavaDoc;
96 }
97
Popular Tags