View Javadoc

1   /*
2    * Copyright 2001-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.juddi.datatype.publisher;
17  
18  import org.apache.juddi.datatype.Name;
19  import org.apache.juddi.datatype.RegistryObject;
20  
21  /***
22   * @author Steve Viens (sviens@apache.org)
23   */
24  public class Publisher implements RegistryObject
25  {
26  	private String publisherID;
27  	private String nameValue;
28  	private String emailAddress;
29  	private boolean admin;
30  	private boolean enabled;  
31  	private int maxBusinesses;
32  	private int maxServicesPerBusiness;
33  	private int maxBindingsPerService;
34  	private int maxTModels;
35  
36  	/***
37  	 *
38  	 */
39  	public Publisher()
40  	{
41  	}
42  
43  	/***
44  	 *
45  	 */
46  	public Publisher(String pubID,String name)
47  	{
48  	    this.publisherID = pubID;
49  	    this.nameValue = name;
50  	}
51  
52  	/***
53  	 *
54  	 */
55  	public Publisher(String pubID,String name,boolean adminValue)
56  	{
57  		this(pubID,name);
58  		this.admin = adminValue;
59  	}
60  
61  	/***
62  	 *
63  	 */
64  	public void setPublisherID(String pubID)
65  	{
66  		this.publisherID = pubID;
67  	}
68  
69  	/***
70  	 *
71  	 */
72  	public String getPublisherID()
73  	{
74  		return this.publisherID;
75  	}
76  
77  	/***
78  	 * Sets the name of this Publisher to the given name.
79  	 *
80  	 * @param name The new name of this Publisher.
81  	 */
82  	public void setName(String name)
83  	{
84  		this.nameValue = name;
85  	}
86  	
87  	/***
88  	 * Returns the name of this Publisher as a String.
89  	 *
90  	 * @return The name of this Publisher.
91  	 */
92  	public String getName()
93  	{
94  	    return this.nameValue;
95  	}
96  
97  	/***
98  	 * Sets the name of this Publisher to the given name.
99  	 *
100 	 * @param name The new name of this Publisher.
101 	 */
102 	public void setName(Name name)
103 	{
104 	    if (name != null)
105 	    	this.nameValue = name.getValue();
106 	    else
107 	    	this.nameValue = null;
108 	}
109 
110 	/***
111 	 *
112 	 */
113 	public void setEmailAddress(String email)
114 	{
115 		this.emailAddress = email;
116 	}
117 
118     /***
119      *
120      */
121     public String getEmailAddress()
122   	{
123     	return this.emailAddress;
124   	}
125 
126     /***
127      *
128      */
129     public void setAdmin(boolean adminValue)
130     {
131     	this.admin = adminValue;
132     }
133 
134     /***
135      *
136      */
137   	public void setAdminValue(String adminValue)
138   	{
139 	    if (adminValue == null)
140 	      this.admin = false;
141 	    else
142 	      this.admin = (adminValue.equalsIgnoreCase("true"));
143   	}
144 
145   	/***
146 	 *
147 	 */
148 	public boolean isAdmin()
149 	{
150 		return this.admin;
151 	}
152 
153 	/***
154 	 *
155 	 */
156 	public void setEnabled(boolean enabledValue)
157 	{
158 		this.enabled = enabledValue;
159 	}
160 
161 	/***
162 	 *
163 	 */
164 	public void setEnabledValue(String enabledValue)
165 	{
166 		if (enabledValue == null)
167 			this.enabled = false;
168 		else
169 			this.enabled = (enabledValue.equalsIgnoreCase("true"));
170 	}
171 
172 	/***
173 	 *
174 	 */
175 	public boolean isEnabled()
176 	{
177 		return this.enabled;
178 	}
179 
180 	/***
181 	 *
182 	 */
183 	public void setMaxBusinesses(int max)
184 	{
185 		this.maxBusinesses = max;
186 	}
187 	
188 	/***
189 	 *
190 	 */
191 	public int getMaxBusinesses()
192 	{
193 		return this.maxBusinesses;
194 	}
195 	
196 	/***
197 	 *
198 	 */
199 	public void setMaxServicesPerBusiness(int max)
200 	{
201 		this.maxServicesPerBusiness = max;
202 	}
203 	
204 	/***
205 	 *
206 	 */
207 	public int getMaxServicesPerBusiness()
208 	{
209 		return this.maxServicesPerBusiness;
210 	}
211 	
212 	/***
213 	 *
214 	 */
215 	public void setMaxBindingsPerService(int max)
216 	{
217 		this.maxBindingsPerService = max;
218 	}
219 	
220 	/***
221 	 *
222 	 */
223 	public int getMaxBindingsPerService()
224 	{
225 		return this.maxBindingsPerService;
226 	}
227 	
228 	/***
229 	 *
230 	 */
231 	public void setMaxTModels(int max)
232 	{
233 		this.maxTModels = max;
234 	}
235 	
236 	/***
237 	 *
238 	 */
239 	public int getMaxTModels()
240 	{
241 		return this.maxTModels;
242 	}
243 }