View Javadoc
1   /*
2    * Licensed under the GPL License. You may not use this file except in compliance with the License.
3    * You may obtain a copy of the License at
4    *
5    *   https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
6    *
7    * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
8    * WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
9    * PURPOSE.
10   */
11  package psiprobe.model;
12  
13  import java.util.ArrayList;
14  import java.util.Collection;
15  import java.util.Collections;
16  import java.util.List;
17  
18  /**
19   * A model class representing a servlet.
20   */
21  public class ServletInfo {
22  
23    /** The application name. */
24    private String applicationName;
25  
26    /** The servlet name. */
27    private String servletName;
28  
29    /** The servlet class. */
30    private String servletClass;
31  
32    /** The available. */
33    private boolean available;
34  
35    /** The load on startup. */
36    private int loadOnStartup;
37  
38    /** The run as. */
39    private String runAs;
40  
41    /** The error count. */
42    private int errorCount;
43  
44    /** The load time. */
45    private long loadTime;
46  
47    /** The max time. */
48    private long maxTime;
49  
50    /** The min time. */
51    private long minTime;
52  
53    /** The processing time. */
54    private long processingTime;
55  
56    /** The request count. */
57    private int requestCount;
58  
59    /** The single threaded. */
60    private boolean singleThreaded;
61  
62    /** The allocation count. */
63    private int allocationCount;
64  
65    /** The max instances. */
66    private int maxInstances;
67  
68    /** The mappings. */
69    private List<String> mappings;
70  
71    /**
72     * ServletInfo Constructor.
73     */
74    public ServletInfo() {
75      mappings = new ArrayList<>();
76    }
77  
78    /**
79     * Gets the application name.
80     *
81     * @return the application name
82     */
83    public String getApplicationName() {
84      return applicationName;
85    }
86  
87    /**
88     * Sets the application name.
89     *
90     * @param applicationName the new application name
91     */
92    public void setApplicationName(String applicationName) {
93      this.applicationName = applicationName;
94    }
95  
96    /**
97     * Gets the servlet name.
98     *
99     * @return the servlet name
100    */
101   public String getServletName() {
102     return servletName;
103   }
104 
105   /**
106    * Sets the servlet name.
107    *
108    * @param servletName the new servlet name
109    */
110   public void setServletName(String servletName) {
111     this.servletName = servletName;
112   }
113 
114   /**
115    * Gets the servlet class.
116    *
117    * @return the servlet class
118    */
119   public String getServletClass() {
120     return servletClass;
121   }
122 
123   /**
124    * Sets the servlet class.
125    *
126    * @param servletClass the new servlet class
127    */
128   public void setServletClass(String servletClass) {
129     this.servletClass = servletClass;
130   }
131 
132   /**
133    * Checks if is available.
134    *
135    * @return true, if is available
136    */
137   public boolean isAvailable() {
138     return available;
139   }
140 
141   /**
142    * Sets the available.
143    *
144    * @param available the new available
145    */
146   public void setAvailable(boolean available) {
147     this.available = available;
148   }
149 
150   /**
151    * Gets the load on startup.
152    *
153    * @return the load on startup
154    */
155   public int getLoadOnStartup() {
156     return loadOnStartup;
157   }
158 
159   /**
160    * Sets the load on startup.
161    *
162    * @param loadOnStartup the new load on startup
163    */
164   public void setLoadOnStartup(int loadOnStartup) {
165     this.loadOnStartup = loadOnStartup;
166   }
167 
168   /**
169    * Gets the run as.
170    *
171    * @return the run as
172    */
173   public String getRunAs() {
174     return runAs;
175   }
176 
177   /**
178    * Sets the run as.
179    *
180    * @param runAs the new run as
181    */
182   public void setRunAs(String runAs) {
183     this.runAs = runAs;
184   }
185 
186   /**
187    * Gets the error count.
188    *
189    * @return the error count
190    */
191   public int getErrorCount() {
192     return errorCount;
193   }
194 
195   /**
196    * Sets the error count.
197    *
198    * @param errorCount the new error count
199    */
200   public void setErrorCount(int errorCount) {
201     this.errorCount = errorCount;
202   }
203 
204   /**
205    * Gets the load time.
206    *
207    * @return the load time
208    */
209   public long getLoadTime() {
210     return loadTime;
211   }
212 
213   /**
214    * Sets the load time.
215    *
216    * @param loadTime the new load time
217    */
218   public void setLoadTime(long loadTime) {
219     this.loadTime = loadTime;
220   }
221 
222   /**
223    * Gets the max time.
224    *
225    * @return the max time
226    */
227   public long getMaxTime() {
228     return maxTime;
229   }
230 
231   /**
232    * Sets the max time.
233    *
234    * @param maxTime the new max time
235    */
236   public void setMaxTime(long maxTime) {
237     this.maxTime = maxTime;
238   }
239 
240   /**
241    * Gets the min time.
242    *
243    * @return the min time
244    */
245   public long getMinTime() {
246     return minTime;
247   }
248 
249   /**
250    * Sets the min time.
251    *
252    * @param minTime the new min time
253    */
254   public void setMinTime(long minTime) {
255     this.minTime = minTime;
256   }
257 
258   /**
259    * Gets the processing time.
260    *
261    * @return the processing time
262    */
263   public long getProcessingTime() {
264     return processingTime;
265   }
266 
267   /**
268    * Sets the processing time.
269    *
270    * @param processingTime the new processing time
271    */
272   public void setProcessingTime(long processingTime) {
273     this.processingTime = processingTime;
274   }
275 
276   /**
277    * Gets the request count.
278    *
279    * @return the request count
280    */
281   public int getRequestCount() {
282     return requestCount;
283   }
284 
285   /**
286    * Sets the request count.
287    *
288    * @param requestCount the new request count
289    */
290   public void setRequestCount(int requestCount) {
291     this.requestCount = requestCount;
292   }
293 
294   /**
295    * Checks if is single threaded.
296    *
297    * @return true, if is single threaded
298    */
299   public boolean isSingleThreaded() {
300     return singleThreaded;
301   }
302 
303   /**
304    * Sets the single threaded.
305    *
306    * @param singleThreaded the new single threaded
307    */
308   public void setSingleThreaded(boolean singleThreaded) {
309     this.singleThreaded = singleThreaded;
310   }
311 
312   /**
313    * Gets the allocation count.
314    *
315    * @return the allocation count
316    */
317   public int getAllocationCount() {
318     return allocationCount;
319   }
320 
321   /**
322    * Sets the allocation count.
323    *
324    * @param allocationCount the new allocation count
325    */
326   public void setAllocationCount(int allocationCount) {
327     this.allocationCount = allocationCount;
328   }
329 
330   /**
331    * Gets the max instances.
332    *
333    * @return the max instances
334    */
335   public int getMaxInstances() {
336     return maxInstances;
337   }
338 
339   /**
340    * Sets the max instances.
341    *
342    * @param maxInstances the new max instances
343    */
344   public void setMaxInstances(int maxInstances) {
345     this.maxInstances = maxInstances;
346   }
347 
348   /**
349    * Gets the mappings.
350    *
351    * @return the mappings
352    */
353   public List<String> getMappings() {
354     return mappings == null ? Collections.emptyList() : new ArrayList<>(mappings);
355   }
356 
357   /**
358    * Sets the mappings.
359    *
360    * @param mappings the new mappings
361    */
362   public void setMappings(Collection<String> mappings) {
363     this.mappings = mappings == null ? Collections.emptyList() : new ArrayList<>(mappings);
364   }
365 
366 }