001: package org.andromda.core.configuration;
002:
003: import java.io.Serializable;
004:
005: import org.apache.commons.lang.StringUtils;
006:
007: /**
008: * Represents the configuration for the
009: * AndroMDA server.
010: *
011: * @author Chad Brandon
012: */
013: public class Server implements Serializable {
014: /**
015: * Stores the port the server should be run on.
016: */
017: private int port;
018:
019: /**
020: * The port the server should be run on.
021: *
022: * @return Returns the port.
023: */
024: public int getPort() {
025: return port;
026: }
027:
028: /**
029: * The port the server should be run on.
030: *
031: * @param port The port to set.
032: */
033: public void setPort(final String port) {
034: if (StringUtils.isNotBlank(port)) {
035: this .port = Integer.parseInt(port);
036: }
037: }
038:
039: /**
040: * The host the server is running on.
041: */
042: private String host;
043:
044: /**
045: * gets the host the server should be run on.
046: *
047: * @return Returns the host.
048: */
049: public String getHost() {
050: return host;
051: }
052:
053: /**
054: * Sets the host the server should be run on.
055: *
056: * @param host The host to set.
057: */
058: public void setHost(String host) {
059: this .host = host;
060: }
061:
062: /**
063: * The interval at which the server loads
064: * model(s) (if a load is required).
065: */
066: private int loadInterval = 1000;
067:
068: /**
069: * Gets the interval at which model(s) are
070: * loaded (if required).
071: *
072: * @return Returns the model Load interval
073: */
074: public int getLoadInterval() {
075: return loadInterval;
076: }
077:
078: /**
079: * Sets the interval at which model(s) should be
080: * loaded (if an initial load or Load is required).
081: *
082: * @param loadInterval The loadInterval to set.
083: */
084: public void setLoadInterval(final String loadInterval) {
085: if (StringUtils.isNotBlank(loadInterval)) {
086: this .loadInterval = Integer.parseInt(loadInterval);
087: }
088: }
089:
090: /**
091: * The maximum number of failed model load attempts
092: * that can occur before we fail.
093: */
094: private int maximumFailedLoadAttempts = 10;
095:
096: /**
097: * Gets the maximum number of failed model load attempts
098: * that can occur before we fail.
099: *
100: * @return Returns the maximumFailedLoadAttempts.
101: */
102: public int getMaximumFailedLoadAttempts() {
103: return this .maximumFailedLoadAttempts;
104: }
105:
106: /**
107: * Sets the maximum number of failed model load attempts
108: * that can occur before we fail.
109: *
110: * @param maximumFailedLoadAttempts The maximumFailedLoadAttempts to set.
111: */
112: public void setMaximumFailedLoadAttempts(
113: final String maximumFailedLoadAttempts) {
114: if (StringUtils.isNotBlank(maximumFailedLoadAttempts)) {
115: this.maximumFailedLoadAttempts = Integer
116: .parseInt(maximumFailedLoadAttempts);
117: }
118: }
119: }
|