KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jmeter > protocol > tcp > config > TCPConfig


1 // $Header: /home/cvs/jakarta-jmeter/src/protocol/tcp/org/apache/jmeter/protocol/tcp/config/TCPConfig.java,v 1.3 2004/03/30 18:08:09 sebb Exp $
2
/*
3  * Copyright 2003-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.protocol.tcp.config;
20
21 import java.io.Serializable JavaDoc;
22
23 import org.apache.jmeter.config.ConfigTestElement;
24 import org.apache.jmeter.protocol.tcp.sampler.TCPSampler;
25
26 /**
27  * @version $Revision: 1.3 $ $Date: 2004/03/30 18:08:09 $
28  */

29 public class TCPConfig extends ConfigTestElement implements Serializable JavaDoc
30 {
31
32     public TCPConfig()
33     {
34     }
35
36     public void setServer(String JavaDoc newServer)
37     {
38         this.setProperty(TCPSampler.SERVER, newServer);
39     }
40     public String JavaDoc getServer()
41     {
42         return getPropertyAsString(TCPSampler.SERVER);
43     }
44     
45     public void setPort(String JavaDoc newPort)
46     {
47         this.setProperty(TCPSampler.PORT, newPort);
48     }
49     public int getPort()
50     {
51         return getPropertyAsInt(TCPSampler.PORT);
52     }
53
54     public void setFilename(String JavaDoc newFilename)
55     {
56         this.setProperty(TCPSampler.FILENAME, newFilename);
57     }
58     public String JavaDoc getFilename()
59     {
60         return getPropertyAsString(TCPSampler.FILENAME);
61     }
62
63
64     /**
65      * Returns a formatted string label describing this sampler
66      * Example output:
67      * Tcp://Tcp.nowhere.com:port
68      *
69      * @return a formatted string label describing this sampler
70      */

71     public String JavaDoc getLabel()
72     {
73         return ("tcp://" + this.getServer() + ":" + this.getPort());
74     }
75 }
76
Popular Tags