Skip to content

Commit

Permalink
MODCLUSTER-798 Add support for Tomcat's server "portOffset".
Browse files Browse the repository at this point in the history
  • Loading branch information
rhusar committed Dec 11, 2023
1 parent 2f7924e commit 3a01cdb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ public String toString() {
void setAddress(InetAddress address);

/**
* Returns the port on which this connector operates.
* Returns the port number on which this connector listens. Note that the implementation needs to account for any form
* of port-offsetting that might have an effect on the configured port.
*
* @return a port number
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void setAddress(InetAddress address) {

@Override
public int getPort() {
return (this.externalPort == null) ? this.connector.getPort() : this.externalPort;
return (this.externalPort == null) ? this.connector.getPortWithOffset() : this.externalPort;
}

@Override
Expand Down Expand Up @@ -112,7 +112,7 @@ public int hashCode() {
@Override
public String toString() {
InetAddress address = this.getAddress();
return String.format("%s://%s:%d", this.getType(), (address != null) ? address.getHostAddress() : "<undefined>", this.connector.getPort());
return String.format("%s://%s:%d", this.getType(), (address != null) ? address.getHostAddress() : "<undefined>", this.connector.getPortWithOffset());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void setAddress(InetAddress address) {

@Override
public int getPort() {
return (this.externalPort == null) ? this.connector.getPort() : this.externalPort;
return (this.externalPort == null) ? this.connector.getPortWithOffset() : this.externalPort;
}

@Override
Expand Down Expand Up @@ -112,7 +112,7 @@ public int hashCode() {
@Override
public String toString() {
InetAddress address = this.getAddress();
return String.format("%s://%s:%d", this.getType(), (address != null) ? address.getHostAddress() : "<undefined>", this.connector.getPort());
return String.format("%s://%s:%d", this.getType(), (address != null) ? address.getHostAddress() : "<undefined>", this.connector.getPortWithOffset());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void setAddress(InetAddress address) {

@Override
public int getPort() {
return (this.externalPort == null) ? this.connector.getPort() : this.externalPort;
return (this.externalPort == null) ? this.connector.getPortWithOffset() : this.externalPort;
}

@Override
Expand Down Expand Up @@ -112,7 +112,7 @@ public int hashCode() {
@Override
public String toString() {
InetAddress address = this.getAddress();
return String.format("%s://%s:%d", this.getType(), (address != null) ? address.getHostAddress() : "<undefined>", this.connector.getPort());
return String.format("%s://%s:%d", this.getType(), (address != null) ? address.getHostAddress() : "<undefined>", this.connector.getPortWithOffset());
}

/**
Expand Down

0 comments on commit 3a01cdb

Please sign in to comment.