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

Add methods to toggle web sockets in app services #2512

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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 @@ -279,4 +279,14 @@ public IdentityConfiguration getIdentityConfiguration() {
public void updateIdentityConfiguration(@Nonnull final IdentityConfiguration configuration) {
throw new AzureToolkitRuntimeException("not supported");
}

public void enableWebSockets() {
toggleWebSockets(true);
}

public void disableWebSockets() {
toggleWebSockets(false);
}

protected abstract void toggleWebSockets(boolean enabled);
}
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,9 @@ public void updateIdentityConfiguration(final @NotNull IdentityConfiguration con
AzureMessager.getMessager().info(String.format("Updating identity configuration for function app %s...", this.getName()));
update.apply();
}

@Override
protected void toggleWebSockets(final boolean enabled) {
doModify(() -> Objects.requireNonNull(getRemote()).update().withWebSocketsEnabled(enabled).apply(), Status.UPDATING);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

public class FunctionAppDeploymentSlot extends FunctionAppBase<FunctionAppDeploymentSlot, FunctionApp, FunctionDeploymentSlot> {
Expand Down Expand Up @@ -93,4 +94,9 @@ protected String getRemoteDebugPort() {
}
throw new AzureToolkitRuntimeException("Could not found free port to enable remote debug.");
}

@Override
protected void toggleWebSockets(final boolean enabled) {
doModify(() -> Objects.requireNonNull(getRemote()).update().withWebSocketsEnabled(enabled).apply(), Status.UPDATING);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,9 @@ public void updateIdentityConfiguration(final @NotNull IdentityConfiguration con
AzureMessager.getMessager().info(String.format("Updating identity configuration for web app %s...", this.getName()));
update.apply();
}

@Override
protected void toggleWebSockets(final boolean enabled) {
doModify(() -> Objects.requireNonNull(getRemote()).update().withWebSocketsEnabled(enabled).apply(), Status.UPDATING);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

public class WebAppDeploymentSlot extends WebAppBase<WebAppDeploymentSlot, WebApp, DeploymentSlot> {

Expand All @@ -35,4 +36,9 @@ protected WebAppDeploymentSlot(@Nonnull WebDeploymentSlotBasic remote, @Nonnull
public List<AbstractAzResourceModule<?, ?, ?>> getSubModules() {
return Collections.emptyList();
}

@Override
protected void toggleWebSockets(final boolean enabled) {
doModify(() -> Objects.requireNonNull(getRemote()).update().withWebSocketsEnabled(enabled).apply(), Status.UPDATING);
}
}
Loading