You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by jg...@apache.org on 2022/02/02 06:49:32 UTC
[netbeans] branch master updated: Application deployment support to locally running Payara Server docker container (#3330)
This is an automated email from the ASF dual-hosted git repository.
jgauravgupta pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new 8774f8d Application deployment support to locally running Payara Server docker container (#3330)
8774f8d is described below
commit 8774f8d75a938de684f44d20133951e75323f245
Author: Gaurav Gupta <ga...@payara.fish>
AuthorDate: Wed Feb 2 12:19:15 2022 +0530
Application deployment support to locally running Payara Server docker container (#3330)
* FISH-511 Web Application deployment support to locally running Payara Server docker container
* FISH-511 Javadoc format fix
---
.../modules/payara/common/CommonServerSupport.java | 13 +-
.../modules/payara/common/PayaraInstance.java | 83 ++++++++++++-
.../modules/payara/common/ui/Bundle.properties | 8 +-
.../modules/payara/common/ui/InstancePanel.form | 87 ++++++++++----
.../modules/payara/common/ui/InstancePanel.java | 103 ++++++++++++----
.../common/wizards/AddDomainLocationPanel.java | 3 +
.../wizards/AddDomainLocationVisualPanel.form | 97 ++++++++++++---
.../wizards/AddDomainLocationVisualPanel.java | 132 +++++++++++++++------
.../payara/common/wizards/Bundle.properties | 5 +
.../common/wizards/ServerWizardIterator.java | 36 +++++-
.../netbeans/modules/payara/spi/PayaraModule.java | 3 +
.../payara/jakartaee/Hk2DeploymentManager.java | 16 ++-
.../payara/jakartaee/Hk2OptionalFactory.java | 2 +-
.../org-netbeans-modules-payara-tooling.sig | 6 +
.../payara/tooling/admin/RunnerHttpDeploy.java | 17 ++-
.../modules/payara/tooling/data/PayaraServer.java | 22 ++++
.../payara/tooling/data/PayaraServerEntity.java | 39 ++++++
17 files changed, 568 insertions(+), 104 deletions(-)
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/CommonServerSupport.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/CommonServerSupport.java
index ef917a0..cc4746e 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/CommonServerSupport.java
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/CommonServerSupport.java
@@ -36,6 +36,8 @@ import java.io.File;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
+import java.nio.file.Path;
+import java.nio.file.Paths;
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.*;
@@ -1147,7 +1149,16 @@ public class CommonServerSupport
}
if (path.startsWith("file:")) { // NOI18N
path = path.substring(5);
- path = (new File(path)).getAbsolutePath();
+ if (getInstance().isDocker()
+ && getInstance().getHostPath() != null
+ && !getInstance().getHostPath().isEmpty()
+ && getInstance().getContainerPath() != null
+ && !getInstance().getContainerPath().isEmpty()) {
+ Path relativePath = Paths.get(getInstance().getContainerPath()).relativize(Paths.get(path));
+ path = Paths.get(getInstance().getHostPath(), relativePath.toString()).toString();
+ } else {
+ path = (new File(path)).getAbsolutePath();
+ }
}
String enabledKey = "servers.server.server.application-ref."
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraInstance.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraInstance.java
index 8f73e3d..84f45ac 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraInstance.java
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/PayaraInstance.java
@@ -354,11 +354,25 @@ public class PayaraInstance implements ServerInstanceImplementation,
}
}
+ @Deprecated
+ public static PayaraInstance create(String displayName,
+ String installRoot, String payaraRoot, String domainsDir,
+ String domainName, int httpPort, int adminPort,
+ String userName, String password, String target, String url,
+ PayaraInstanceProvider pip) {
+ return create(displayName,
+ installRoot, payaraRoot, domainsDir,
+ domainName, httpPort, adminPort,
+ userName, password,
+ false, null, null,
+ target, url,
+ pip);
+ }
+
/**
- * Creates a PayaraInstance object for a server installation. This
+ * Creates a PayaraInstance object for a server installation.This
* instance should be added to the the provider registry if the caller wants
- * it to be persisted for future sessions or searchable.
- * <p/>
+ * it to be persisted for future sessions or searchable.<p/>
* @param displayName Display name for this server instance.
* @param installRoot Payara installation root directory.
* @param payaraRoot Payara server home directory.
@@ -368,6 +382,9 @@ public class PayaraInstance implements ServerInstanceImplementation,
* @param adminPort Payara server HTTP port for administration.
* @param userName Payara server administrator's user name.
* @param password Payara server administrator's password.
+ * @param docker info about Payara server instance is running in docker container
+ * @param hostPath The docker volume host path
+ * @param containerPath The docker container path
* @param url Payara server URL (Java EE SPI unique identifier).
* @param pip Payara instance provider.
* @return PayaraInstance object for this server instance.
@@ -375,7 +392,9 @@ public class PayaraInstance implements ServerInstanceImplementation,
public static PayaraInstance create(String displayName,
String installRoot, String payaraRoot, String domainsDir,
String domainName, int httpPort, int adminPort,
- String userName, String password, String target, String url,
+ String userName, String password,
+ boolean docker, String hostPath, String containerPath,
+ String target, String url,
PayaraInstanceProvider pip) {
Map<String, String> ip = new HashMap<>();
ip.put(PayaraModule.DISPLAY_NAME_ATTR, displayName);
@@ -392,6 +411,13 @@ public class PayaraInstance implements ServerInstanceImplementation,
if (password != null) {
ip.put(PayaraModule.PASSWORD_ATTR, password);
}
+ ip.put(PayaraModule.DOCKER_ATTR, String.valueOf(docker));
+ if(hostPath != null) {
+ ip.put(PayaraModule.HOST_PATH_ATTR, hostPath);
+ }
+ if(containerPath != null) {
+ ip.put(PayaraModule.CONTAINER_PATH_ATTR, containerPath);
+ }
ip.put(PayaraModule.URL_ATTR, url);
// extract the host from the URL
String[] bigUrlParts = url.split("]");
@@ -999,6 +1025,55 @@ public class PayaraInstance implements ServerInstanceImplementation,
}
/**
+ * Get information if this Payara server instance is running in docker container.
+ * <p/>
+ * @return Value of <code>true</code> when this Payara server instance
+ * is docker instance or <code>false</code> otherwise.
+ */
+ @Override
+ public boolean isDocker() {
+ return Boolean.valueOf(properties.getOrDefault(PayaraModule.DOCKER_ATTR, "false"));
+ }
+
+ /**
+ * Get the docker volume host path.
+ * <p/>
+ * @return The host path.
+ */
+ @Override
+ public String getHostPath() {
+ return properties.get(PayaraModule.HOST_PATH_ATTR);
+ }
+
+ /**
+ * Set the docker volume host path from stored properties.
+ * <p/>
+ * @param hostPath the docker volume host path.
+ */
+ public void setHostPath(final String hostPath) {
+ properties.put(PayaraModule.HOST_PATH_ATTR, hostPath);
+ }
+
+ /**
+ * Get the docker volume container path.
+ * <p/>
+ * @return The container path.
+ */
+ @Override
+ public String getContainerPath() {
+ return properties.get(PayaraModule.CONTAINER_PATH_ATTR);
+ }
+
+ /**
+ * Set the docker volume container path from stored properties.
+ * <p/>
+ * @param containerPath the docker volume container path.
+ */
+ public void setContainerPath(final String containerPath) {
+ properties.put(PayaraModule.CONTAINER_PATH_ATTR, containerPath);
+ }
+
+ /**
* Get Payara server domains folder from stored properties.
* <p/>
* @return Payara server domains folder.
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/Bundle.properties b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/Bundle.properties
index 701a617..d88a6de 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/Bundle.properties
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/Bundle.properties
@@ -154,6 +154,12 @@ InstancePanel.installationLocationField.text=
InstancePanel.domainsFolderField.text=
InstancePanel.userNameField.text=
InstancePanel.hostRemoteField.text=
+InstancePanel.hotDeploy.text=Enable Hot Deploy
+InstancePanel.showPassword.text=
+InstancePanel.hostPathLabel.text=Host Path:
+InstancePanel.hostPathField.text=
+InstancePanel.containerPathLabel.text=Container Path:
+InstancePanel.containerPathField.text=
ConnectionPoolAdvancedAttributesCustomizer.logJDBCCallsCheckbox.text=Enable
ConnectionPoolAdvancedAttributesCustomizer.logJDBCCallsLabel.text=Log JDBC Calls:
ConnectionPoolAdvancedAttributesCustomizer.logJDBCCallsLayeredPane.toolTipText=When set to true, all JDBC calls will be logged allowing tracing of all JDBC interactions including SQL
@@ -164,5 +170,3 @@ ConnectionPoolAdvancedAttributesCustomizer.slowQueryLogThresholdLayeredPane.tool
ConnectionPoolAdvancedAttributesCustomizer.sqlTraceListenersTextField.text=
ConnectionPoolAdvancedAttributesCustomizer.sqlTraceListenersLabel.text=SQL Trace Listeners:
ConnectionPoolAdvancedAttributesCustomizer.sqlTraceListenersLayeredPane.toolTipText=Comma-separated list of classes that implement the org.glassfish.api.jdbc.SQLTraceListener interface
-InstancePanel.hotDeploy.text=Enable Hot Deploy
-InstancePanel.showPassword.text=
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/InstancePanel.form b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/InstancePanel.form
index d8b0283..2593cea 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/InstancePanel.form
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/InstancePanel.form
@@ -62,16 +62,31 @@
</Group>
</Group>
<Group type="102" attributes="0">
+ <Group type="103" groupAlignment="1" attributes="0">
+ <Component id="jdbcDriverDeployment" alignment="0" pref="0" max="32767" attributes="0"/>
+ <Component id="httpMonitor" alignment="0" max="32767" attributes="0"/>
+ <Component id="commetSupport" max="32767" attributes="0"/>
+ </Group>
+ <EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
- <Component id="hostLocalLabel" linkSize="1" alignment="0" min="-2" pref="59" max="-2" attributes="0"/>
- <Component id="domainLabel" linkSize="1" alignment="0" min="-2" pref="59" max="-2" attributes="0"/>
- <Component id="dasPortLabel" linkSize="1" alignment="0" min="-2" max="-2" attributes="0"/>
- <Component id="userNameLabel" linkSize="1" alignment="0" min="-2" max="-2" attributes="0"/>
+ <Component id="preserveSessions" max="32767" attributes="0"/>
+ <Component id="hotDeploy" alignment="0" max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ <Group type="102" alignment="0" attributes="0">
+ <Group type="103" groupAlignment="1" max="-2" attributes="0">
+ <Component id="hostPathLabel" max="32767" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="hostLocalLabel" linkSize="1" alignment="0" min="-2" pref="59" max="-2" attributes="0"/>
+ <Component id="domainLabel" linkSize="1" alignment="0" min="-2" pref="59" max="-2" attributes="0"/>
+ <Component id="dasPortLabel" linkSize="1" alignment="1" max="32767" attributes="0"/>
+ <Component id="userNameLabel" linkSize="1" alignment="1" max="32767" attributes="0"/>
+ </Group>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
- <Component id="hostLocalField" pref="207" max="32767" attributes="0"/>
+ <Component id="hostLocalField" pref="201" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="localIpCB" min="-2" max="-2" attributes="0"/>
</Group>
@@ -80,12 +95,14 @@
<Component id="domainField" alignment="0" pref="0" max="32767" attributes="0"/>
<Component id="dasPortField" alignment="0" pref="0" max="32767" attributes="0"/>
<Component id="userNameField" alignment="0" pref="0" max="32767" attributes="0"/>
+ <Component id="hostPathField" alignment="0" pref="0" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="httpPortLabel" linkSize="1" max="32767" attributes="0"/>
<Component id="targetLabel" linkSize="1" max="32767" attributes="0"/>
<Component id="passwordLabel" linkSize="1" alignment="0" max="32767" attributes="0"/>
+ <Component id="containerPathLabel" pref="0" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
@@ -97,22 +114,11 @@
<Component id="showPassword" min="-2" pref="27" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
</Group>
+ <Component id="containerPathField" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
- <Group type="102" attributes="0">
- <Group type="103" groupAlignment="1" attributes="0">
- <Component id="jdbcDriverDeployment" alignment="0" pref="0" max="32767" attributes="0"/>
- <Component id="httpMonitor" alignment="0" max="32767" attributes="0"/>
- <Component id="commetSupport" max="32767" attributes="0"/>
- </Group>
- <EmptySpace min="-2" max="-2" attributes="0"/>
- <Group type="103" groupAlignment="0" attributes="0">
- <Component id="preserveSessions" max="32767" attributes="0"/>
- <Component id="hotDeploy" alignment="0" max="32767" attributes="0"/>
- </Group>
- </Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@@ -168,17 +174,24 @@
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
+ <Component id="hostPathLabel" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="hostPathField" alignment="3" max="32767" attributes="0"/>
+ <Component id="containerPathLabel" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="containerPathField" alignment="3" max="32767" attributes="0"/>
+ </Group>
+ <EmptySpace type="unrelated" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
<Component id="commetSupport" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="hotDeploy" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
- <EmptySpace max="-2" attributes="0"/>
+ <EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="httpMonitor" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="preserveSessions" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
- <EmptySpace max="-2" attributes="0"/>
+ <EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jdbcDriverDeployment" min="-2" max="-2" attributes="0"/>
- <EmptySpace min="-2" pref="120" max="-2" attributes="0"/>
+ <EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -432,5 +445,39 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="showPasswordActionPerformed"/>
</Events>
</Component>
+ <Component class="javax.swing.JLabel" name="hostPathLabel">
+ <Properties>
+ <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+ <ComponentRef name="domainField"/>
+ </Property>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/netbeans/modules/payara/common/ui/Bundle.properties" key="InstancePanel.hostPathLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="hostPathField">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/netbeans/modules/payara/common/ui/Bundle.properties" key="InstancePanel.hostPathField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JLabel" name="containerPathLabel">
+ <Properties>
+ <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+ <ComponentRef name="domainField"/>
+ </Property>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/netbeans/modules/payara/common/ui/Bundle.properties" key="InstancePanel.containerPathLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="containerPathField">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/netbeans/modules/payara/common/ui/Bundle.properties" key="InstancePanel.containerPathField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ </Properties>
+ </Component>
</SubComponents>
</Form>
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/InstancePanel.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/InstancePanel.java
index d2f09fc..e4e4f4b 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/InstancePanel.java
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/ui/InstancePanel.java
@@ -344,6 +344,17 @@ public abstract class InstancePanel extends javax.swing.JPanel {
userNameField.setText(instance.getUserName());
passwordField.setText(instance.getPassword());
}
+
+ /**
+ * Docker fields initialization.
+ * <p/>
+ * Initialize host path and container path with values stored in Payara
+ * instance object.
+ */
+ protected void initDockerVolume() {
+ hostPathField.setText(instance.getHostPath());
+ containerPathField.setText(instance.getContainerPath());
+ }
/**
* Initialize internal properties storage from Payara instance object
@@ -488,6 +499,23 @@ public abstract class InstancePanel extends javax.swing.JPanel {
}
/**
+ * Docker volume path storage.
+ * <p/>
+ * Store docker volume path when form fields values differs from Payara
+ * instance properties.
+ */
+ protected void storeDockerVolume() {
+ final String hostPath = hostPathField.getText().trim();
+ if (!hostPath.equals(instance.getHostPath())) {
+ instance.setHostPath(hostPath);
+ }
+ final String containerPath = containerPathField.getText().trim();
+ if (!containerPath.equals(instance.getContainerPath())) {
+ instance.setContainerPath(containerPath);
+ }
+ }
+
+ /**
* Enable form fields that can be modified by user.
* <p/>
* Set those form fields that can be modified by user as enabled. This
@@ -502,6 +530,8 @@ public abstract class InstancePanel extends javax.swing.JPanel {
targetField.setEnabled(true);
userNameField.setEnabled(true);
passwordField.setEnabled(true);
+ hostPathField.setEnabled(true);
+ containerPathField.setEnabled(true);
commetSupport.setEnabled(true);
httpMonitor.setEnabled(true);
jdbcDriverDeployment.setEnabled(true);
@@ -528,6 +558,8 @@ public abstract class InstancePanel extends javax.swing.JPanel {
targetField.setEnabled(false);
userNameField.setEnabled(false);
passwordField.setEnabled(false);
+ hostPathField.setEnabled(false);
+ containerPathField.setEnabled(false);
commetSupport.setEnabled(false);
httpMonitor.setEnabled(false);
jdbcDriverDeployment.setEnabled(false);
@@ -547,6 +579,7 @@ public abstract class InstancePanel extends javax.swing.JPanel {
initHost();
initDomainAndTarget();
initCredentials();
+ initDockerVolume();
initCheckBoxes();
updatePasswordVisibility();
// do the magic according to loopback checkbox
@@ -563,6 +596,7 @@ public abstract class InstancePanel extends javax.swing.JPanel {
storePorts();
storeTarget();
storeCredentials();
+ storeDockerVolume();
storeCheckBoxes();
}
@@ -639,6 +673,10 @@ public abstract class InstancePanel extends javax.swing.JPanel {
hostRemoteField = new javax.swing.JTextField();
hotDeploy = new javax.swing.JCheckBox();
showPassword = new javax.swing.JToggleButton();
+ hostPathLabel = new javax.swing.JLabel();
+ hostPathField = new javax.swing.JTextField();
+ containerPathLabel = new javax.swing.JLabel();
+ containerPathField = new javax.swing.JTextField();
setName(org.openide.util.NbBundle.getMessage(InstancePanel.class, "InstanceLocalPanel.displayName")); // NOI18N
setPreferredSize(new java.awt.Dimension(602, 304));
@@ -744,6 +782,16 @@ public abstract class InstancePanel extends javax.swing.JPanel {
}
});
+ hostPathLabel.setLabelFor(domainField);
+ org.openide.awt.Mnemonics.setLocalizedText(hostPathLabel, org.openide.util.NbBundle.getMessage(InstancePanel.class, "InstancePanel.hostPathLabel.text")); // NOI18N
+
+ hostPathField.setText(org.openide.util.NbBundle.getMessage(InstancePanel.class, "InstancePanel.hostPathField.text")); // NOI18N
+
+ containerPathLabel.setLabelFor(domainField);
+ org.openide.awt.Mnemonics.setLocalizedText(containerPathLabel, org.openide.util.NbBundle.getMessage(InstancePanel.class, "InstancePanel.containerPathLabel.text")); // NOI18N
+
+ containerPathField.setText(org.openide.util.NbBundle.getMessage(InstancePanel.class, "InstancePanel.containerPathField.text")); // NOI18N
+
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
@@ -762,27 +810,40 @@ public abstract class InstancePanel extends javax.swing.JPanel {
.addComponent(installationLocationField, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
.addComponent(hostRemoteField)))
.addGroup(layout.createSequentialGroup()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(jdbcDriverDeployment, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
+ .addComponent(httpMonitor, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(commetSupport, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(hostLocalLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(domainLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(dasPortLabel)
- .addComponent(userNameLabel))
+ .addComponent(preserveSessions, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(hotDeploy, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
+ .addGroup(layout.createSequentialGroup()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
+ .addComponent(hostPathLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(hostLocalLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(domainLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(dasPortLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(userNameLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
- .addComponent(hostLocalField, 0, 207, Short.MAX_VALUE)
+ .addComponent(hostLocalField, 0, 201, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(localIpCB))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(domainField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
.addComponent(dasPortField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
- .addComponent(userNameField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE))
+ .addComponent(userNameField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
+ .addComponent(hostPathField, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(httpPortLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(targetLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(passwordLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addComponent(passwordLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(containerPathLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(httpPortField, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
@@ -791,16 +852,8 @@ public abstract class InstancePanel extends javax.swing.JPanel {
.addComponent(passwordField, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(showPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(2, 2, 2))))))
- .addGroup(layout.createSequentialGroup()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
- .addComponent(jdbcDriverDeployment, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
- .addComponent(httpMonitor, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(commetSupport, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(preserveSessions, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(hotDeploy, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
+ .addGap(2, 2, 2))
+ .addComponent(containerPathField, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE))))))
.addContainerGap())
);
@@ -850,15 +903,21 @@ public abstract class InstancePanel extends javax.swing.JPanel {
.addComponent(userNameLabel)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(hostPathLabel)
+ .addComponent(hostPathField)
+ .addComponent(containerPathLabel)
+ .addComponent(containerPathField))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(commetSupport)
.addComponent(hotDeploy))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(httpMonitor)
.addComponent(preserveSessions))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jdbcDriverDeployment)
- .addGap(120, 120, 120))
+ .addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
@@ -904,6 +963,8 @@ public abstract class InstancePanel extends javax.swing.JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables
protected javax.swing.JCheckBox commetSupport;
+ protected javax.swing.JTextField containerPathField;
+ protected javax.swing.JLabel containerPathLabel;
protected javax.swing.JTextField dasPortField;
protected javax.swing.JLabel dasPortLabel;
protected javax.swing.JTextField domainField;
@@ -912,6 +973,8 @@ public abstract class InstancePanel extends javax.swing.JPanel {
protected javax.swing.JLabel domainsFolderLabel;
protected javax.swing.JComboBox hostLocalField;
protected javax.swing.JLabel hostLocalLabel;
+ protected javax.swing.JTextField hostPathField;
+ protected javax.swing.JLabel hostPathLabel;
protected javax.swing.JTextField hostRemoteField;
protected javax.swing.JLabel hostRemoteLabel;
protected javax.swing.JCheckBox hotDeploy;
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddDomainLocationPanel.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddDomainLocationPanel.java
index 82ff78f..84da0db 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddDomainLocationPanel.java
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddDomainLocationPanel.java
@@ -198,6 +198,9 @@ public class AddDomainLocationPanel implements WizardDescriptor.Panel, ChangeLis
wizardIterator.setPassword(panel.getPasswordValue());
wizardIterator.setAdminPort(Integer.parseInt(panel.getAdminPortValue()));
wizardIterator.setHttpPort(Integer.parseInt(panel.getHttpPortValue()));
+ wizardIterator.setDocker(panel.getDockerValue());
+ wizardIterator.setHostPath(panel.getHostPathValue());
+ wizardIterator.setContainerPath(panel.getContainerPathValue());
}
private String validateLocalHost(final Object rawHost) {
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddDomainLocationVisualPanel.form b/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddDomainLocationVisualPanel.form
index 588d333..502e714 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddDomainLocationVisualPanel.form
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddDomainLocationVisualPanel.form
@@ -43,18 +43,19 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
- <EmptySpace max="-2" attributes="0"/>
+ <EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" attributes="0">
+ <Component id="remoteLink" max="32767" attributes="0"/>
+ <Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
- <Component id="domainLocalLabel" linkSize="3" alignment="0" min="-2" max="-2" attributes="0"/>
- <Component id="domainRemoteLabel" linkSize="3" alignment="0" min="-2" max="-2" attributes="0"/>
- <Component id="hostLocalLabel" linkSize="3" alignment="0" min="-2" max="-2" attributes="0"/>
- <Component id="hostRemoteLabel" linkSize="3" alignment="0" min="-2" max="-2" attributes="0"/>
- <Component id="dasPortFieldLabel" linkSize="3" alignment="0" min="-2" max="-2" attributes="0"/>
- <Component id="targetValueLabel" linkSize="3" alignment="0" min="-2" max="-2" attributes="0"/>
- <Component id="userNameLabel" linkSize="3" alignment="0" min="-2" max="-2" attributes="0"/>
- <Component id="passwordLabel" linkSize="3" alignment="0" min="-2" max="-2" attributes="0"/>
+ <Component id="domainLocalLabel" linkSize="3" alignment="0" max="32767" attributes="0"/>
+ <Component id="domainRemoteLabel" linkSize="3" alignment="0" max="32767" attributes="0"/>
+ <Component id="hostLocalLabel" linkSize="3" alignment="0" max="32767" attributes="0"/>
+ <Component id="hostRemoteLabel" linkSize="3" alignment="0" max="32767" attributes="0"/>
+ <Component id="dasPortFieldLabel" linkSize="3" alignment="0" max="32767" attributes="0"/>
+ <Component id="targetValueLabel" linkSize="3" alignment="0" max="32767" attributes="0"/>
+ <Component id="userNameLabel" linkSize="3" alignment="0" max="32767" attributes="0"/>
+ <Component id="passwordLabel" linkSize="3" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
@@ -72,7 +73,7 @@
<Component id="userNameField" alignment="0" max="32767" attributes="0"/>
<Component id="targetValueField" alignment="0" max="32767" attributes="1"/>
<Group type="102" attributes="0">
- <Component id="dasPortField" pref="73" max="32767" attributes="1"/>
+ <Component id="dasPortField" pref="7" max="32767" attributes="1"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="httpPortFieldLabel" linkSize="3" min="-2" max="-2" attributes="0"/>
</Group>
@@ -80,7 +81,7 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" max="-2" attributes="0"/>
- <Component id="httpPortField" pref="74" max="32767" attributes="0"/>
+ <Component id="httpPortField" pref="7" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="useDefaultPortsCB" min="-2" max="-2" attributes="0"/>
</Group>
@@ -92,7 +93,16 @@
</Group>
</Group>
</Group>
- <Component id="remoteLink" max="32767" attributes="0"/>
+ <Component id="dockerVolumeCheckBox" min="-2" max="-2" attributes="0"/>
+ <Group type="102" attributes="0">
+ <Component id="hostPathLabel" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="hostPathField" max="32767" attributes="1"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="containerPathLabel" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="containerPathField" max="32767" attributes="1"/>
+ </Group>
</Group>
</Group>
</Group>
@@ -144,9 +154,18 @@
<Component id="passwordLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="passwordField" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
- <EmptySpace type="unrelated" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="dockerVolumeCheckBox" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="hostPathLabel" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="containerPathLabel" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="hostPathField" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="containerPathField" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
<Component id="remoteLink" max="-2" attributes="0"/>
- <EmptySpace pref="73" max="32767" attributes="0"/>
+ <EmptySpace max="32767" attributes="0"/>
<Component id="remotePanel" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
@@ -279,7 +298,7 @@
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
- <EmptySpace min="0" pref="37" max="32767" attributes="0"/>
+ <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@@ -412,5 +431,51 @@
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="remoteLinkMouseClicked"/>
</Events>
</Component>
+ <Component class="javax.swing.JLabel" name="hostPathLabel">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/netbeans/modules/payara/common/wizards/Bundle.properties" key="AddDomainLocationVisualPanel.hostPathLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[75, 14]"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JLabel" name="containerPathLabel">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/netbeans/modules/payara/common/wizards/Bundle.properties" key="AddDomainLocationVisualPanel.containerPathLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[100, 14]"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JCheckBox" name="dockerVolumeCheckBox">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/netbeans/modules/payara/common/wizards/Bundle.properties" key="AddDomainLocationVisualPanel.dockerVolumeCheckBox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="dockerVolumeCheckBoxActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JTextField" name="hostPathField">
+ <Properties>
+ <Property name="columns" type="int" value="5"/>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/netbeans/modules/payara/common/wizards/Bundle.properties" key="AddDomainLocationVisualPanel.hostPathField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="containerPathField">
+ <Properties>
+ <Property name="columns" type="int" value="5"/>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/netbeans/modules/payara/common/wizards/Bundle.properties" key="AddDomainLocationVisualPanel.containerPathField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
+ </Property>
+ </Properties>
+ </Component>
</SubComponents>
</Form>
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddDomainLocationVisualPanel.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddDomainLocationVisualPanel.java
index 80737c7..8b385f4 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddDomainLocationVisualPanel.java
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/AddDomainLocationVisualPanel.java
@@ -91,6 +91,7 @@ public class AddDomainLocationVisualPanel extends javax.swing.JPanel {
hostRemoteLabel.setVisible(false);
hostRemoteField.setVisible(false);
remoteLink.setVisible(false);
+ dockerVolumeCheckBox.setVisible(false);
} else {
domainLocalLabel.setVisible(false);
domainLocalField.setVisible(false);
@@ -102,7 +103,13 @@ public class AddDomainLocationVisualPanel extends javax.swing.JPanel {
hostRemoteLabel.setVisible(true);
hostRemoteField.setVisible(true);
remoteLink.setVisible(true);
+ dockerVolumeCheckBox.setVisible(true);
}
+ hostPathLabel.setVisible(dockerVolumeCheckBox.isSelected());
+ hostPathField.setVisible(dockerVolumeCheckBox.isSelected());
+ containerPathLabel.setVisible(dockerVolumeCheckBox.isSelected());
+ containerPathField.setVisible(dockerVolumeCheckBox.isSelected());
+
KeyListener kl = new MyKeyListener();
if (isLocal) {
// Put the choices into the combo box...
@@ -133,32 +140,23 @@ public class AddDomainLocationVisualPanel extends javax.swing.JPanel {
domainLocalField.setModel(model);
domainLocalField.getEditor()
.getEditorComponent().addKeyListener(kl);
- domainLocalField.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent arg0) {
- domainLocalField.getEditor().setItem(
- domainLocalField.getSelectedItem());
- fireChangeEvent();
- }
+ domainLocalField.addActionListener(arg0 -> {
+ domainLocalField.getEditor().setItem(
+ domainLocalField.getSelectedItem());
+ fireChangeEvent();
});
- localIpCB.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- updateLocalIpsCombobox();
- fireChangeEvent();
- }
+ localIpCB.addActionListener((e) -> {
+ updateLocalIpsCombobox();
+ fireChangeEvent();
});
updateLocalIpsCombobox();
} else {
domainRemoteField.addKeyListener(kl);
hostRemoteField.addKeyListener(kl);
}
- useDefaultPortsCB.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- updatePortsFields();
- fireChangeEvent();
- }
+ useDefaultPortsCB.addActionListener(e -> {
+ updatePortsFields();
+ fireChangeEvent();
});
dasPortField.addKeyListener(kl);
httpPortField.addKeyListener(kl);
@@ -175,6 +173,8 @@ public class AddDomainLocationVisualPanel extends javax.swing.JPanel {
targetValueField.addKeyListener(kl);
userNameField.addKeyListener(kl);
passwordField.addKeyListener(kl);
+ hostPathField.addKeyListener(kl);
+ containerPathField.addKeyListener(kl);
}
/**
@@ -226,6 +226,18 @@ public class AddDomainLocationVisualPanel extends javax.swing.JPanel {
return userNameField.getText().trim();
}
+ boolean getDockerValue() {
+ return dockerVolumeCheckBox.isSelected();
+ }
+
+ String getHostPathValue() {
+ return hostPathField.getText().trim();
+ }
+
+ String getContainerPathValue() {
+ return containerPathField.getText().trim();
+ }
+
/**
* Return administrator's password value from text field.
* <p/>
@@ -452,6 +464,11 @@ public class AddDomainLocationVisualPanel extends javax.swing.JPanel {
domainRemoteLabel = new javax.swing.JLabel();
domainRemoteField = new javax.swing.JTextField();
remoteLink = new javax.swing.JLabel();
+ hostPathLabel = new javax.swing.JLabel();
+ containerPathLabel = new javax.swing.JLabel();
+ dockerVolumeCheckBox = new javax.swing.JCheckBox();
+ hostPathField = new javax.swing.JTextField();
+ containerPathField = new javax.swing.JTextField();
setPreferredSize(new java.awt.Dimension(438, 353));
@@ -491,7 +508,7 @@ public class AddDomainLocationVisualPanel extends javax.swing.JPanel {
);
remotePanelLayout.setVerticalGroup(
remotePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGap(0, 37, Short.MAX_VALUE)
+ .addGap(0, 0, Short.MAX_VALUE)
);
domainLocalLabel.setLabelFor(domainLocalField);
@@ -532,6 +549,25 @@ public class AddDomainLocationVisualPanel extends javax.swing.JPanel {
}
});
+ hostPathLabel.setText(org.openide.util.NbBundle.getMessage(AddDomainLocationVisualPanel.class, "AddDomainLocationVisualPanel.hostPathLabel.text")); // NOI18N
+ hostPathLabel.setMinimumSize(new java.awt.Dimension(75, 14));
+
+ containerPathLabel.setText(org.openide.util.NbBundle.getMessage(AddDomainLocationVisualPanel.class, "AddDomainLocationVisualPanel.containerPathLabel.text")); // NOI18N
+ containerPathLabel.setMinimumSize(new java.awt.Dimension(100, 14));
+
+ dockerVolumeCheckBox.setText(org.openide.util.NbBundle.getMessage(AddDomainLocationVisualPanel.class, "AddDomainLocationVisualPanel.dockerVolumeCheckBox.text")); // NOI18N
+ dockerVolumeCheckBox.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ dockerVolumeCheckBoxActionPerformed(evt);
+ }
+ });
+
+ hostPathField.setColumns(5);
+ hostPathField.setText(org.openide.util.NbBundle.getMessage(AddDomainLocationVisualPanel.class, "AddDomainLocationVisualPanel.hostPathField.text")); // NOI18N
+
+ containerPathField.setColumns(5);
+ containerPathField.setText(org.openide.util.NbBundle.getMessage(AddDomainLocationVisualPanel.class, "AddDomainLocationVisualPanel.containerPathField.text")); // NOI18N
+
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
@@ -539,16 +575,17 @@ public class AddDomainLocationVisualPanel extends javax.swing.JPanel {
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(remoteLink, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(domainLocalLabel)
- .addComponent(domainRemoteLabel)
- .addComponent(hostLocalLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(hostRemoteLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(dasPortFieldLabel)
- .addComponent(targetValueLabel)
- .addComponent(userNameLabel)
- .addComponent(passwordLabel))
+ .addComponent(domainLocalLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(domainRemoteLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(hostLocalLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(hostRemoteLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(dasPortFieldLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(targetValueLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(userNameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(passwordLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
@@ -564,19 +601,27 @@ public class AddDomainLocationVisualPanel extends javax.swing.JPanel {
.addComponent(userNameField, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(targetValueField, javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
- .addComponent(dasPortField, javax.swing.GroupLayout.DEFAULT_SIZE, 73, Short.MAX_VALUE)
+ .addComponent(dasPortField, javax.swing.GroupLayout.DEFAULT_SIZE, 7, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(httpPortFieldLabel)))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(httpPortField, javax.swing.GroupLayout.DEFAULT_SIZE, 74, Short.MAX_VALUE)
+ .addComponent(httpPortField, javax.swing.GroupLayout.DEFAULT_SIZE, 7, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(useDefaultPortsCB))
.addGroup(layout.createSequentialGroup()
.addGap(112, 112, 112)
.addComponent(remotePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))))
- .addComponent(remoteLink)))
+ .addComponent(dockerVolumeCheckBox)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(hostPathLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(hostPathField)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(containerPathLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(containerPathField))))
);
layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {dasPortFieldLabel, domainLocalLabel, domainRemoteLabel, hostLocalLabel, hostRemoteLabel, httpPortFieldLabel, passwordLabel, targetValueLabel, userNameLabel});
@@ -620,9 +665,17 @@ public class AddDomainLocationVisualPanel extends javax.swing.JPanel {
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(passwordLabel)
.addComponent(passwordField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(remoteLink, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 73, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(dockerVolumeCheckBox)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(hostPathLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(containerPathLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(hostPathField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(containerPathField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(remoteLink)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(remotePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
@@ -641,16 +694,27 @@ public class AddDomainLocationVisualPanel extends javax.swing.JPanel {
}
}//GEN-LAST:event_remoteLinkMouseClicked
+ private void dockerVolumeCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dockerVolumeCheckBoxActionPerformed
+ hostPathLabel.setVisible(dockerVolumeCheckBox.isSelected());
+ hostPathField.setVisible(dockerVolumeCheckBox.isSelected());
+ containerPathLabel.setVisible(dockerVolumeCheckBox.isSelected());
+ containerPathField.setVisible(dockerVolumeCheckBox.isSelected());
+ }//GEN-LAST:event_dockerVolumeCheckBoxActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JTextField containerPathField;
+ private javax.swing.JLabel containerPathLabel;
private javax.swing.JTextField dasPortField;
private javax.swing.JLabel dasPortFieldLabel;
+ private javax.swing.JCheckBox dockerVolumeCheckBox;
private javax.swing.JComboBox domainLocalField;
private javax.swing.JLabel domainLocalLabel;
private javax.swing.JTextField domainRemoteField;
private javax.swing.JLabel domainRemoteLabel;
private javax.swing.JComboBox hostLocalField;
private javax.swing.JLabel hostLocalLabel;
+ private javax.swing.JTextField hostPathField;
+ private javax.swing.JLabel hostPathLabel;
private javax.swing.JTextField hostRemoteField;
private javax.swing.JLabel hostRemoteLabel;
private javax.swing.JTextField httpPortField;
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/Bundle.properties b/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/Bundle.properties
index bfa6626..f2042cd 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/Bundle.properties
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/Bundle.properties
@@ -172,3 +172,8 @@ AddDomainLocationVisualPanel.hostLocalLabel.text=Host:
AddDomainLocationVisualPanel.hostRemoteLabel.text=&Host:
AddDomainLocationVisualPanel.localIpCB.text=Loopback
AddDomainLocationVisualPanel.remoteLink.text=<html><a href="#">Note the remote administration needs to be enabled before registering the remote domain.</a></html>
+AddDomainLocationVisualPanel.containerPathLabel.text=Container Path
+AddDomainLocationVisualPanel.hostPathLabel.text=Host Path
+AddDomainLocationVisualPanel.hostPathField.text=
+AddDomainLocationVisualPanel.containerPathField.text=
+AddDomainLocationVisualPanel.dockerVolumeCheckBox.text=Docker Volume
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/ServerWizardIterator.java b/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/ServerWizardIterator.java
index 99c6603..df83bae 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/ServerWizardIterator.java
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/common/wizards/ServerWizardIterator.java
@@ -233,6 +233,9 @@ public class ServerWizardIterator extends PortCollection implements WizardDescri
private String userName;
/** Payara server administrator's password. */
private String password;
+ private boolean docker;
+ private String hostPath;
+ private String containerPath;
private String installRoot;
private String payaraRoot;
private String hostName;
@@ -335,6 +338,30 @@ public class ServerWizardIterator extends PortCollection implements WizardDescri
return instanceProvider.hasServer(uri);
}
+ public boolean isDocker() {
+ return docker;
+ }
+
+ public void setDocker(boolean docker) {
+ this.docker = docker;
+ }
+
+ public String getHostPath() {
+ return hostPath;
+ }
+
+ public void setHostPath(String hostPath) {
+ this.hostPath = hostPath;
+ }
+
+ public String getContainerPath() {
+ return containerPath;
+ }
+
+ public void setContainerPath(String containerPath) {
+ this.containerPath = containerPath;
+ }
+
PayaraPlatformVersionAPI isValidInstall(File installDir, File payaraDir, WizardDescriptor wizard) {
String errMsg = NbBundle.getMessage(AddServerLocationPanel.class, "ERR_InstallationInvalid", // NOI18N
FileUtil.normalizeFile(installDir).getPath());
@@ -490,14 +517,16 @@ public class ServerWizardIterator extends PortCollection implements WizardDescri
cd.start();
PayaraInstance instance = PayaraInstance.create((String) wizard.getProperty("ServInstWizard_displayName"), // NOI18N
installRoot, payaraRoot, domainsDir, domainName,
- newHttpPort, newAdminPort, userName, password, targetValue,
+ newHttpPort, newAdminPort, userName, password,
+ docker, hostPath, containerPath, targetValue,
formatUri(hostName, newAdminPort, getTargetValue(),domainsDir,domainName),
instanceProvider);
result.add(instance.getCommonInstance());
} else {
PayaraInstance instance = PayaraInstance.create((String) wizard.getProperty("ServInstWizard_displayName"), // NOI18N
installRoot, payaraRoot, domainsDir, domainName,
- getHttpPort(), getAdminPort(), userName, password, targetValue,
+ getHttpPort(), getAdminPort(), userName, password,
+ docker, hostPath, containerPath, targetValue,
formatUri(hostName, getAdminPort(), getTargetValue(), domainsDir, domainName),
instanceProvider);
result.add(instance.getCommonInstance());
@@ -511,7 +540,8 @@ public class ServerWizardIterator extends PortCollection implements WizardDescri
}
PayaraInstance instance = PayaraInstance.create((String) wizard.getProperty("ServInstWizard_displayName"), // NOI18N
installRoot, payaraRoot, null, domainName,
- getHttpPort(), getAdminPort(), userName, password, targetValue,
+ getHttpPort(), getAdminPort(), userName, password,
+ docker, hostPath, containerPath, targetValue,
formatUri(hn, getAdminPort(), getTargetValue(),null, domainName),
instanceProvider);
result.add(instance.getCommonInstance());
diff --git a/enterprise/payara.common/src/org/netbeans/modules/payara/spi/PayaraModule.java b/enterprise/payara.common/src/org/netbeans/modules/payara/spi/PayaraModule.java
index 69522bb..8122928 100644
--- a/enterprise/payara.common/src/org/netbeans/modules/payara/spi/PayaraModule.java
+++ b/enterprise/payara.common/src/org/netbeans/modules/payara/spi/PayaraModule.java
@@ -47,6 +47,9 @@ public interface PayaraModule {
public static final String DISPLAY_NAME_ATTR = "displayName"; // NOI18N
public static final String USERNAME_ATTR = "username"; // NOI18N
public static final String PASSWORD_ATTR = "password"; // NOI18N
+ public static final String DOCKER_ATTR = "docker"; // NOI18N
+ public static final String HOST_PATH_ATTR = "hostPath"; // NOI18N
+ public static final String CONTAINER_PATH_ATTR = "containerPath"; // NOI18N
public static final String ADMINPORT_ATTR = "adminPort"; // NOI18N
public static final String TARGET_ATTR = "target";
public static final String HTTPPORT_ATTR = "httpportnumber"; // NOI18N
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2DeploymentManager.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2DeploymentManager.java
index 489cb8d..1c6d2d9 100644
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2DeploymentManager.java
+++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2DeploymentManager.java
@@ -585,7 +585,7 @@ public class Hk2DeploymentManager implements DeploymentManager2 {
= PayaraInstanceProvider.getPayaraInstanceByUri(uri);
return instance != null ? instance.getCommonSupport() : null;
}
-
+
private String constructServerUri(String protocol, String host, String port, String path) {
StringBuilder builder = new StringBuilder(128);
builder.append(protocol);
@@ -608,6 +608,20 @@ public class Hk2DeploymentManager implements DeploymentManager2 {
return result;
}
+ public boolean isDocker() {
+ boolean result = true;
+ PayaraModule commonSupport = getCommonServerSupport();
+ if (commonSupport != null
+ && (!commonSupport.getInstance().isDocker()
+ || commonSupport.getInstance().getHostPath() == null
+ || commonSupport.getInstance().getHostPath().isEmpty()
+ || commonSupport.getInstance().getContainerPath() == null
+ || commonSupport.getInstance().getContainerPath().isEmpty())) {
+ result = false;
+ }
+ return result;
+ }
+
public static String getTargetFromUri(String uri) {
String target = null;
int lastColon = uri.lastIndexOf(':');
diff --git a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2OptionalFactory.java b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2OptionalFactory.java
index afea324..c97a77b 100644
--- a/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2OptionalFactory.java
+++ b/enterprise/payara.jakartaee/src/org/netbeans/modules/payara/jakartaee/Hk2OptionalFactory.java
@@ -86,7 +86,7 @@ public class Hk2OptionalFactory extends OptionalDeploymentManagerFactory {
IncrementalDeployment result = null;
if(dm instanceof Hk2DeploymentManager) {
Hk2DeploymentManager hk2dm = (Hk2DeploymentManager) dm;
- if(hk2dm.isLocal()) {
+ if(hk2dm.isLocal() || hk2dm.isDocker()) {
result = new FastDeploy(hk2dm);
}
}
diff --git a/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig b/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig
index 22fc383..ce4a6fd 100644
--- a/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig
+++ b/enterprise/payara.tooling/nbproject/org-netbeans-modules-payara-tooling.sig
@@ -1378,6 +1378,9 @@ meth public abstract int getAdminPort()
meth public abstract int getPort()
meth public abstract java.lang.String getAdminPassword()
meth public abstract java.lang.String getAdminUser()
+meth public abstract boolean isDocker()
+meth public abstract java.lang.String getHostPath()
+meth public abstract java.lang.String getContainerPath()
meth public abstract java.lang.String getDomainName()
meth public abstract java.lang.String getDomainsFolder()
meth public abstract java.lang.String getHost()
@@ -1399,6 +1402,9 @@ meth public int getAdminPort()
meth public int getPort()
meth public java.lang.String getAdminPassword()
meth public java.lang.String getAdminUser()
+meth public abstract boolean isDocker()
+meth public abstract java.lang.String getHostPath()
+meth public abstract java.lang.String getContainerPath()
meth public java.lang.String getDomainName()
meth public java.lang.String getDomainsFolder()
meth public java.lang.String getHost()
diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/admin/RunnerHttpDeploy.java b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/admin/RunnerHttpDeploy.java
index 7607694..c0da1ad 100644
--- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/admin/RunnerHttpDeploy.java
+++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/admin/RunnerHttpDeploy.java
@@ -20,6 +20,8 @@ package org.netbeans.modules.payara.tooling.admin;
import java.io.*;
import java.net.HttpURLConnection;
+import java.nio.file.Path;
+import java.nio.file.Paths;
import java.util.logging.Level;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@@ -93,7 +95,7 @@ public class RunnerHttpDeploy extends RunnerHttp {
* @param command Payara server administration deploy command entity.
* @return Deploy query string for given command.
*/
- private static String query(final Command command) {
+ private static String query(final PayaraServer server, final Command command) {
// Prepare values
String name;
String path;
@@ -109,6 +111,17 @@ public class RunnerHttpDeploy extends RunnerHttp {
}
name = Utils.sanitizeName(deploy.name);
path = deploy.path.getAbsolutePath();
+ if (server.isDocker()
+ && server.getHostPath() != null
+ && !server.getHostPath().isEmpty()
+ && server.getContainerPath() != null
+ && !server.getContainerPath().isEmpty()) {
+ Path relativePath = Paths.get(server.getHostPath()).relativize(deploy.path.toPath());
+ path = Paths.get(server.getContainerPath(), relativePath.toString()).toString();
+ if (server.getContainerPath().startsWith("/")) {
+ path = path.replace("\\", "/");
+ }
+ }
target =deploy.target;
ctxRoot = deploy.contextRoot;
hotDeploy = Boolean.toString(deploy.hotDeploy);
@@ -186,7 +199,7 @@ public class RunnerHttpDeploy extends RunnerHttp {
*/
public RunnerHttpDeploy(final PayaraServer server,
final Command command) {
- super(server, command, query(command));
+ super(server, command, query(server, command));
this.command = (CommandDeploy)command;
}
diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraServer.java b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraServer.java
index 86e0dfd..f892305 100644
--- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraServer.java
+++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraServer.java
@@ -74,6 +74,28 @@ public interface PayaraServer {
public String getAdminPassword();
/**
+ * Get information if this Payara server instance is running in docker container.
+ * <p/>
+ * @return Value of <code>true</code> when this Payara server instance
+ * is docker instance or <code>false</code> otherwise.
+ */
+ public boolean isDocker();
+
+ /**
+ * Get the docker host path.
+ * <p/>
+ * @return The dcoker volume host path.
+ */
+ public String getHostPath();
+
+ /**
+ * Get the docker container path.
+ * <p/>
+ * @return The dcoker volume container path.
+ */
+ public String getContainerPath();
+
+ /**
* Get Payara server domains folder.
* <p/>
* @return Domains folder.
diff --git a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraServerEntity.java b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraServerEntity.java
index 420b266..c3a3ea4 100644
--- a/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraServerEntity.java
+++ b/enterprise/payara.tooling/src/org/netbeans/modules/payara/tooling/data/PayaraServerEntity.java
@@ -59,6 +59,18 @@ public class PayaraServerEntity implements PayaraServer {
* (PayaraModule.PASSWORD_ATTR). */
private String adminPassword;
+ /** Docker instance
+ * (PayaraModule.DOCKER_ATTR). */
+ private boolean docker;
+
+ /** Docker instance
+ * (PayaraModule.HOST_PATH_ATTR). */
+ private String hostPath;
+
+ /** Docker instance
+ * (PayaraModule.CONTAINER_PATH_ATTR). */
+ private String containerPath;
+
/** Payara server domains folder. (PayaraModule.DOMAINS_FOLDER_ATTR) */
private String domainsFolder;
@@ -437,4 +449,31 @@ public class PayaraServerEntity implements PayaraServer {
return domainsFolder == null;
}
+ @Override
+ public boolean isDocker() {
+ return docker;
+ }
+
+ public void setDocker(boolean docker) {
+ this.docker = docker;
+ }
+
+ @Override
+ public String getHostPath() {
+ return hostPath;
+ }
+
+ public void setHostPath(String hostPath) {
+ this.hostPath = hostPath;
+ }
+
+ @Override
+ public String getContainerPath() {
+ return containerPath;
+ }
+
+ public void setContainerPath(String containerPath) {
+ this.containerPath = containerPath;
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists