1 // $Header: /home/cvs/jakarta-jmeter/src/protocol/ldap/org/apache/jmeter/protocol/ldap/config/LdapConfig.java,v 1.5 2004/02/13 02:40:55 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.ldap.config; 20 21 import java.io.Serializable; 22 23 import org.apache.jmeter.config.Arguments; 24 import org.apache.jmeter.config.ConfigTestElement; 25 import org.apache.jmeter.protocol.ldap.sampler.LDAPSampler; 26 import org.apache.jmeter.testelement.property.BooleanProperty; 27 import org.apache.jmeter.testelement.property.TestElementProperty; 28 29 /** 30 * This is model class for the LdapConfigGui. This will hold all the LDAP 31 * config value. 32 * 33 * @author T.Elanjchezhiyan(chezhiyan@siptech.co.in) - Sip Technologies and 34 * Exports Ltd. 35 * Created Apr 29 2003 11:45 AM 36 * @version $Revision: 1.5 $ Last Updated: $Date: 2004/02/13 02:40:55 $ 37 */ 38 public class LdapConfig extends ConfigTestElement implements Serializable 39 { 40 /** 41 * Constructor for the LdapConfig object. 42 */ 43 public LdapConfig() 44 { 45 } 46 47 /** 48 * Sets the Rootdn attribute of the LdapConfig object. 49 * 50 * @param newRootdn the new rootdn value 51 */ 52 public void setRootdn(String newRootdn) 53 { 54 this.setProperty(LDAPSampler.ROOTDN,newRootdn); 55 } 56 57 /** 58 * Gets the Rootdn attribute of the LdapConfig object. 59 * 60 * @return the Rootdn value 61 */ 62 public String getRootdn() 63 { 64 return getPropertyAsString(LDAPSampler.ROOTDN); 65 } 66 67 /** 68 * Sets the Test attribute of the LdapConfig object. 69 * 70 * @param newTest the new test value(Add,Modify,Delete and search) 71 */ 72 public void setTest(String newTest) 73 { 74 this.setProperty(LDAPSampler.TEST,newTest); 75 } 76 77 /** 78 * Gets the test attribute of the LdapConfig object. 79 * 80 * @return the test value (Add,Modify,Delete and search) 81 */ 82 public String getTest() 83 { 84 return getPropertyAsString(LDAPSampler.TEST); 85 } 86 87 /** 88 * Sets the UserDefinedTest attribute of the LdapConfig object. 89 * 90 * @param value the new UserDefinedTest value 91 */ 92 public void setUserDefinedTest(boolean value) 93 { 94 setProperty(new BooleanProperty(LDAPSampler.USER_DEFINED, value)); 95 } 96 97 /** 98 * Gets the UserDefinedTest attribute of the LdapConfig object. 99 * 100 * @return the test value true or false. If true it will do the 101 * UserDefinedTest else our own inbuilt test case. 102 */ 103 public boolean getUserDefinedTest() 104 { 105 return getPropertyAsBoolean(LDAPSampler.USER_DEFINED); 106 } 107 108 109 /** 110 * Sets the Arguments attribute of the LdapConfig object. 111 * This will collect values from the table for user defined test 112 * case. 113 * 114 * @param value the arguments 115 */ 116 public void setArguments(Arguments value) 117 { 118 setProperty(new TestElementProperty(LDAPSampler.ARGUMENTS, value)); 119 } 120 121 /** 122 * Gets the Arguments attribute of the LdapConfig object. 123 * 124 * @return the arguments. User defined test case. 125 */ 126 public Arguments getArguments() 127 { 128 return (Arguments) getProperty(LDAPSampler.ARGUMENTS).getObjectValue(); 129 } 130 131 /** 132 * Returns a formatted string label describing this sampler. 133 * 134 * @return a formatted string label describing this sampler 135 */ 136 public String getLabel() 137 { 138 return ("ldap://" + "this.getServername()" + "/" + this.getRootdn()); 139 } 140 }