Search in sources :

Example 1 with IArtifact

use of com.microsoft.azure.toolkit.lib.common.model.IArtifact in project azure-tools-for-java by Microsoft.

the class SpringCloudDeploymentConfiguration method writeExternal.

@Override
public void writeExternal(Element element) throws WriteExternalException {
    super.writeExternal(element);
    final AzureArtifactManager manager = AzureArtifactManager.getInstance(this.getProject());
    final Element appConfigElement = XmlSerializer.serialize(this.appConfig, (accessor, o) -> !"artifact".equalsIgnoreCase(accessor.getName()));
    final IArtifact artifact = this.appConfig.getDeployment().getArtifact();
    Optional.ofNullable(this.appConfig).map(config -> XmlSerializer.serialize(config, (accessor, o) -> !"artifact".equalsIgnoreCase(accessor.getName()))).ifPresent(element::addContent);
    Optional.ofNullable(this.appConfig).map(config -> (WrappedAzureArtifact) config.getDeployment().getArtifact()).map((a) -> manager.getArtifactIdentifier(a.getArtifact())).map(id -> new Element("Artifact").setAttribute("identifier", id)).ifPresent(element::addContent);
}
Also used : XmlSerializer(com.intellij.util.xmlb.XmlSerializer) Setter(lombok.Setter) RunConfiguration(com.intellij.execution.configurations.RunConfiguration) SpringCloudDeploymentConfig(com.microsoft.azure.toolkit.lib.springcloud.config.SpringCloudDeploymentConfig) Getter(lombok.Getter) ConfigurationType(com.intellij.execution.configurations.ConfigurationType) SpringCloudAppConfig(com.microsoft.azure.toolkit.lib.springcloud.config.SpringCloudAppConfig) InvalidDataException(com.intellij.openapi.util.InvalidDataException) RunProfileState(com.intellij.execution.configurations.RunProfileState) AzureTask(com.microsoft.azure.toolkit.lib.common.task.AzureTask) ExecutionEnvironment(com.intellij.execution.runners.ExecutionEnvironment) Project(com.intellij.openapi.project.Project) AzureArtifactManager(com.microsoft.azure.toolkit.intellij.common.AzureArtifactManager) LocatableConfiguration(com.intellij.execution.configurations.LocatableConfiguration) SettingsEditor(com.intellij.openapi.options.SettingsEditor) LocatableConfigurationBase(com.intellij.execution.configurations.LocatableConfigurationBase) Executor(com.intellij.execution.Executor) IArtifact(com.microsoft.azure.toolkit.lib.common.model.IArtifact) SpringCloudApp(com.microsoft.azure.toolkit.lib.springcloud.SpringCloudApp) ConfigurationFactory(com.intellij.execution.configurations.ConfigurationFactory) AzureValidationInfo(com.microsoft.azure.toolkit.lib.common.form.AzureValidationInfo) Objects(java.util.Objects) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) Optional(java.util.Optional) ConfigurationException(com.intellij.openapi.options.ConfigurationException) WriteExternalException(com.intellij.openapi.util.WriteExternalException) NotNull(org.jetbrains.annotations.NotNull) Element(org.jdom.Element) AzureTaskManager(com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager) javax.swing(javax.swing) Element(org.jdom.Element) IArtifact(com.microsoft.azure.toolkit.lib.common.model.IArtifact) AzureArtifactManager(com.microsoft.azure.toolkit.intellij.common.AzureArtifactManager)

Aggregations

Executor (com.intellij.execution.Executor)1 ConfigurationFactory (com.intellij.execution.configurations.ConfigurationFactory)1 ConfigurationType (com.intellij.execution.configurations.ConfigurationType)1 LocatableConfiguration (com.intellij.execution.configurations.LocatableConfiguration)1 LocatableConfigurationBase (com.intellij.execution.configurations.LocatableConfigurationBase)1 RunConfiguration (com.intellij.execution.configurations.RunConfiguration)1 RunProfileState (com.intellij.execution.configurations.RunProfileState)1 ExecutionEnvironment (com.intellij.execution.runners.ExecutionEnvironment)1 ConfigurationException (com.intellij.openapi.options.ConfigurationException)1 SettingsEditor (com.intellij.openapi.options.SettingsEditor)1 Project (com.intellij.openapi.project.Project)1 InvalidDataException (com.intellij.openapi.util.InvalidDataException)1 WriteExternalException (com.intellij.openapi.util.WriteExternalException)1 XmlSerializer (com.intellij.util.xmlb.XmlSerializer)1 AzureArtifactManager (com.microsoft.azure.toolkit.intellij.common.AzureArtifactManager)1 AzureValidationInfo (com.microsoft.azure.toolkit.lib.common.form.AzureValidationInfo)1 IArtifact (com.microsoft.azure.toolkit.lib.common.model.IArtifact)1 AzureTask (com.microsoft.azure.toolkit.lib.common.task.AzureTask)1 AzureTaskManager (com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager)1 SpringCloudApp (com.microsoft.azure.toolkit.lib.springcloud.SpringCloudApp)1