KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jmeter > protocol > http > control > Authorization


1 // $Header: /home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/control/Authorization.java,v 1.6.2.1 2004/10/23 19:39:08 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.protocol.http.control;
20
21 import java.io.Serializable JavaDoc;
22
23 import org.apache.jmeter.config.ConfigElement;
24 import org.apache.jmeter.testelement.AbstractTestElement;
25
26 /**
27  * This class is an Authorization encapsulator.
28  *
29  * @author <a HREF="mailto:luta.raphael@networks.vivendi.net">Raphael Luta</a>
30  * @version $Revision: 1.6.2.1 $
31  */

32 public class Authorization extends AbstractTestElement implements Serializable JavaDoc
33 {
34     private static String JavaDoc URL = "Authorization.url";
35     private static String JavaDoc USERNAME = "Authorization.username";
36     private static String JavaDoc PASSWORD = "Authorization.password";
37     /**
38      * create the authorization
39      */

40     Authorization(String JavaDoc url, String JavaDoc user, String JavaDoc pass)
41     {
42         setURL(url);
43         setUser(user);
44         setPass(pass);
45     }
46
47     public boolean expectsModification()
48     {
49         return false;
50     }
51
52     public Authorization()
53     {
54         setURL("");
55         setUser("");
56         setPass("");
57     }
58
59     public String JavaDoc getClassLabel()
60     {
61         return "Authorization";
62     }
63
64     public void addConfigElement(ConfigElement config)
65     {
66     }
67
68     public synchronized String JavaDoc getURL()
69     {
70         return getPropertyAsString(URL);
71     }
72     public synchronized void setURL(String JavaDoc url)
73     {
74         setProperty(URL, url);
75     }
76     public synchronized String JavaDoc getUser()
77     {
78         return getPropertyAsString(USERNAME);
79     }
80     public synchronized void setUser(String JavaDoc user)
81     {
82         setProperty(USERNAME, user);
83     }
84     public synchronized String JavaDoc getPass()
85     {
86         return getPropertyAsString(PASSWORD);
87     }
88     public synchronized void setPass(String JavaDoc pass)
89     {
90         setProperty(PASSWORD, pass);
91     }
92     public String JavaDoc toString()
93     {
94         return getURL() + "\t" + getUser() + "\t" + getPass();
95     }
96 }
97
Popular Tags