View Javadoc
1   package org.andromda.core.configuration;
2   
3   import java.io.Serializable;
4   import org.apache.commons.lang.StringUtils;
5   
6   /**
7    * Represents the configuration for the
8    * AndroMDA server.
9    *
10   * @author Chad Brandon
11   */
12  public class Server
13      implements Serializable
14  {
15      private static final long serialVersionUID = 34L;
16  
17      /**
18       * Stores the port the server should be run on.
19       */
20      private int port;
21  
22      /**
23       * The port the server should be run on.
24       *
25       * @return Returns the port.
26       */
27      public int getPort()
28      {
29          return port;
30      }
31  
32      /**
33       * The port the server should be run on.
34       *
35       * @param port The port to set.
36       */
37      public void setPort(final String port)
38      {
39          if (StringUtils.isNotBlank(port))
40          {
41              this.port = Integer.parseInt(port);
42          }
43      }
44  
45      /**
46       * The host the server is running on.
47       */
48      private String host;
49  
50      /**
51       * gets the host the server should be run on.
52       *
53       * @return Returns the host.
54       */
55      public String getHost()
56      {
57          return host;
58      }
59  
60      /**
61       * Sets the host the server should be run on.
62       *
63       * @param host The host to set.
64       */
65      public void setHost(String host)
66      {
67          this.host = host;
68      }
69  
70      /**
71       * The interval at which the server loads
72       * model(s) (if a load is required).
73       */
74      private int loadInterval = 1000;
75  
76      /**
77       * Gets the interval at which model(s) are
78       * loaded (if required).
79       *
80       * @return Returns the model Load interval
81       */
82      public int getLoadInterval()
83      {
84          return loadInterval;
85      }
86  
87      /**
88       * Sets the interval at which model(s) should be
89       * loaded (if an initial load or Load is required).
90       *
91       * @param loadInterval The loadInterval to set.
92       */
93      public void setLoadInterval(final String loadInterval)
94      {
95          if (StringUtils.isNotBlank(loadInterval))
96          {
97              this.loadInterval = Integer.parseInt(loadInterval);
98          }
99      }
100 
101     /**
102      * The maximum number of failed model load attempts
103      * that can occur before we fail.
104      */
105     private int maximumFailedLoadAttempts = 10;
106 
107     /**
108      * Gets the maximum number of failed model load attempts
109      * that can occur before we fail.
110      *
111      * @return Returns the maximumFailedLoadAttempts.
112      */
113     public int getMaximumFailedLoadAttempts()
114     {
115         return this.maximumFailedLoadAttempts;
116     }
117 
118     /**
119      * Sets the maximum number of failed model load attempts
120      * that can occur before we fail.
121      *
122      * @param maximumFailedLoadAttempts The maximumFailedLoadAttempts to set.
123      */
124     public void setMaximumFailedLoadAttempts(final String maximumFailedLoadAttempts)
125     {
126         if (StringUtils.isNotBlank(maximumFailedLoadAttempts))
127         {
128             this.maximumFailedLoadAttempts = Integer.parseInt(maximumFailedLoadAttempts);
129         }
130     }
131 }