KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > rice > rubis > client > RUBiSProperties


1 /*
2  * RUBiS
3  * Copyright (C) 2002, 2003, 2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Contact: jmob@objectweb.org
6  *
7  * This library is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation; either version 2.1 of the License, or any later
10  * version.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation,
19  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20  *
21  * Initial developer(s): Emmanuel Cecchet, Julie Marguerite
22  * Contributor(s): Jeremy Philippe, Niraj Tolia
23  */

24  package edu.rice.rubis.client;
25
26 import java.io.BufferedReader JavaDoc;
27 import java.io.FileReader JavaDoc;
28 import java.util.ResourceBundle JavaDoc;
29 import java.util.StringTokenizer JavaDoc;
30 import java.util.Vector JavaDoc;
31
32 /**
33  * This program check and get all information for the rubis.properties file
34  * found in the classpath.
35  *
36  * @author <a HREF="mailto:cecchet@rice.edu">Emmanuel Cecchet</a> and <a HREF="mailto:julie.marguerite@inrialpes.fr">Julie Marguerite</a>
37  * @version 1.0
38  */

39
40 public class RUBiSProperties
41 {
42   private static ResourceBundle JavaDoc configuration = null;
43   private URLGenerator urlGen = null;
44
45   // Information about web server
46
private String JavaDoc webSiteName;
47   private int webSitePort;
48   private String JavaDoc cjdbcSiteName;
49   private Vector JavaDoc EJBServers;
50   private String JavaDoc EJBHTMLPath;
51   private String JavaDoc EJBScriptPath;
52   private Vector JavaDoc ServletsServers;
53   private String JavaDoc ServletsHTMLPath;
54   private String JavaDoc ServletsScriptPath;
55   private String JavaDoc PHPHTMLPath;
56   private String JavaDoc PHPScriptPath;
57   private String JavaDoc useVersion;
58
59   // Information about Workload
60
private Vector JavaDoc remoteClients;
61   private String JavaDoc remoteCommand;
62   private int nbOfClients;
63   private String JavaDoc transitionTable;
64   private int nbOfColumns;
65   private int nbOfRows;
66   private int maxNbOfTransitions;
67   private boolean useTPCWThinkTime;
68   private int nbOfItemsPerPage;
69   private int upTime;
70   private float upSlowdown;
71   private int sessionTime;
72   private int downTime;
73   private float downSlowdown;
74
75   // Policy to generate database information
76
private Vector JavaDoc dbServers;
77   
78   private Integer JavaDoc nbOfUsers;
79
80   private int nbOfRegions;
81   private int nbOfCategories;
82   private Vector JavaDoc regions;
83   private Vector JavaDoc categories;
84   private int[] itemsPerCategory;
85   private int totalActiveItems;
86
87   private Integer JavaDoc nbOfOldItems;
88   private Float JavaDoc percentUniqueItems;
89   private Float JavaDoc percentReservePrice;
90   private Float JavaDoc percentBuyNow;
91   private Integer JavaDoc maxItemQty;
92   private Integer JavaDoc itemDescriptionLength;
93
94   private Integer JavaDoc maxBidsPerItem;
95
96   private Integer JavaDoc maxCommentsPerUser;
97   private Integer JavaDoc commentMaxLength;
98
99
100   // Monitoring information
101
private Integer JavaDoc monitoringDebug;
102   private String JavaDoc monitoringProgram;
103   private String JavaDoc monitoringOptions;
104   private Integer JavaDoc monitoringSampling;
105   private String JavaDoc monitoringRsh;
106   private String JavaDoc monitoringScp;
107   private String JavaDoc monitoringGnuPlot;
108   
109   /**
110    * Creates a new <code>RUBiSProperties</code> instance.
111    * If the rubis.properties file is not found in the classpath,
112    * the current thread is killed.
113    */

114   public RUBiSProperties()
115   {
116     // Get and check database.properties
117
System.out.println("Looking for rubis.properties in classpath ("+System.getProperty("java.class.path",".")+")<p>");
118     try
119     {
120       configuration = ResourceBundle.getBundle("rubis");
121     }
122     catch (java.util.MissingResourceException JavaDoc e)
123     {
124       System.err.println("No rubis.properties file has been found in your classpath.<p>");
125       Runtime.getRuntime().exit(1);
126     }
127   }
128
129   
130   /**
131    * Creates a new <code>RUBiSProperties</code> instance.
132    * If the filename.properties file is not found in the classpath,
133    * the current thread is killed.
134    *
135    * @param filename name of the property file
136    */

137   public RUBiSProperties(String JavaDoc filename)
138   {
139     // Get and check database.properties
140
System.out.println("Looking for "+filename+".properties in classpath ("+System.getProperty("java.class.path",".")+")<p>");
141     try
142     {
143       configuration = ResourceBundle.getBundle(filename);
144     }
145     catch (java.util.MissingResourceException JavaDoc e)
146     {
147       System.err.println("No "+filename+".properties file has been found in your classpath.<p>");
148       Runtime.getRuntime().exit(1);
149     }
150   }
151
152   
153   /**
154    * Returns the value corresponding to a property in the rubis.properties file.
155    *
156    * @param property the property name
157    * @return a <code>String</code> value
158    */

159   protected String JavaDoc getProperty(String JavaDoc property)
160   {
161     String JavaDoc s = configuration.getString(property);
162     return s;
163   }
164
165
166   /**
167    * Check for all needed fields in rubis.properties and inialize corresponding values.
168    * This function returns the corresponding URLGenerator on success.
169    *
170    * @return returns null on any error or the URLGenerator corresponding to the configuration if everything was ok.
171    */

172   public URLGenerator checkPropertiesFileAndGetURLGenerator()
173   {
174     try
175     {
176       // # HTTP server information
177
System.out.println("\n<h3>### HTTP server information ###</h3>");
178       System.out.print("Server name : ");
179       webSiteName = getProperty("httpd_hostname");
180       System.out.println(webSiteName+"<br>");
181       System.out.print("Server port : ");
182       Integer JavaDoc foo = new Integer JavaDoc(getProperty("httpd_port"));
183       webSitePort = foo.intValue();
184       System.out.println(webSitePort+"<br><br>");
185       System.out.print("CJDBC server name : ");
186       cjdbcSiteName = getProperty("cjdbc_hostname");
187       System.out.println(cjdbcSiteName+"<br>");
188
189       System.out.print("EJB Server : ");
190       StringTokenizer JavaDoc nodes = new StringTokenizer JavaDoc(getProperty("ejb_server"),",");
191       EJBServers = new Vector JavaDoc(nodes.countTokens());
192       while (nodes.hasMoreTokens())
193       {
194         String JavaDoc name = nodes.nextToken().trim();
195         EJBServers.add(name);
196         System.out.print(name);
197         if (nodes.hasMoreTokens())
198           System.out.print(", ");
199       }
200       System.out.println("<br>");
201       System.out.print("EJB HTML files path : ");
202       EJBHTMLPath = getProperty("ejb_html_path");
203       System.out.println(EJBHTMLPath+"<br>");
204       System.out.print("EJB Script files path : ");
205       EJBScriptPath = getProperty("ejb_script_path");
206       System.out.println(EJBScriptPath+"<br><br>");
207
208       System.out.print("Servlets server : ");
209       nodes = new StringTokenizer JavaDoc(getProperty("servlets_server"),",");
210       ServletsServers = new Vector JavaDoc(nodes.countTokens());
211       while (nodes.hasMoreTokens())
212       {
213         String JavaDoc name = nodes.nextToken().trim();
214         ServletsServers.add(name);
215         System.out.print(name);
216         if (nodes.hasMoreTokens())
217           System.out.print(", ");
218       }
219       System.out.println("<br>");
220       System.out.print("Servlets HTML files path : ");
221       ServletsHTMLPath = getProperty("servlets_html_path");
222       System.out.println(ServletsHTMLPath+"<br>");
223       System.out.print("Servlets Script files path : ");
224       ServletsScriptPath = getProperty("servlets_script_path");
225       System.out.println(ServletsScriptPath+"<br><br>");
226
227       System.out.print("PHP HTML files path : ");
228       PHPHTMLPath = getProperty("php_html_path");
229       System.out.println(PHPHTMLPath+"<br>");
230       System.out.print("PHP Script files path : ");
231       PHPScriptPath = getProperty("php_script_path");
232       System.out.println(PHPScriptPath+"<br><br>");
233       
234       // # Workload
235
System.out.println("\n<h3><br>### Workload ###</h3>");
236       System.out.print("Remote client nodes : ");
237       nodes = new StringTokenizer JavaDoc(getProperty("workload_remote_client_nodes"),",");
238       remoteClients = new Vector JavaDoc(nodes.countTokens());
239       while (nodes.hasMoreTokens())
240       {
241         String JavaDoc name = nodes.nextToken().trim();
242         remoteClients.add(name);
243         System.out.print(name);
244         if (nodes.hasMoreTokens())
245         System.out.print(", ");
246       }
247       System.out.println("<br>");
248       System.out.print("Remote client command : ");
249       remoteCommand = getProperty("workload_remote_client_command");
250       System.out.println(remoteCommand+"<br>");
251       System.out.print("Number of clients : ");
252       foo = new Integer JavaDoc(getProperty("workload_number_of_clients_per_node"));
253       nbOfClients = foo.intValue();
254       System.out.println(nbOfClients+"<br>");
255
256       System.out.print("Transition Table : ");
257       transitionTable = getProperty("workload_transition_table");
258       System.out.println(transitionTable+"<br>");
259       System.out.print("Number of columns : ");
260       foo = new Integer JavaDoc(getProperty("workload_number_of_columns"));
261       nbOfColumns = foo.intValue();
262       System.out.println(nbOfColumns+"<br>");
263       System.out.print("Number of rows : ");
264       foo = new Integer JavaDoc(getProperty("workload_number_of_rows"));
265       nbOfRows = foo.intValue();
266       System.out.println(nbOfRows+"<br>");
267       System.out.print("Maximum number of transitions : ");
268       foo = new Integer JavaDoc(getProperty("workload_maximum_number_of_transitions"));
269       maxNbOfTransitions = foo.intValue();
270       System.out.println(maxNbOfTransitions+"<br>");
271       System.out.print("Number of items per page : ");
272       foo = new Integer JavaDoc(getProperty("workload_number_of_items_per_page"));
273       nbOfItemsPerPage = foo.intValue();
274       System.out.println(nbOfItemsPerPage+"<br>");
275       System.out.print("Think time : ");
276       useTPCWThinkTime = getProperty("workload_use_tpcw_think_time").compareTo("yes") == 0;
277       if (useTPCWThinkTime)
278         System.out.println("TPCW compatible with 7s mean<br>");
279       else
280         System.out.println("Using Transition Matrix think time information<br>");
281       System.out.print("Up ramp time in ms : ");
282       foo = new Integer JavaDoc(getProperty("workload_up_ramp_time_in_ms"));
283       upTime = foo.intValue();
284       System.out.println(upTime+"<br>");
285       System.out.print("Up ramp slowdown factor : ");
286       Float JavaDoc floo = new Float JavaDoc(getProperty("workload_up_ramp_slowdown_factor"));
287       upSlowdown = floo.intValue();
288       System.out.println(upSlowdown+"<br>");
289       System.out.print("Session run time in ms : ");
290       foo = new Integer JavaDoc(getProperty("workload_session_run_time_in_ms"));
291       sessionTime = foo.intValue();
292       System.out.println(sessionTime+"<br>");
293       System.out.print("Down ramp time in ms : ");
294       foo = new Integer JavaDoc(getProperty("workload_down_ramp_time_in_ms"));
295       downTime = foo.intValue();
296       System.out.println(downTime+"<br>");
297       System.out.print("Down ramp slowdown factor : ");
298       floo = new Float JavaDoc(getProperty("workload_down_ramp_slowdown_factor"));
299       downSlowdown = floo.intValue();
300       System.out.println(downSlowdown+"<br>");
301
302       // # Database Information
303
System.out.println("\n<h3><br>### Database Information ###</h3>");
304       System.out.print("Database server : ");
305       nodes = new StringTokenizer JavaDoc(getProperty("database_server"),",");
306       dbServers = new Vector JavaDoc(nodes.countTokens());
307       while (nodes.hasMoreTokens())
308       {
309         String JavaDoc name = nodes.nextToken().trim();
310         dbServers.add(name);
311         System.out.print(name);
312         if (nodes.hasMoreTokens())
313           System.out.print(", ");
314       }
315       System.out.println("<br>");
316
317       // # Users policy
318
System.out.println("\n<h3><br>### Users policy ###</h3>");
319       System.out.print("Number of users : ");
320       nbOfUsers = new Integer JavaDoc(getProperty("database_number_of_users"));
321       System.out.println(nbOfUsers+"<br>");
322       
323       // # Region & Category definition files
324
System.out.println("\n<h3><br>### Region & Category definition files ###</h3>");
325       System.out.print("Regions description file : ");
326       BufferedReader JavaDoc regionsReader = new BufferedReader JavaDoc(new FileReader JavaDoc(getProperty("database_regions_file")));
327       System.out.println(getProperty("database_regions_file")+"<br>");
328       System.out.print("&nbsp &nbsp Reading file ... ");
329       regions = new Vector JavaDoc();
330       nbOfRegions = 0;
331       while (regionsReader.ready())
332       {
333         nbOfRegions++;
334         regions.add(regionsReader.readLine());
335       }
336       regionsReader.close();
337       System.out.println(nbOfRegions+" regions found.<br>");
338
339       System.out.print("Categories description file : ");
340       BufferedReader JavaDoc categoriesReader = new BufferedReader JavaDoc(new FileReader JavaDoc(getProperty("database_categories_file")));
341       System.out.println(getProperty("database_categories_file")+"<br>");
342       System.out.print("&nbsp &nbsp Reading file ... ");
343       categories = new Vector JavaDoc();
344       Vector JavaDoc itemsPerCategoryV = new Vector JavaDoc();
345       nbOfCategories = 0;
346       totalActiveItems = 0;
347       while (categoriesReader.ready())
348       {
349         String JavaDoc line = categoriesReader.readLine();
350         int openParenthesis = line.lastIndexOf('(');
351         int closeParenthesis = line.lastIndexOf(')');
352         nbOfCategories++;
353         if ((openParenthesis == -1) || (closeParenthesis == -1) || (openParenthesis > closeParenthesis))
354         {
355           System.err.println("Syntax error in categories file on line "+nbOfCategories+": "+line);
356           return null;
357         }
358         Integer JavaDoc nbOfItems = new Integer JavaDoc(line.substring(openParenthesis+1, closeParenthesis));
359         totalActiveItems += nbOfItems.intValue();
360         categories.add(line.substring(0, openParenthesis-1));
361         itemsPerCategoryV.add(nbOfItems);
362       }
363       categoriesReader.close();
364       itemsPerCategory = new int[nbOfCategories];
365       for (int i = 0 ; i < nbOfCategories ; i++)
366         itemsPerCategory[i] = ((Integer JavaDoc)itemsPerCategoryV.elementAt(i)).intValue();
367       System.out.println(nbOfCategories+" categories found.<br>");
368       System.out.println("Total number of items to generate: "+totalActiveItems+"<br>");
369       
370       // # Items policy
371
System.out.println("\n<h3><br>### Items policy ###</h3>");
372       System.out.print("Number of old items : ");
373       nbOfOldItems = new Integer JavaDoc(getProperty("database_number_of_old_items"));
374       System.out.println(nbOfOldItems+"<br>");
375       System.out.print("Percentage of unique items : ");
376       percentUniqueItems = new Float JavaDoc(getProperty("database_percentage_of_unique_items"));
377       System.out.println(percentUniqueItems+"%"+"<br>");
378       System.out.print("Percentage of items with reserve price : ");
379       percentReservePrice = new Float JavaDoc(getProperty("database_percentage_of_items_with_reserve_price"));
380       System.out.println(percentReservePrice+"%"+"<br>");
381       System.out.print("Percentage of buy now items : ");
382       percentBuyNow = new Float JavaDoc(getProperty("database_percentage_of_buy_now_items"));
383       System.out.println(percentBuyNow+"%"+"<br>");
384       System.out.print("Maximum quantity for multiple items : ");
385       maxItemQty = new Integer JavaDoc(getProperty("database_max_quantity_for_multiple_items"));
386       System.out.println(maxItemQty+"<br>");
387       System.out.print("Item description maximum lenth : ");
388       itemDescriptionLength = new Integer JavaDoc(getProperty("database_item_description_length"));
389       System.out.println(itemDescriptionLength+"<br>");
390
391       // # Bids policy
392
System.out.println("\n<h3><br>### Bids policy ###</h3>");
393       System.out.print("Maximum number of bids per item : ");
394       maxBidsPerItem = new Integer JavaDoc(getProperty("database_max_bids_per_item"));
395       System.out.println(maxBidsPerItem+"<br>");
396
397       // # Comments policy
398
System.out.println("\n<h3><br>### Comments policy ###</h3>");
399       System.out.print("Maximum number of comments per user : ");
400       maxCommentsPerUser = new Integer JavaDoc(getProperty("database_max_comments_per_user"));
401       System.out.println(maxCommentsPerUser+"<br>");
402       System.out.print("Comment maximum length : ");
403       commentMaxLength = new Integer JavaDoc(getProperty("database_comment_max_length"));
404       System.out.println(commentMaxLength+"<br>");
405
406       // # Monitoring Information
407
System.out.println("\n<h3><br>### Database Information ###</h3>");
408       System.out.print("Monitoring debugging level : ");
409       monitoringDebug = new Integer JavaDoc(getProperty("monitoring_debug_level"));
410       System.out.println(monitoringDebug+"<br>");
411       System.out.print("Monitoring program : ");
412       monitoringProgram = getProperty("monitoring_program");
413       System.out.println(monitoringProgram+"<br>");
414       System.out.print("Monitoring options : ");
415       monitoringOptions = getProperty("monitoring_options");
416       System.out.println(monitoringOptions+"<br>");
417       System.out.print("Monitoring sampling in seconds : ");
418       monitoringSampling = new Integer JavaDoc(getProperty("monitoring_sampling_in_seconds"));
419       System.out.println(monitoringSampling+"<br>");
420       System.out.print("Monitoring rsh : ");
421       monitoringRsh = getProperty("monitoring_rsh");
422       System.out.println(monitoringRsh+"<br>");
423       System.out.print("Monitoring scp : ");
424       monitoringScp = getProperty("monitoring_scp");
425       System.out.println(monitoringScp+"<br>");
426       System.out.print("Monitoring Gnuplot Terminal : ");
427       monitoringGnuPlot = getProperty("monitoring_gnuplot_terminal");
428       System.out.println(monitoringGnuPlot+"<br>");
429
430       // Create a new URLGenerator according to the version the user has chosen
431
System.out.println("\n");
432       useVersion = getProperty("httpd_use_version");
433       if (useVersion.compareTo("PHP") == 0)
434         urlGen = new URLGeneratorPHP(webSiteName, webSitePort, PHPHTMLPath, PHPScriptPath);
435       else if (useVersion.compareTo("EJB") == 0)
436         urlGen = new URLGeneratorEJB(webSiteName, webSitePort, EJBHTMLPath, EJBScriptPath);
437       else if (useVersion.compareTo("Servlets") == 0)
438         urlGen = new URLGeneratorServlets(webSiteName, webSitePort, ServletsHTMLPath, ServletsScriptPath);
439       else
440       {
441         System.err.println("Sorry but '"+useVersion+"' is not supported. Only PHP, EJB and Servlets are accepted.");
442         return null;
443       }
444       System.out.println("Using "+useVersion+" version.<br>");
445     }
446     catch (Exception JavaDoc e)
447     {
448       System.err.println("Error while checking database.properties: "+e.getMessage());
449       return null;
450     }
451     return urlGen;
452   }
453
454
455   /**
456    * Get the web server name
457    *
458    * @return web server name
459    */

460   public String JavaDoc getWebServerName()
461   {
462     return webSiteName;
463   }
464
465   /**
466    * Get the CJDBC server name
467    *
468    * @return CJDBC server name
469    */

470   public String JavaDoc getCJDBCServerName()
471   {
472     return cjdbcSiteName;
473   }
474
475   /**
476    * Get the database server name
477    *
478    * @return database server name
479    */

480   public Vector JavaDoc getDBServerNames()
481   {
482     return dbServers;
483   }
484
485
486   /**
487    * Get the EJB server name
488    *
489    * @return EJB server name
490    */

491   public Vector JavaDoc getEJBServerNames()
492   {
493     return EJBServers;
494   }
495
496
497   /**
498    * Get the Servlets server name
499    *
500    * @return Servlets server name
501    */

502   public Vector JavaDoc getServletsServerNames()
503   {
504     return ServletsServers;
505   }
506
507
508   /**
509    * Get the total number of users given in the number_of_users field
510    *
511    * @return total number of users
512    */

513   public int getNbOfUsers()
514   {
515     return nbOfUsers.intValue();
516   }
517
518
519   /**
520    * Get the total number of regions found in the region file given in the regions_file field
521    *
522    * @return total number of regions
523    */

524   public int getNbOfRegions()
525   {
526     return nbOfRegions;
527   }
528
529
530   /**
531    * Get the total number of categories found in the categories file given in the categories_file field
532    *
533    * @return total number of categories
534    */

535   public int getNbOfCategories()
536   {
537     return nbOfCategories;
538   }
539
540   /**
541    * Get a vector of region names as found in the region file given in the regions_file field
542    *
543    * @return vector of region names
544    */

545   public Vector JavaDoc getRegions()
546   {
547     return regions;
548   }
549
550
551   /**
552    * Get a vector of category names as found in the categories file given in the categories_file field
553    *
554    * @return vector of category names
555    */

556   public Vector JavaDoc getCategories()
557   {
558     return categories;
559   }
560
561
562   /**
563    * Return an array of number of items per category as described in the categories file given in the categories_file field
564    *
565    * @return array of number of items per category
566    */

567   public int[] getItemsPerCategory()
568   {
569     return itemsPerCategory;
570   }
571
572
573   /**
574    * Get the total number of items computed from information found in the categories file given in the categories_file field
575    *
576    * @return total number of active items (auction date is not passed)
577    */

578   public int getTotalActiveItems()
579   {
580     return totalActiveItems;
581   }
582
583
584   /**
585    * Get the total number of old items (auction date is over) to be inserted in the database.
586    *
587    * @return total number of old items (auction date is over)
588    */

589   public int getNbOfOldItems()
590   {
591     return nbOfOldItems.intValue();
592   }
593
594
595   /**
596    * Get the percentage of unique items given in the percentage_of_unique_items field
597    *
598    * @return percentage of unique items
599    */

600   public float getPercentUniqueItems()
601   {
602     return percentUniqueItems.floatValue();
603   }
604
605
606   /**
607    * Get the percentage of items with a reserve price given in the percentage_of_items_with_reserve_price field
608    *
609    * @return percentage of items with a reserve price
610    */

611   public float getPercentReservePrice()
612   {
613     return percentReservePrice.floatValue();
614   }
615
616
617   /**
618    * Get the percentage of items that users can 'buy now' given in the percentage_of_buy_now_items field
619    *
620    * @return percentage of items that users can 'buy now'
621    */

622   public float getPercentBuyNow()
623   {
624     return percentBuyNow.floatValue();
625   }
626
627
628   /**
629    * Get the maximum quantity for multiple items given in the max_quantity_for_multiple_items field
630    *
631    * @return maximum quantity for multiple items
632    */

633   public int getMaxItemQty()
634   {
635     return maxItemQty.intValue();
636   }
637
638   /**
639    * Get the maximum item description length given in the item_description_length field
640    *
641    * @return maximum item description length
642    */

643   public int getItemDescriptionLength()
644   {
645     return itemDescriptionLength.intValue();
646   }
647
648   /**
649    * Get the maximum number of bids per item given in the max_bids_per_item field
650    *
651    * @return maximum number of bids per item
652    */

653   public int getMaxBidsPerItem()
654   {
655     return maxBidsPerItem.intValue();
656   }
657
658   /**
659    * @deprecated Comments are now generated per item and no more per user, so this
660    * function should not be used anymore.
661    *
662    * Get the maximum number of comments per user given in the max_comments_per_user field
663    *
664    * @return maximum number of comments per user
665    */

666   public int getMaxCommentsPerUser()
667   {
668     return maxCommentsPerUser.intValue();
669   }
670
671   /**
672    * Get the maximum comment length given in the comment_max_length field
673    *
674    * @return maximum comment length
675    */

676   public int getCommentMaxLength()
677   {
678     return commentMaxLength.intValue();
679   }
680
681
682   /**
683    * Get the transition table file name given in the transition_table field
684    *
685    * @return transition table file name
686    */

687   public String JavaDoc getTransitionTable()
688   {
689     return transitionTable;
690   }
691
692
693   /**
694    * Get the number of columns in the transition table
695    *
696    * @return number of columns
697    */

698   public int getNbOfColumns()
699   {
700     return nbOfColumns;
701   }
702
703
704   /**
705    * Get the number of rows in the transition table
706    *
707    * @return number of rows
708    */

709   public int getNbOfRows()
710   {
711     return nbOfRows;
712   }
713
714
715   /**
716    * Returns true if TPC-W compatible think time must be used,
717    * false if transition matrix think time has to be used.
718    *
719    * @return if think time should be TPC-W compatible
720    */

721   public boolean useTPCWThinkTime()
722   {
723     return useTPCWThinkTime;
724   }
725
726
727   /**
728    * Get the number of items to display per page (when browsing) given in the number_of_items_per_page field
729    *
730    * @return number of items to display per page
731    */

732   public int getNbOfItemsPerPage()
733   {
734     return nbOfItemsPerPage;
735   }
736
737
738   /**
739    * Get the total number of clients user sessions to launch in parallel
740    *
741    * @return total number of clients
742    */

743   public int getNbOfClients()
744   {
745     return nbOfClients;
746   }
747
748
749   /**
750    * Get a vector of remote node names to launch clients on
751    *
752    * @return vector of remote node names to launch clients on
753    */

754   public Vector JavaDoc getRemoteClients()
755   {
756     return remoteClients;
757   }
758
759
760   /**
761    * Get a vector of remote node names to launch clients on
762    *
763    * @return vector of remote node names to launch clients on
764    */

765   public String JavaDoc getClientsRemoteCommand()
766   {
767     return remoteCommand;
768   }
769
770
771   /**
772    * Get the maximum number of transitions a client may perform
773    *
774    * @return maximum number of transitions
775    */

776   public int getMaxNbOfTransitions()
777   {
778     return maxNbOfTransitions;
779   }
780
781
782   /**
783    * Get up ramp time in milliseconds
784    *
785    * @return up ramp time
786    */

787   public int getUpRampTime()
788   {
789     return upTime;
790   }
791
792
793   /**
794    * Get up ramp slowdown factor
795    *
796    * @return up ramp slowdown
797    */

798   public float getUpRampSlowdown()
799   {
800     return upSlowdown;
801   }
802
803
804   /**
805    * Get session time in milliseconds
806    *
807    * @return session time
808    */

809   public int getSessionTime()
810   {
811     return sessionTime;
812   }
813
814
815   /**
816    * Get down ramp time in milliseconds
817    *
818    * @return down ramp time
819    */

820   public int getDownRampTime()
821   {
822     return downTime;
823   }
824
825
826   /**
827    * Get down ramp slowdown factor
828    *
829    * @return down ramp slowdown
830    */

831   public float getDownRampSlowdown()
832   {
833     return downSlowdown;
834   }
835
836
837   /**
838    * Get the monitoring debug level. Level is defined as follow: <pre>
839    * 0 = no debug message
840    * 1 = just error messages
841    * 2 = error messages+HTML pages
842    * 3 = everything!
843    * </pre>
844    *
845    * @return monitoring program full path and name
846    */

847   public int getMonitoringDebug()
848   {
849     return monitoringDebug.intValue();
850   }
851
852
853   /**
854    * Get the monitoring program full path and name
855    *
856    * @return monitoring program full path and name
857    */

858   public String JavaDoc getMonitoringProgram()
859   {
860     return monitoringProgram;
861   }
862
863
864   /**
865    * Get the monitoring program options
866    *
867    * @return monitoring program options
868    */

869   public String JavaDoc getMonitoringOptions()
870   {
871     return monitoringOptions;
872   }
873
874
875   /**
876    * Get the interval of time in seconds between 2 sample collection by the monitoring program.
877    *
878    * @return monitoring program sampling time in seconds
879    */

880   public Integer JavaDoc getMonitoringSampling()
881   {
882     return monitoringSampling;
883   }
884
885
886   /**
887    * Get the rsh program path that should be used to run the monitoring program remotely
888    *
889    * @return rsh program path
890    */

891   public String JavaDoc getMonitoringRsh()
892   {
893     return monitoringRsh;
894   }
895
896
897   /**
898    * Get scp program path that should be used to fetch remote files
899    *
900    * @return rsh program path
901    */

902   public String JavaDoc getMonitoringScp()
903   {
904     return monitoringScp;
905   }
906
907
908   /**
909    * Get the terminal to use for gnuplot. Usually it is set to 'gif' or 'jpeg'.
910    *
911    * @return gnuplot terminal
912    */

913   public String JavaDoc getGnuPlotTerminal()
914   {
915     return monitoringGnuPlot;
916   }
917
918 }
919
Popular Tags