Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MODCLUSTER-798 Add support for server portOffset configuration in Tomcat #762

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ public String toString() {
void setAddress(InetAddress address);

/**
* Returns the port on which this connector operates.
* Returns the port on which this connector operates. Note that the implementations need to account for any form
* of external port mapping or port offsetting that might have an effect on the configured port.
*
* @return a port number
* @return a port number on which this connector operates
*/
int getPort();

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 @@ -76,13 +76,13 @@ public int getPortOffset() {
}

@Override
public void setPortOffset(int i) {
public void setPortOffset(int portOffset) {
throw new IllegalStateException();
}

@Override
public int getPortWithOffset() {
return this.service.getServer().getPort();
return this.service.getServer().getPortWithOffset();
}

@Override
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