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