diff options
| author | Vijaykumar Patel <vijay.patel@aheeva.com> | 2024-12-02 15:56:23 -0500 |
|---|---|---|
| committer | Vijaykumar Patel <vijay.patel@aheeva.com> | 2024-12-02 15:56:23 -0500 |
| commit | 1ac7511cf337bc64f3a02ebbfd9c3214fa61a946 (patch) | |
| tree | 1ea9aad630db0036a83273b203b0aed5fb77f7dd /src/main/java/derms/replica3/PortConstants.java | |
| parent | 687b126f39c44a083d424fc53fa3843bbdf91473 (diff) | |
| download | soen423-1ac7511cf337bc64f3a02ebbfd9c3214fa61a946.zip | |
Replica3 added
Diffstat (limited to 'src/main/java/derms/replica3/PortConstants.java')
| -rw-r--r-- | src/main/java/derms/replica3/PortConstants.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main/java/derms/replica3/PortConstants.java b/src/main/java/derms/replica3/PortConstants.java new file mode 100644 index 0000000..e8ce489 --- /dev/null +++ b/src/main/java/derms/replica3/PortConstants.java @@ -0,0 +1,24 @@ +package derms.replica3; + +public class PortConstants { + + public static final int MTL_PORT = 12012; + public static final int QUE_PORT = 12013; + public static final int SHE_PORT = 12014; + + public static final int MTL_UDP_PORT = 13013; + public static final int QUE_UDP_PORT = 13014; + public static final int SHE_UDP_PORT = 13015; + + public static int getUdpPort(final String serverLocation) { + if(Constants.MONTREAL.equalsIgnoreCase(serverLocation)) { + return MTL_UDP_PORT; + } else if(Constants.QUEBEC.equalsIgnoreCase(serverLocation)) { + return QUE_UDP_PORT; + } else if(Constants.SHERBROOKE.equalsIgnoreCase(serverLocation)) { + return SHE_UDP_PORT; + } + return 0; + } + +} |