use of com.microsoft.azure.toolkit.intellij.common.runconfig.IWebAppRunConfiguration in project azure-tools-for-java by Microsoft.
the class Connection method isApplicableFor.
/**
* is this connection applicable for the specified {@code configuration}.<br>
* - the {@code Connect Azure Resource} before run task will take effect if
* applicable: the {@link #prepareBeforeRun} & {@link #updateJavaParametersAtRun}
* will be called.
*
* @return true if this connection should intervene the specified {@code configuration}.
*/
public boolean isApplicableFor(@Nonnull RunConfiguration configuration) {
final boolean javaAppRunConfiguration = configuration instanceof ApplicationConfiguration;
final boolean springbootAppRunConfiguration = StringUtils.equals(configuration.getClass().getName(), SPRING_BOOT_CONFIGURATION);
final boolean azureWebAppRunConfiguration = configuration instanceof IWebAppRunConfiguration;
if (javaAppRunConfiguration || azureWebAppRunConfiguration || springbootAppRunConfiguration) {
final Module module = getTargetModule(configuration);
return Objects.nonNull(module) && Objects.equals(module.getName(), this.consumer.getName());
}
return false;
}
use of com.microsoft.azure.toolkit.intellij.common.runconfig.IWebAppRunConfiguration in project azure-tools-for-java by Microsoft.
the class Connection method prepareBeforeRun.
/**
* do some preparation in the {@code Connect Azure Resource} before run task
* of the {@code configuration}<br>
*/
@AzureOperation(name = "connector|connection.prepare_before_run", type = AzureOperation.Type.ACTION)
public boolean prepareBeforeRun(@Nonnull RunConfiguration configuration, DataContext dataContext) {
this.env = this.resource.initEnv(configuration.getProject()).entrySet().stream().collect(Collectors.toMap(e -> e.getKey().replaceAll(Connection.ENV_PREFIX, this.getEnvPrefix()), Map.Entry::getValue));
if (configuration instanceof IWebAppRunConfiguration) {
// set envs for remote deploy
final IWebAppRunConfiguration webAppConfiguration = (IWebAppRunConfiguration) configuration;
webAppConfiguration.setApplicationSettings(this.env);
}
return true;
}
Aggregations