| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
package org.jitr.core; |
| 18 | |
|
| 19 | |
import org.apache.commons.lang.Validate; |
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
public final class ConfigurationModel { |
| 27 | |
|
| 28 | |
private final String baseUri; |
| 29 | |
|
| 30 | |
private final Class<?> containerClass; |
| 31 | |
|
| 32 | |
private final String containerWorkPath; |
| 33 | |
|
| 34 | |
private final String contextPath; |
| 35 | |
|
| 36 | |
private final OperationalMode mode; |
| 37 | |
|
| 38 | |
private final int port; |
| 39 | |
|
| 40 | |
private final String warPath; |
| 41 | |
|
| 42 | |
public ConfigurationModel(final String baseUri, final Class<?> containerClass, |
| 43 | |
final String containerWorkPath, final String contextPath, final OperationalMode mode, |
| 44 | 7 | final int port, final String warPath) { |
| 45 | |
|
| 46 | 7 | Validate.notEmpty(baseUri, "Base URI must not be empty."); |
| 47 | 7 | Validate.notNull(containerClass, "Container class must not be null."); |
| 48 | 7 | Validate.notNull(containerWorkPath, "Container work path must not be null."); |
| 49 | 7 | Validate.notEmpty(contextPath, "Context path must not be empty."); |
| 50 | 7 | Validate.notNull(mode, "Operational mode must not be null."); |
| 51 | 7 | Validate.notNull(warPath, "War path must not be null."); |
| 52 | |
|
| 53 | 7 | this.baseUri = baseUri; |
| 54 | 7 | this.containerClass = containerClass; |
| 55 | 7 | this.containerWorkPath = containerWorkPath; |
| 56 | 7 | this.contextPath = contextPath; |
| 57 | 7 | this.mode = mode; |
| 58 | 7 | this.port = port; |
| 59 | 7 | this.warPath = warPath; |
| 60 | 7 | } |
| 61 | |
|
| 62 | |
public String getBaseUri() { |
| 63 | 9 | return baseUri; |
| 64 | |
} |
| 65 | |
|
| 66 | |
public Class<?> getContainerClass() { |
| 67 | 5 | return containerClass; |
| 68 | |
} |
| 69 | |
|
| 70 | |
public String getContainerWorkPath() { |
| 71 | 5 | return containerWorkPath; |
| 72 | |
} |
| 73 | |
|
| 74 | |
public String getContextPath() { |
| 75 | 9 | return contextPath; |
| 76 | |
} |
| 77 | |
|
| 78 | |
public OperationalMode getMode() { |
| 79 | 15 | return mode; |
| 80 | |
} |
| 81 | |
|
| 82 | |
public int getPort() { |
| 83 | 14 | return port; |
| 84 | |
} |
| 85 | |
|
| 86 | |
public String getWarPath() { |
| 87 | 5 | return warPath; |
| 88 | |
} |
| 89 | |
} |