diff options
author | Kalina Jasinska <kalina.jasinska@gmail.com> | 2013-08-06 11:32:30 (GMT) |
---|---|---|
committer | Kalina Jasinska <kalina.jasinska@gmail.com> | 2013-08-06 11:32:30 (GMT) |
commit | 20d5483c09adfd64457077a6a8c25b2d4a0e3bc7 (patch) | |
tree | 7c5f2fcc5874ba465810809efc60a3d6f4aef537 /idrop-swing | |
parent | 49f461d8539c2a75d494135ab4c6a86c400dfce2 (diff) | |
download | QCG-Data-20d5483c09adfd64457077a6a8c25b2d4a0e3bc7.zip QCG-Data-20d5483c09adfd64457077a6a8c25b2d4a0e3bc7.tar.gz QCG-Data-20d5483c09adfd64457077a6a8c25b2d4a0e3bc7.tar.bz2 |
public link by michpubliclink
Diffstat (limited to 'idrop-swing')
9 files changed, 3376 insertions, 3715 deletions
diff --git a/idrop-swing/idrop-swing.iml b/idrop-swing/idrop-swing.iml new file mode 100644 index 0000000..df3d30c --- /dev/null +++ b/idrop-swing/idrop-swing.iml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$/target/classes" /> + <output-test url="file://$MODULE_DIR$/target/test-classes" /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" /> + <excludeFolder url="file://$MODULE_DIR$/target" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="library" name="Maven: org.irods.jargon:jargon-data-utils:3.3.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.8.2" level="project" /> + <orderEntry type="library" name="Maven: org.irods.jargon:jargon-core:3.3.0" level="project" /> + <orderEntry type="library" scope="RUNTIME" name="Maven: commons-logging:commons-logging:1.1.1" level="project" /> + <orderEntry type="library" name="Maven: commons-io:commons-io:2.0.1" level="project" /> + <orderEntry type="library" name="Maven: org.apache.commons:commons-exec:1.0.1" level="project" /> + <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.4" level="project" /> + <orderEntry type="library" scope="RUNTIME" name="Maven: com.claymoresystems:puretls:1.1" level="project" /> + <orderEntry type="library" name="Maven: org.globus.jglobus:cog-jglobus:1.8.0" level="project" /> + <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.5.10" level="project" /> + <orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.5.10" level="project" /> + <orderEntry type="library" name="Maven: log4j:log4j:1.2.16" level="project" /> + <orderEntry type="library" name="Maven: commons-pool:commons-pool:1.5.6" level="project" /> + <orderEntry type="library" name="Maven: org.apache.tika:tika-core:1.1" level="project" /> + <orderEntry type="library" name="Maven: org.irods.jargon:jargon-user-tagging:3.3.0" level="project" /> + <orderEntry type="library" name="Maven: org.irods.jargon.transfer:jargon-transfer-dao-spring:3.3.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.dbunit:dbunit:2.2" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: junit-addons:junit-addons:1.4" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: xerces:xercesImpl:2.6.2" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: xerces:xmlParserAPIs:2.6.2" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: poi:poi:2.5.1-final-20040804" level="project" /> + <orderEntry type="library" scope="RUNTIME" name="Maven: commons-collections:commons-collections:3.2.1" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: commons-lang:commons-lang:2.1" level="project" /> + <orderEntry type="library" name="Maven: org.apache.derby:derby:10.6.1.0" level="project" /> + <orderEntry type="library" name="Maven: org.irods.jargon.transfer:jargon-transfer-engine:3.3.0" level="project" /> + <orderEntry type="library" name="Maven: javassist:javassist:3.8.0.GA" level="project" /> + <orderEntry type="library" scope="RUNTIME" name="Maven: org.hibernate:hibernate-core:3.3.2.GA" level="project" /> + <orderEntry type="library" scope="RUNTIME" name="Maven: antlr:antlr:2.7.7" level="project" /> + <orderEntry type="library" scope="RUNTIME" name="Maven: dom4j:dom4j:1.6.1" level="project" /> + <orderEntry type="library" scope="RUNTIME" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" /> + <orderEntry type="library" scope="RUNTIME" name="Maven: javax.transaction:jta:1.1" level="project" /> + <orderEntry type="library" name="Maven: org.irods.jargon:jargon-ticket:3.3.0" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-swing-outline:RELEASE711" level="project" /> + <orderEntry type="library" name="Maven: org.swinglabs:swing-layout:1.0.3" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-all:1.8.1" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-util:RELEASE711" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-util-lookup:RELEASE711" level="project" /> + </component> +</module> + diff --git a/idrop-swing/pom.xml b/idrop-swing/pom.xml index 18f612b..cf20d93 100644 --- a/idrop-swing/pom.xml +++ b/idrop-swing/pom.xml @@ -52,6 +52,11 @@ <scope>compile</scope> </dependency> <dependency> + <groupId>org.irods.jargon</groupId> + <artifactId>jargon-ticket</artifactId> + <scope>compile</scope> + </dependency> + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> @@ -71,6 +76,16 @@ <version>3.3.2.GA</version> <scope>runtime</scope> </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>1.5.10</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.5.10</version> + </dependency> </dependencies> <build> <plugins> @@ -152,7 +167,7 @@ <!--install>false</install--> <!-- not yet supported --> - <verbose>false</verbose> + <verbose>true</verbose> </configuration> </plugin> <plugin> @@ -160,7 +175,7 @@ <configuration> <archive> <manifest> - <mainClass>org.irods.jargon.idrop.desktop.systraygui.StartupSequencer</mainClass> + <mainClass>org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop</mainClass> </manifest> </archive> </configuration> @@ -173,7 +188,7 @@ </descriptorRefs> <archive> <manifest> - <mainClass>org.irods.jargon.idrop.desktop.systraygui.StartupSequencer</mainClass> + <mainClass>org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop</mainClass> </manifest> </archive> </configuration> @@ -199,7 +214,7 @@ </execution> </executions> <configuration> - <mainClass>org.irods.jargon.idrop.desktop.systraygui.StartupSequencer</mainClass> + <mainClass>org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop</mainClass> </configuration> </plugin> <plugin> diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java index 9a32abe..9e941e0 100644 --- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java +++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java @@ -1,3 +1,4 @@ + /* * IDROPConfigurationPanel.java * @@ -5,25 +6,19 @@ */ package org.irods.jargon.idrop.desktop.systraygui; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Toolkit; +import java.awt.*; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; import java.awt.event.ItemEvent; +import java.net.URL; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; - -import javax.swing.DefaultComboBoxModel; -import javax.swing.JFileChooser; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JTable; -import javax.swing.ListSelectionModel; +import java.util.Set; +import javax.swing.*; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; - import org.irods.jargon.core.connection.DefaultPropertiesJargonConfig; import org.irods.jargon.core.connection.IRODSAccount; import org.irods.jargon.core.connection.JargonProperties; @@ -37,2571 +32,2025 @@ import org.irods.jargon.idrop.exceptions.IdropException; import org.irods.jargon.idrop.exceptions.IdropRuntimeException; import org.irods.jargon.idrop.finder.IRODSFinderDialog; import org.irods.jargon.transfer.dao.domain.FrequencyType; +import org.irods.jargon.transfer.dao.domain.LocalIRODSTransfer; import org.irods.jargon.transfer.dao.domain.Synchronization; import org.irods.jargon.transfer.dao.domain.SynchronizationType; import org.irods.jargon.transfer.dao.domain.TransferStatus; +import org.irods.jargon.transfer.engine.synch.ConflictingSynchException; import org.irods.jargon.transfer.engine.synch.SynchException; import org.irods.jargon.transfer.engine.synch.SynchManagerService; import org.irods.jargon.transfer.util.HibernateUtil; +import org.openide.util.Exceptions; import org.slf4j.LoggerFactory; /** * Tools/Preferences dialog to set preferences - * + * * @author mikeconway */ public class IDROPConfigurationPanel extends javax.swing.JDialog { - /** - * - */ - private static final long serialVersionUID = 6853489664356886078L; - private final IDROPCore idropCore; - private static final org.slf4j.Logger log = LoggerFactory - .getLogger(IDROPConfigurationPanel.class); - private JTable jTableSynch = null; - private Synchronization selectedSynchronization = null; - private DateFormat dateFormat = SimpleDateFormat.getDateTimeInstance(); - private final iDrop idropGui; - private boolean initializing = true; - - /** - * Creates new form IDROPConfigurationPanel - */ - public IDROPConfigurationPanel(final java.awt.Frame parent, - final boolean modal, final IDROPCore idropCore) { - super(parent, modal); - this.idropCore = idropCore; - idropGui = (iDrop) parent; - initComponents(); - initWithConfigData(); - } - - private boolean checkIfSynchChanged() throws IdropRuntimeException { - // compare data and update synch first if necessary - - boolean areEqual = true; - - if (!selectedSynchronization.getLocalSynchDirectory().equals( - txtLocalPath.getText())) { - areEqual = false; - } - - if (!selectedSynchronization.getName().equals(txtSynchName.getText())) { - areEqual = false; - } - - if (!selectedSynchronization.getIrodsSynchDirectory().equals( - txtIrodsPath.getText())) { - areEqual = false; - } - - SynchronizationType currentSynchronizationType = getSynchTypeFromGUI(); - - if (currentSynchronizationType != selectedSynchronization - .getSynchronizationMode()) { - areEqual = false; - } - - FrequencyType currentFrequencyType = null; - currentFrequencyType = getSynchFrequencyFromGUI(); - - if (selectedSynchronization.getFrequencyType() != currentFrequencyType) { - areEqual = false; - } - - return areEqual; - } - - private FrequencyType getSynchFrequencyFromGUI() { - FrequencyType currentFrequencyType = null; - if (jcomboSynchFrequency.getSelectedIndex() == 0) { - currentFrequencyType = FrequencyType.EVERY_HOUR; - } else if (jcomboSynchFrequency.getSelectedIndex() == 1) { - currentFrequencyType = FrequencyType.EVERY_WEEK; - } else if (jcomboSynchFrequency.getSelectedIndex() == 2) { - currentFrequencyType = FrequencyType.EVERY_DAY; - } else if (jcomboSynchFrequency.getSelectedIndex() == 3) { - currentFrequencyType = FrequencyType.EVERY_TWO_MINUTES; - } - return currentFrequencyType; - } - - private SynchronizationType getSynchTypeFromGUI() - throws IdropRuntimeException { - SynchronizationType currentSynchronizationType; - if (radioBackup.isSelected()) { - currentSynchronizationType = SynchronizationType.ONE_WAY_LOCAL_TO_IRODS; - } else if (radioFeed.isSelected()) { - currentSynchronizationType = SynchronizationType.ONE_WAY_IRODS_TO_LOCAL; - } else if (radioSynch.isSelected()) { - currentSynchronizationType = SynchronizationType.BI_DIRECTIONAL; - } else { - log.error("unknown synchronization type in GUI"); - throw new IdropRuntimeException( - "unknown synchroization type in GUI"); - } - return currentSynchronizationType; - } - - /** - * This method is called from within the constructor to initialize the form. - * WARNING: Do NOT modify this code. The content of this method is always - * regenerated by the Form Editor. - */ - @SuppressWarnings("unchecked") - // <editor-fold defaultstate="collapsed" - // desc="Generated Code">//GEN-BEGIN:initComponents - private void initComponents() { - java.awt.GridBagConstraints gridBagConstraints; - - buttonGroupSynchMode = new javax.swing.ButtonGroup(); - pnlTop = new javax.swing.JPanel(); - pnlCenter = new javax.swing.JPanel(); - tabConfig = new javax.swing.JTabbedPane(); - pnlConfigIdrop = new javax.swing.JPanel(); - checkShowGUI = new javax.swing.JCheckBox(); - checkShowFileProgress = new javax.swing.JCheckBox(); - pnlConfigGrids = new javax.swing.JPanel(); - pnlCurrentGrid = new javax.swing.JPanel(); - lblHostLabel = new javax.swing.JLabel(); - lblHost = new javax.swing.JLabel(); - lblPortLabel = new javax.swing.JLabel(); - lblPort = new javax.swing.JLabel(); - lblZoneLabel = new javax.swing.JLabel(); - lblZone = new javax.swing.JLabel(); - lblResourceLabel = new javax.swing.JLabel(); - lblUserNameLabel = new javax.swing.JLabel(); - lblUserName = new javax.swing.JLabel(); - pnlCurrentGridToolbar = new javax.swing.JPanel(); - btnLogout = new javax.swing.JButton(); - btnChangePassword = new javax.swing.JButton(); - comboPrefsDefaultResource = new javax.swing.JComboBox(); - pnlConfigTransfers = new javax.swing.JPanel(); - pnlTransferManagement = new javax.swing.JPanel(); - checkLogSuccessfulTransfer = new javax.swing.JCheckBox(); - checkVerifyChecksumOnTransfer = new javax.swing.JCheckBox(); - checkAllowRerouting = new javax.swing.JCheckBox(); - checkConnectionRestart = new javax.swing.JCheckBox(); - plnPipelineConfiguration = new javax.swing.JPanel(); - lblIrodsSocketTimeout = new javax.swing.JLabel(); - spinnerIrodsSocketTimeout = new javax.swing.JSpinner(); - pnlParallelTransferOptions = new javax.swing.JPanel(); - checkAllowParallelTransfers = new javax.swing.JCheckBox(); - checkUseNIOForParallelTransfers = new javax.swing.JCheckBox(); - checkUseExecutorPool = new javax.swing.JCheckBox(); - lblIrodsParallelSocketTimeout = new javax.swing.JLabel(); - spinnerIrodsParallelSocketTimeout = new javax.swing.JSpinner(); - lblMaximumParallelTransferThreads = new javax.swing.JLabel(); - spinnerIrodsMaxParallelThreads = new javax.swing.JSpinner(); - pnlBuffers = new javax.swing.JPanel(); - lblInternalInputBufferSize = new javax.swing.JLabel(); - txtInternalInputBufferSize = new javax.swing.JTextField(); - lblInternalOutputBufferSize = new javax.swing.JLabel(); - txtInternalOutputBufferSize = new javax.swing.JTextField(); - lblLocalFileInputBufferSize = new javax.swing.JLabel(); - txtLocalFileInputBufferSize = new javax.swing.JTextField(); - lblLocalFileOutputBufferSize = new javax.swing.JLabel(); - txtLocalFileOutputBufferSize = new javax.swing.JTextField(); - lblPutBufferSize = new javax.swing.JLabel(); - txtPutBufferSize = new javax.swing.JTextField(); - lblGetBufferSize = new javax.swing.JLabel(); - txtGetBufferSize = new javax.swing.JTextField(); - lblIputToOutputCopyBufferSize = new javax.swing.JLabel(); - txtInputToOutputCopyBufferSize = new javax.swing.JTextField(); - lblInternalCacheBufferSize = new javax.swing.JLabel(); - txtInternalCacheBufferSize = new javax.swing.JTextField(); - btnRestoreDefaults = new javax.swing.JButton(); - btnApplyPipelineConfig = new javax.swing.JButton(); - pnlConfigSynch = new javax.swing.JPanel(); - pnlConfigSynchListing = new javax.swing.JPanel(); - pnlSynchRefresh = new javax.swing.JPanel(); - btnRefreshSynch = new javax.swing.JButton(); - scrollSynchTable = new javax.swing.JScrollPane(); - pnlConfigSynchDetails = new javax.swing.JPanel(); - pnlSynchData = new javax.swing.JPanel(); - pnlSynchName = new javax.swing.JPanel(); - lblSynchName = new javax.swing.JLabel(); - txtSynchName = new javax.swing.JTextField(); - lblSynchDateLabel = new javax.swing.JLabel(); - lblSynchDate = new javax.swing.JLabel(); - pnlSynchIcon = new javax.swing.JPanel(); - lblSynchStatus = new javax.swing.JLabel(); - pnlLocalSynch = new javax.swing.JPanel(); - txtLocalPath = new javax.swing.JTextField(); - btnChooseLocalSynch = new javax.swing.JButton(); - pnlSynchMode = new javax.swing.JPanel(); - jLabel1 = new javax.swing.JLabel(); - radioBackup = new javax.swing.JRadioButton(); - radioFeed = new javax.swing.JRadioButton(); - radioSynch = new javax.swing.JRadioButton(); - pnlSynchFrequency = new javax.swing.JPanel(); - jLabel5 = new javax.swing.JLabel(); - jcomboSynchFrequency = new javax.swing.JComboBox(); - pnlIrodsSynch = new javax.swing.JPanel(); - txtIrodsPath = new javax.swing.JTextField(); - btnChooseIrodsSynch = new javax.swing.JButton(); - panelSynchToolbar = new javax.swing.JPanel(); - btnDeleteSynch = new javax.swing.JButton(); - btnNewSynch = new javax.swing.JButton(); - btnUpdateSynch = new javax.swing.JButton(); - btnSynchNow = new javax.swing.JButton(); - pnlBottom = new javax.swing.JPanel(); - btnOK = new javax.swing.JButton(); - - setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); - setTitle(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, "IDROPConfigurationPanel.title")); // NOI18N - - org.jdesktop.layout.GroupLayout pnlTopLayout = new org.jdesktop.layout.GroupLayout( - pnlTop); - pnlTop.setLayout(pnlTopLayout); - pnlTopLayout.setHorizontalGroup(pnlTopLayout.createParallelGroup( - org.jdesktop.layout.GroupLayout.LEADING).add(0, 1067, - Short.MAX_VALUE)); - pnlTopLayout.setVerticalGroup(pnlTopLayout.createParallelGroup( - org.jdesktop.layout.GroupLayout.LEADING).add(0, 0, - Short.MAX_VALUE)); - - getContentPane().add(pnlTop, java.awt.BorderLayout.NORTH); - - pnlConfigIdrop.setLayout(new java.awt.GridBagLayout()); - - checkShowGUI.setMnemonic('s'); - checkShowGUI.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.checkShowGUI.text")); // NOI18N - checkShowGUI.setToolTipText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.checkShowGUI.toolTipText")); // NOI18N - checkShowGUI.addItemListener(new java.awt.event.ItemListener() { - @Override - public void itemStateChanged(final java.awt.event.ItemEvent evt) { - checkShowGUIItemStateChanged(evt); - } - }); - checkShowGUI.addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed(final java.awt.event.ActionEvent evt) { - checkShowGUIActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 0; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - pnlConfigIdrop.add(checkShowGUI, gridBagConstraints); - - checkShowFileProgress.setMnemonic('w'); - checkShowFileProgress.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.checkShowFileProgress.text")); // NOI18N - checkShowFileProgress - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.checkShowFileProgress.toolTipText")); // NOI18N - checkShowFileProgress - .addItemListener(new java.awt.event.ItemListener() { - @Override - public void itemStateChanged( - final java.awt.event.ItemEvent evt) { - checkShowFileProgressItemStateChanged(evt); - } - }); - checkShowFileProgress - .addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed( - final java.awt.event.ActionEvent evt) { - checkShowFileProgressActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 1; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - pnlConfigIdrop.add(checkShowFileProgress, gridBagConstraints); - - tabConfig - .addTab(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.pnlConfigIdrop.TabConstraints.tabTitle"), - pnlConfigIdrop); // NOI18N - - pnlConfigGrids.setLayout(new java.awt.BorderLayout()); - - pnlCurrentGrid - .setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.pnlCurrentGrid.border.title"))); // NOI18N - pnlCurrentGrid.setLayout(new java.awt.GridBagLayout()); - - lblHostLabel.setFont(new java.awt.Font("Lucida Grande", 1, 13)); // NOI18N - lblHostLabel.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblHostLabel.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; - pnlCurrentGrid.add(lblHostLabel, gridBagConstraints); - - lblHost.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblHost.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - pnlCurrentGrid.add(lblHost, gridBagConstraints); - lblHost.getAccessibleContext() - .setAccessibleDescription( - org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblHost.AccessibleContext.accessibleDescription")); // NOI18N - - lblPortLabel.setFont(new java.awt.Font("Lucida Grande", 1, 13)); // NOI18N - lblPortLabel.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblPortLabel.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 1; - gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; - pnlCurrentGrid.add(lblPortLabel, gridBagConstraints); - - lblPort.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblPort.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 1; - gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - pnlCurrentGrid.add(lblPort, gridBagConstraints); - lblPort.getAccessibleContext() - .setAccessibleDescription( - org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblPort.AccessibleContext.accessibleDescription")); // NOI18N - - lblZoneLabel.setFont(new java.awt.Font("Lucida Grande", 1, 13)); // NOI18N - lblZoneLabel.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblZoneLabel.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 2; - gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; - pnlCurrentGrid.add(lblZoneLabel, gridBagConstraints); - - lblZone.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblZone.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 2; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - pnlCurrentGrid.add(lblZone, gridBagConstraints); - lblZone.getAccessibleContext() - .setAccessibleDescription( - org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblZone.AccessibleContext.accessibleDescription")); // NOI18N - - lblResourceLabel.setFont(new java.awt.Font("Lucida Grande", 1, 13)); // NOI18N - lblResourceLabel.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblResourceLabel.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 4; - gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; - pnlCurrentGrid.add(lblResourceLabel, gridBagConstraints); - - lblUserNameLabel.setFont(new java.awt.Font("Lucida Grande", 1, 13)); // NOI18N - lblUserNameLabel.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblUserNameLabel.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 3; - gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; - pnlCurrentGrid.add(lblUserNameLabel, gridBagConstraints); - - lblUserName.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblUserName.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 3; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - pnlCurrentGrid.add(lblUserName, gridBagConstraints); - lblUserName - .getAccessibleContext() - .setAccessibleName( - org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblUserName.AccessibleContext.accessibleName")); // NOI18N - - btnLogout.setMnemonic('l'); - btnLogout.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnLogout.text")); // NOI18N - btnLogout.setToolTipText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnLogout.toolTipText")); // NOI18N - btnLogout.addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed(final java.awt.event.ActionEvent evt) { - btnLogoutActionPerformed(evt); - } - }); - pnlCurrentGridToolbar.add(btnLogout); - - btnChangePassword.setMnemonic('c'); - btnChangePassword.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnChangePassword.text")); // NOI18N - btnChangePassword.setToolTipText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnChangePassword.toolTipText")); // NOI18N - btnChangePassword - .addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed( - final java.awt.event.ActionEvent evt) { - btnChangePasswordActionPerformed(evt); - } - }); - pnlCurrentGridToolbar.add(btnChangePassword); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 5; - gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; - gridBagConstraints.insets = new java.awt.Insets(20, 0, 0, 0); - pnlCurrentGrid.add(pnlCurrentGridToolbar, gridBagConstraints); - - comboPrefsDefaultResource - .setModel(new javax.swing.DefaultComboBoxModel(new String[] { - "Item 1", "Item 2", "Item 3", "Item 4" })); - comboPrefsDefaultResource - .addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed( - final java.awt.event.ActionEvent evt) { - comboPrefsDefaultResourceActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 4; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - pnlCurrentGrid.add(comboPrefsDefaultResource, gridBagConstraints); - - pnlConfigGrids.add(pnlCurrentGrid, java.awt.BorderLayout.CENTER); - - tabConfig - .addTab(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.pnlConfigGrids.TabConstraints.tabTitle"), - pnlConfigGrids); // NOI18N - - pnlConfigTransfers.setLayout(new java.awt.GridBagLayout()); - - pnlTransferManagement - .setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.pnlTransferManagement.border.title"))); // NOI18N - pnlTransferManagement.setLayout(new javax.swing.BoxLayout( - pnlTransferManagement, javax.swing.BoxLayout.PAGE_AXIS)); - - checkLogSuccessfulTransfer - .setText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.checkLogSuccessfulTransfer.text")); // NOI18N - checkLogSuccessfulTransfer - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.checkLogSuccessfulTransfer.toolTipText")); // NOI18N - checkLogSuccessfulTransfer - .addItemListener(new java.awt.event.ItemListener() { - @Override - public void itemStateChanged( - final java.awt.event.ItemEvent evt) { - checkLogSuccessfulTransferItemStateChanged(evt); - } - }); - checkLogSuccessfulTransfer - .addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed( - final java.awt.event.ActionEvent evt) { - checkLogSuccessfulTransferActionPerformed(evt); - } - }); - pnlTransferManagement.add(checkLogSuccessfulTransfer); - - checkVerifyChecksumOnTransfer - .setText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.checkVerifyChecksumOnTransfer.text")); // NOI18N - checkVerifyChecksumOnTransfer - .addItemListener(new java.awt.event.ItemListener() { - @Override - public void itemStateChanged( - final java.awt.event.ItemEvent evt) { - checkVerifyChecksumOnTransferItemStateChanged(evt); - } - }); - checkVerifyChecksumOnTransfer - .addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed( - final java.awt.event.ActionEvent evt) { - checkVerifyChecksumOnTransferActionPerformed(evt); - } - }); - pnlTransferManagement.add(checkVerifyChecksumOnTransfer); - - checkAllowRerouting.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.checkAllowRerouting.text")); // NOI18N - checkAllowRerouting - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.checkAllowRerouting.toolTipText")); // NOI18N - checkAllowRerouting.addItemListener(new java.awt.event.ItemListener() { - @Override - public void itemStateChanged(final java.awt.event.ItemEvent evt) { - checkAllowReroutingItemStateChanged(evt); - } - }); - pnlTransferManagement.add(checkAllowRerouting); - - checkConnectionRestart.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.checkConnectionRestart.text")); // NOI18N - checkConnectionRestart - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.checkConnectionRestart.toolTipText")); // NOI18N - checkConnectionRestart - .addItemListener(new java.awt.event.ItemListener() { - @Override - public void itemStateChanged( - final java.awt.event.ItemEvent evt) { - checkConnectionRestartItemStateChanged(evt); - } - }); - checkConnectionRestart - .addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed( - final java.awt.event.ActionEvent evt) { - checkConnectionRestartActionPerformed(evt); - } - }); - pnlTransferManagement.add(checkConnectionRestart); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 0; - gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; - gridBagConstraints.gridheight = java.awt.GridBagConstraints.RELATIVE; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - pnlConfigTransfers.add(pnlTransferManagement, gridBagConstraints); - - plnPipelineConfiguration - .setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.plnPipelineConfiguration.border.title"))); // NOI18N - plnPipelineConfiguration.setLayout(new java.awt.GridBagLayout()); - - lblIrodsSocketTimeout.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblIrodsSocketTimeout.text")); // NOI18N - lblIrodsSocketTimeout.setPreferredSize(null); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; - plnPipelineConfiguration.add(lblIrodsSocketTimeout, gridBagConstraints); - - spinnerIrodsSocketTimeout.setModel(new javax.swing.SpinnerNumberModel( - 0, 0, 600, 10)); - spinnerIrodsSocketTimeout - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.spinnerIrodsSocketTimeout.toolTipText")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - plnPipelineConfiguration.add(spinnerIrodsSocketTimeout, - gridBagConstraints); - - pnlParallelTransferOptions - .setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.pnlParallelTransferOptions.border.title"))); // NOI18N - pnlParallelTransferOptions.setLayout(new java.awt.GridBagLayout()); - - checkAllowParallelTransfers.setMnemonic('p'); - checkAllowParallelTransfers - .setText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.checkAllowParallelTransfers.text")); // NOI18N - checkAllowParallelTransfers - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.checkAllowParallelTransfers.toolTipText")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 0; - gridBagConstraints.gridwidth = 2; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - pnlParallelTransferOptions.add(checkAllowParallelTransfers, - gridBagConstraints); - - checkUseNIOForParallelTransfers - .setText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.checkUseNIOForParallelTransfers.text")); // NOI18N - checkUseNIOForParallelTransfers - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.checkUseNIOForParallelTransfers.toolTipText")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 1; - gridBagConstraints.gridwidth = 2; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - pnlParallelTransferOptions.add(checkUseNIOForParallelTransfers, - gridBagConstraints); - - checkUseExecutorPool.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.checkUseExecutorPool.text")); // NOI18N - checkUseExecutorPool.addItemListener(new java.awt.event.ItemListener() { - @Override - public void itemStateChanged(final java.awt.event.ItemEvent evt) { - checkUseExecutorPoolItemStateChanged(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 2; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - pnlParallelTransferOptions - .add(checkUseExecutorPool, gridBagConstraints); - - lblIrodsParallelSocketTimeout - .setText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblIrodsParallelSocketTimeout.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 6; - gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; - gridBagConstraints.insets = new java.awt.Insets(28, 0, 0, 0); - pnlParallelTransferOptions.add(lblIrodsParallelSocketTimeout, - gridBagConstraints); - - spinnerIrodsParallelSocketTimeout - .setModel(new javax.swing.SpinnerNumberModel(0, 0, 600, 10)); - spinnerIrodsParallelSocketTimeout - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.spinnerIrodsParallelSocketTimeout.toolTipText")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 6; - gridBagConstraints.ipadx = 159; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.insets = new java.awt.Insets(22, 0, 0, 0); - pnlParallelTransferOptions.add(spinnerIrodsParallelSocketTimeout, - gridBagConstraints); - - lblMaximumParallelTransferThreads - .setText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblMaximumParallelTransferThreads.text")); // NOI18N - lblMaximumParallelTransferThreads - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblMaximumParallelTransferThreads.toolTipText")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 7; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.insets = new java.awt.Insets(6, 180, 0, 0); - pnlParallelTransferOptions.add(lblMaximumParallelTransferThreads, - gridBagConstraints); - - spinnerIrodsMaxParallelThreads - .setModel(new javax.swing.SpinnerNumberModel(4, 0, 16, 1)); - spinnerIrodsMaxParallelThreads - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.spinnerIrodsMaxParallelThreads.toolTipText")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 7; - gridBagConstraints.gridheight = 2; - gridBagConstraints.ipadx = 171; - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; - gridBagConstraints.insets = new java.awt.Insets(0, 0, 22, 0); - pnlParallelTransferOptions.add(spinnerIrodsMaxParallelThreads, - gridBagConstraints); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 1; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - plnPipelineConfiguration.add(pnlParallelTransferOptions, - gridBagConstraints); - - pnlBuffers.setBorder(javax.swing.BorderFactory - .createTitledBorder(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.pnlBuffers.border.title"))); // NOI18N - pnlBuffers.setToolTipText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.pnlBuffers.toolTipText")); // NOI18N - pnlBuffers.setLayout(new java.awt.GridBagLayout()); - - lblInternalInputBufferSize - .setText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblInternalInputBufferSize.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 0; - gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; - pnlBuffers.add(lblInternalInputBufferSize, gridBagConstraints); - - txtInternalInputBufferSize.setColumns(20); - txtInternalInputBufferSize - .setText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtInternalInputBufferSize.text")); // NOI18N - txtInternalInputBufferSize - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtInternalInputBufferSize.toolTipText")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 0; - gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; - pnlBuffers.add(txtInternalInputBufferSize, gridBagConstraints); - - lblInternalOutputBufferSize - .setText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblInternalOutputBufferSize.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 1; - gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; - pnlBuffers.add(lblInternalOutputBufferSize, gridBagConstraints); - - txtInternalOutputBufferSize.setColumns(20); - txtInternalOutputBufferSize - .setText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtInternalOutputBufferSize.text")); // NOI18N - txtInternalOutputBufferSize - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtInternalOutputBufferSize.toolTipText")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 1; - gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; - pnlBuffers.add(txtInternalOutputBufferSize, gridBagConstraints); - - lblLocalFileInputBufferSize - .setText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblLocalFileInputBufferSize.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 2; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; - pnlBuffers.add(lblLocalFileInputBufferSize, gridBagConstraints); - - txtLocalFileInputBufferSize.setColumns(20); - txtLocalFileInputBufferSize - .setText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtLocalFileInputBufferSize.text")); // NOI18N - txtLocalFileInputBufferSize - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtLocalFileInputBufferSize.toolTipText")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 2; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - pnlBuffers.add(txtLocalFileInputBufferSize, gridBagConstraints); - - lblLocalFileOutputBufferSize - .setText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblLocalFileOutputBufferSize.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 3; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; - pnlBuffers.add(lblLocalFileOutputBufferSize, gridBagConstraints); - - txtLocalFileOutputBufferSize.setColumns(20); - txtLocalFileOutputBufferSize - .setText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtLocalFileOutputBufferSize.text")); // NOI18N - txtLocalFileOutputBufferSize - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtLocalFileOutputBufferSize.toolTipText")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 3; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - pnlBuffers.add(txtLocalFileOutputBufferSize, gridBagConstraints); - - lblPutBufferSize.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblPutBufferSize.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 5; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; - pnlBuffers.add(lblPutBufferSize, gridBagConstraints); - - txtPutBufferSize.setColumns(20); - txtPutBufferSize.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtPutBufferSize.text")); // NOI18N - txtPutBufferSize.setToolTipText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtPutBufferSize.toolTipText")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 5; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - pnlBuffers.add(txtPutBufferSize, gridBagConstraints); - - lblGetBufferSize.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblGetBufferSize.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 4; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; - pnlBuffers.add(lblGetBufferSize, gridBagConstraints); - - txtGetBufferSize.setColumns(20); - txtGetBufferSize.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtGetBufferSize.text")); // NOI18N - txtGetBufferSize.setToolTipText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtGetBufferSize.toolTipText")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 4; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - pnlBuffers.add(txtGetBufferSize, gridBagConstraints); - - lblIputToOutputCopyBufferSize - .setText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblIputToOutputCopyBufferSize.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 6; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; - pnlBuffers.add(lblIputToOutputCopyBufferSize, gridBagConstraints); - - txtInputToOutputCopyBufferSize.setColumns(20); - txtInputToOutputCopyBufferSize - .setText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtInputToOutputCopyBufferSize.text")); // NOI18N - txtInputToOutputCopyBufferSize - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtInputToOutputCopyBufferSize.toolTipText")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 6; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - pnlBuffers.add(txtInputToOutputCopyBufferSize, gridBagConstraints); - - lblInternalCacheBufferSize - .setText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblInternalCacheBufferSize.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 7; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; - pnlBuffers.add(lblInternalCacheBufferSize, gridBagConstraints); - - txtInternalCacheBufferSize.setColumns(20); - txtInternalCacheBufferSize - .setText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtInternalCacheBufferSize.text")); // NOI18N - txtInternalCacheBufferSize - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtInternalCacheBufferSize.toolTipText")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 7; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - pnlBuffers.add(txtInternalCacheBufferSize, gridBagConstraints); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 1; - gridBagConstraints.gridwidth = 3; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - plnPipelineConfiguration.add(pnlBuffers, gridBagConstraints); - - btnRestoreDefaults.setMnemonic('a'); - btnRestoreDefaults.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnRestoreDefaults.text")); // NOI18N - btnRestoreDefaults.setToolTipText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnRestoreDefaults.toolTipText")); // NOI18N - btnRestoreDefaults - .addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed( - final java.awt.event.ActionEvent evt) { - btnRestoreDefaultsActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 3; - plnPipelineConfiguration.add(btnRestoreDefaults, gridBagConstraints); - - btnApplyPipelineConfig.setMnemonic('a'); - btnApplyPipelineConfig.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnApplyPipelineConfig.text")); // NOI18N - btnApplyPipelineConfig - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnApplyPipelineConfig.toolTipText")); // NOI18N - btnApplyPipelineConfig - .addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed( - final java.awt.event.ActionEvent evt) { - btnApplyPipelineConfigActionPerformed(evt); - } - }); - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 3; - gridBagConstraints.gridy = 3; - plnPipelineConfiguration - .add(btnApplyPipelineConfig, gridBagConstraints); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 2; - gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - pnlConfigTransfers.add(plnPipelineConfiguration, gridBagConstraints); - - tabConfig - .addTab(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.pnlConfigTransfers.TabConstraints.tabTitle"), - pnlConfigTransfers); // NOI18N - - pnlConfigSynch - .addComponentListener(new java.awt.event.ComponentAdapter() { - @Override - public void componentShown( - final java.awt.event.ComponentEvent evt) { - pnlConfigSynchComponentShown(evt); - } - }); - pnlConfigSynch.setLayout(new java.awt.BorderLayout()); - - pnlConfigSynchListing.setMinimumSize(new java.awt.Dimension(23, 100)); - pnlConfigSynchListing.setLayout(new java.awt.BorderLayout()); - - btnRefreshSynch.setMnemonic('r'); - btnRefreshSynch.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnRefreshSynch.text")); // NOI18N - btnRefreshSynch.setToolTipText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnRefreshSynch.toolTipText")); // NOI18N - btnRefreshSynch.addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed(final java.awt.event.ActionEvent evt) { - btnRefreshSynchActionPerformed(evt); - } - }); - pnlSynchRefresh.add(btnRefreshSynch); - - pnlConfigSynchListing.add(pnlSynchRefresh, java.awt.BorderLayout.NORTH); - - scrollSynchTable.setMinimumSize(new java.awt.Dimension(23, 100)); - scrollSynchTable.setPreferredSize(new java.awt.Dimension(100, 100)); - pnlConfigSynchListing.add(scrollSynchTable, - java.awt.BorderLayout.CENTER); - - pnlConfigSynch.add(pnlConfigSynchListing, java.awt.BorderLayout.CENTER); - - pnlConfigSynchDetails.setLayout(new java.awt.BorderLayout()); - - pnlSynchData.setBorder(javax.swing.BorderFactory - .createBevelBorder(javax.swing.border.BevelBorder.RAISED)); - pnlSynchData.setLayout(new java.awt.GridBagLayout()); - - pnlSynchName.setLayout(new java.awt.GridBagLayout()); - - lblSynchName.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblSynchName.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 1; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; - pnlSynchName.add(lblSynchName, gridBagConstraints); - - txtSynchName.setColumns(40); - txtSynchName.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtSynchName.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 1; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - pnlSynchName.add(txtSynchName, gridBagConstraints); - - lblSynchDateLabel.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblSynchDateLabel.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 2; - gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; - pnlSynchName.add(lblSynchDateLabel, gridBagConstraints); - - lblSynchDate.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblSynchDate.text")); // NOI18N - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 2; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; - pnlSynchName.add(lblSynchDate, gridBagConstraints); - - lblSynchStatus.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.lblSynchStatus.text")); // NOI18N - lblSynchStatus.setMaximumSize(null); - lblSynchStatus.setMinimumSize(new java.awt.Dimension(10, 10)); - lblSynchStatus.setPreferredSize(new java.awt.Dimension(10, 10)); - pnlSynchIcon.add(lblSynchStatus); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 2; - gridBagConstraints.gridy = 2; - gridBagConstraints.gridwidth = 3; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - pnlSynchName.add(pnlSynchIcon, gridBagConstraints); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 0; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; - gridBagConstraints.insets = new java.awt.Insets(20, 20, 30, 20); - pnlSynchData.add(pnlSynchName, gridBagConstraints); - - txtLocalPath.setColumns(80); - txtLocalPath.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtLocalPath.text")); // NOI18N - txtLocalPath.setToolTipText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtLocalPath.toolTipText")); // NOI18N - txtLocalPath.addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed(final java.awt.event.ActionEvent evt) { - txtLocalPathActionPerformed(evt); - } - }); - pnlLocalSynch.add(txtLocalPath); - - btnChooseLocalSynch.setMnemonic('c'); - btnChooseLocalSynch.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnChooseLocalSynch.text")); // NOI18N - btnChooseLocalSynch - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnChooseLocalSynch.toolTipText")); // NOI18N - btnChooseLocalSynch - .addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed( - final java.awt.event.ActionEvent evt) { - btnChooseLocalSynchActionPerformed(evt); - } - }); - pnlLocalSynch.add(btnChooseLocalSynch); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 1; - gridBagConstraints.gridwidth = 9; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; - gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 10); - pnlSynchData.add(pnlLocalSynch, gridBagConstraints); - - pnlSynchMode.setBorder(javax.swing.BorderFactory - .createLineBorder(new java.awt.Color(0, 0, 0))); - pnlSynchMode.setLayout(new java.awt.GridLayout(0, 1)); - - jLabel1.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.jLabel1.text")); // NOI18N - pnlSynchMode.add(jLabel1); - - buttonGroupSynchMode.add(radioBackup); - radioBackup.setSelected(true); - radioBackup.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.radioBackup.text")); // NOI18N - pnlSynchMode.add(radioBackup); - - buttonGroupSynchMode.add(radioFeed); - radioFeed.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.radioFeed.text")); // NOI18N - radioFeed.setEnabled(false); - pnlSynchMode.add(radioFeed); - - buttonGroupSynchMode.add(radioSynch); - radioSynch.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.radioSynch.text")); // NOI18N - radioSynch.setEnabled(false); - pnlSynchMode.add(radioSynch); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 2; - gridBagConstraints.gridwidth = 9; - gridBagConstraints.gridheight = 2; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.insets = new java.awt.Insets(20, 20, 20, 20); - pnlSynchData.add(pnlSynchMode, gridBagConstraints); - - pnlSynchFrequency.setBorder(javax.swing.BorderFactory - .createLineBorder(new java.awt.Color(0, 0, 0))); - pnlSynchFrequency.setLayout(new java.awt.GridLayout(0, 1)); - - jLabel5.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.jLabel5.text")); // NOI18N - pnlSynchFrequency.add(jLabel5); - - jcomboSynchFrequency.setModel(new javax.swing.DefaultComboBoxModel( - new String[] { "Hourly", "Weekly", "Daily", - "Every 2 Minutes (testing)", "", "" })); - jcomboSynchFrequency - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.jcomboSynchFrequency.toolTipText")); // NOI18N - pnlSynchFrequency.add(jcomboSynchFrequency); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 4; - gridBagConstraints.gridwidth = 9; - gridBagConstraints.gridheight = 2; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.insets = new java.awt.Insets(20, 20, 20, 20); - pnlSynchData.add(pnlSynchFrequency, gridBagConstraints); - - txtIrodsPath.setColumns(80); - txtIrodsPath.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtIrodsPath.text")); // NOI18N - txtIrodsPath.setToolTipText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.txtIrodsPath.toolTipText")); // NOI18N - txtIrodsPath.addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed(final java.awt.event.ActionEvent evt) { - txtIrodsPathActionPerformed(evt); - } - }); - pnlIrodsSynch.add(txtIrodsPath); - - btnChooseIrodsSynch.setMnemonic('i'); - btnChooseIrodsSynch.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnChooseIrodsSynch.text")); // NOI18N - btnChooseIrodsSynch - .setToolTipText(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnChooseIrodsSynch.toolTipText")); // NOI18N - btnChooseIrodsSynch - .addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed( - final java.awt.event.ActionEvent evt) { - btnChooseIrodsSynchActionPerformed(evt); - } - }); - pnlIrodsSynch.add(btnChooseIrodsSynch); - - gridBagConstraints = new java.awt.GridBagConstraints(); - gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 6; - gridBagConstraints.gridwidth = 9; - gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; - gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; - gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 10); - pnlSynchData.add(pnlIrodsSynch, gridBagConstraints); - - pnlConfigSynchDetails.add(pnlSynchData, java.awt.BorderLayout.CENTER); - - btnDeleteSynch.setMnemonic('d'); - btnDeleteSynch.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnDeleteSynch.text")); // NOI18N - btnDeleteSynch.setToolTipText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnDeleteSynch.toolTipText")); // NOI18N - btnDeleteSynch.setEnabled(false); - btnDeleteSynch.addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed(final java.awt.event.ActionEvent evt) { - btnDeleteSynchActionPerformed(evt); - } - }); - panelSynchToolbar.add(btnDeleteSynch); - - btnNewSynch.setMnemonic('n'); - btnNewSynch.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnNewSynch.text")); // NOI18N - btnNewSynch.setToolTipText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnNewSynch.toolTipText")); // NOI18N - btnNewSynch.addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed(final java.awt.event.ActionEvent evt) { - btnNewSynchActionPerformed(evt); - } - }); - panelSynchToolbar.add(btnNewSynch); - - btnUpdateSynch.setMnemonic('u'); - btnUpdateSynch.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnUpdateSynch.text")); // NOI18N - btnUpdateSynch.setToolTipText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnUpdateSynch.toolTipText")); // NOI18N - btnUpdateSynch.setEnabled(false); - btnUpdateSynch.addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed(final java.awt.event.ActionEvent evt) { - btnUpdateSynchActionPerformed(evt); - } - }); - panelSynchToolbar.add(btnUpdateSynch); - - btnSynchNow.setMnemonic('s'); - btnSynchNow.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnSynchNow.text")); // NOI18N - btnSynchNow.setToolTipText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnSynchNow.toolTipText")); // NOI18N - btnSynchNow.setEnabled(false); - btnSynchNow.addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed(final java.awt.event.ActionEvent evt) { - btnSynchNowActionPerformed(evt); - } - }); - panelSynchToolbar.add(btnSynchNow); - - pnlConfigSynchDetails.add(panelSynchToolbar, - java.awt.BorderLayout.SOUTH); - - pnlConfigSynch.add(pnlConfigSynchDetails, java.awt.BorderLayout.SOUTH); - - tabConfig - .addTab(org.openide.util.NbBundle - .getMessage(IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.pnlConfigSynch.TabConstraints.tabTitle"), - pnlConfigSynch); // NOI18N - - pnlCenter.add(tabConfig); - - getContentPane().add(pnlCenter, java.awt.BorderLayout.CENTER); - - pnlBottom.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT)); - - btnOK.setMnemonic('O'); - btnOK.setText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnOK.text")); // NOI18N - btnOK.setToolTipText(org.openide.util.NbBundle.getMessage( - IDROPConfigurationPanel.class, - "IDROPConfigurationPanel.btnOK.toolTipText")); // NOI18N - btnOK.addActionListener(new java.awt.event.ActionListener() { - @Override - public void actionPerformed(final java.awt.event.ActionEvent evt) { - btnOKActionPerformed(evt); - } - }); - pnlBottom.add(btnOK); - - getContentPane().add(pnlBottom, java.awt.BorderLayout.SOUTH); - - pack(); - }// </editor-fold>//GEN-END:initComponents - - /** - * Refresh the displayed synch - * - * @param evt - */ - private void btnRefreshSynchActionPerformed( - final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnRefreshSynchActionPerformed - refreshSynchConfigPanel(); - }// GEN-LAST:event_btnRefreshSynchActionPerformed - - private void checkShowFileProgressActionPerformed( - final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_checkShowFileProgressActionPerformed - // - }// GEN-LAST:event_checkShowFileProgressActionPerformed - - private void checkShowGUIItemStateChanged(final java.awt.event.ItemEvent evt) {// GEN-FIRST:event_checkShowGUIItemStateChanged - - boolean isSelected = false; - if (evt.getStateChange() == ItemEvent.SELECTED) { - isSelected = true; - } - log.info("updating show gui at startup to:{}", isSelected); - try { - idropCore.getIdropConfigurationService().updateConfig( - IdropConfigurationService.SHOW_GUI, - Boolean.toString(isSelected)); - } catch (IdropException ex) { - log.error("error setting show gui property", ex); - throw new IdropRuntimeException(ex); - } - }// GEN-LAST:event_checkShowGUIItemStateChanged - - private void checkShowFileProgressItemStateChanged( - final java.awt.event.ItemEvent evt) {// GEN-FIRST:event_checkShowFileProgressItemStateChanged - boolean isSelected = false; - if (evt.getStateChange() == ItemEvent.SELECTED) { - isSelected = true; - } - log.info("updating show intra-file progress to:{}", isSelected); - try { - idropCore.getIdropConfigurationService().updateConfig( - IdropConfigurationService.INTRA_FILE_STATUS_CALLBACKS, - Boolean.toString(isSelected)); - idropCore.getIdropConfigurationService() - .updateJargonPropertiesBasedOnIDROPConfig(); - } catch (Exception ex) { - log.error("error setting property", ex); - throw new IdropRuntimeException(ex); - } - }// GEN-LAST:event_checkShowFileProgressItemStateChanged - - private void checkVerifyChecksumOnTransferItemStateChanged( - final java.awt.event.ItemEvent evt) {// GEN-FIRST:event_checkVerifyChecksumOnTransferItemStateChanged - updateConfigForGivenPropertyBasedOnCheckboxStateChange(evt, - IdropConfigurationService.VERIFY_CHECKSUM_ON_TRANSFER); - } - - private void updateConfigForGivenPropertyBasedOnCheckboxStateChange( - final ItemEvent evt, final String propertyName) - throws IdropRuntimeException { - boolean isSelected = false; - if (evt.getStateChange() == ItemEvent.SELECTED) { - isSelected = true; - } - log.info("updating verify checksum to:{}", isSelected); - try { - idropCore.getIdropConfigurationService().updateConfig(propertyName, - Boolean.toString(isSelected)); - idropCore.getIdropConfigurationService() - .updateJargonPropertiesBasedOnIDROPConfig(); - } catch (Exception ex) { - log.error("error setting property", ex); - throw new IdropRuntimeException(ex); - } - }// GEN-LAST:event_checkVerifyChecksumOnTransferItemStateChanged - - private void checkLogSuccessfulTransferItemStateChanged( - final java.awt.event.ItemEvent evt) {// GEN-FIRST:event_checkLogSuccessfulTransferItemStateChanged - - updateConfigForGivenPropertyBasedOnCheckboxStateChange( - evt, - IdropConfigurationService.TRANSFER_ENGINE_RECORD_SUCCESSFUL_FILES); - }// GEN-LAST:event_checkLogSuccessfulTransferItemStateChanged - - private void checkUseExecutorPoolItemStateChanged( - final java.awt.event.ItemEvent evt) {// GEN-FIRST:event_checkUseExecutorPoolItemStateChanged - updateConfigForGivenPropertyBasedOnCheckboxStateChange(evt, - IdropConfigurationService.IRODS_PARALLEL_USE_POOL); - }// GEN-LAST:event_checkUseExecutorPoolItemStateChanged - - private void checkAllowReroutingItemStateChanged( - final java.awt.event.ItemEvent evt) {// GEN-FIRST:event_checkAllowReroutingItemStateChanged - boolean isSelected = false; - if (evt.getStateChange() == ItemEvent.SELECTED) { - isSelected = true; - } - log.info("updating allow rerouting to:{}", isSelected); - try { - idropCore.getIdropConfigurationService().updateConfig( - IdropConfigurationService.ALLOW_CONNECTION_REROUTING, - Boolean.toString(isSelected)); - idropCore.getIdropConfigurationService() - .updateJargonPropertiesBasedOnIDROPConfig(); - } catch (Exception ex) { - log.error("error setting property", ex); - throw new IdropRuntimeException(ex); - } - }// GEN-LAST:event_checkAllowReroutingItemStateChanged - - private void resetTransferPipelineEditColors() { - txtInternalInputBufferSize.setBackground(Color.white); - txtInternalOutputBufferSize.setBackground(Color.white); - txtLocalFileInputBufferSize.setBackground(Color.white); - txtLocalFileOutputBufferSize.setBackground(Color.white); - txtGetBufferSize.setBackground(Color.white); - txtPutBufferSize.setBackground(Color.white); - txtInputToOutputCopyBufferSize.setBackground(Color.white); - txtInternalCacheBufferSize.setBackground(Color.white); - } - - /** - * Update the pipeline configuration information properties based on the - * screen data - * - * @param evt - */ - private void btnApplyPipelineConfigActionPerformed( - final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnApplyPipelineConfigActionPerformed - try { - - resetTransferPipelineEditColors(); - // edit and set - - // internal input buffer size - String actual = txtInternalInputBufferSize.getText(); - if (actual.isEmpty()) { - } else { - try { - Integer.parseInt(actual); - idropCore - .getIdropConfigurationService() - .updateConfig( - IdropConfigurationService.IRODS_IO_INTERNAL_INPUT_STREAM_BUFFER_SIZE, - actual); - } catch (NumberFormatException nfe) { - txtInternalInputBufferSize.setBackground(Color.red); - MessageManager.showWarning(this, - "Invalid internal input buffer size", - MessageManager.TITLE_MESSAGE); - return; - } - } - - // internal output buffer size - actual = txtInternalOutputBufferSize.getText(); - if (actual.isEmpty()) { - } else { - try { - Integer.parseInt(actual); - idropCore - .getIdropConfigurationService() - .updateConfig( - IdropConfigurationService.IRODS_IO_INTERNAL_OUTPUT_STREAM_BUFFER_SIZE, - actual); - } catch (NumberFormatException nfe) { - txtInternalOutputBufferSize.setBackground(Color.red); - MessageManager.showWarning(this, - "Invalid internal output buffer size", - MessageManager.TITLE_MESSAGE); - return; - } - } - - // local file input buffer size - actual = txtLocalFileInputBufferSize.getText(); - if (actual.isEmpty()) { - } else { - try { - Integer.parseInt(actual); - idropCore - .getIdropConfigurationService() - .updateConfig( - IdropConfigurationService.IRODS_IO_LOCAL_INPUT_STREAM_BUFFER_SIZE, - actual); - } catch (NumberFormatException nfe) { - txtLocalFileInputBufferSize.setBackground(Color.red); - MessageManager.showWarning(this, - "Invalid local file input buffer size", - MessageManager.TITLE_MESSAGE); - return; - } - } - - // local file output buffer size - actual = txtLocalFileOutputBufferSize.getText(); - if (actual.isEmpty()) { - } else { - try { - Integer.parseInt(actual); - idropCore - .getIdropConfigurationService() - .updateConfig( - IdropConfigurationService.IRODS_IO_LOCAL_OUTPUT_STREAM_BUFFER_SIZE, - actual); - } catch (NumberFormatException nfe) { - txtLocalFileOutputBufferSize.setBackground(Color.red); - MessageManager.showWarning(this, - "Invalid local file output buffer size", - MessageManager.TITLE_MESSAGE); - return; - } - } - - // get buffer size - actual = txtGetBufferSize.getText(); - if (actual.isEmpty()) { - } else { - try { - Integer.parseInt(actual); - idropCore.getIdropConfigurationService().updateConfig( - IdropConfigurationService.IRODS_IO_GET_BUFFER_SIZE, - actual); - } catch (NumberFormatException nfe) { - txtGetBufferSize.setBackground(Color.red); - MessageManager.showWarning(this, "Invalid get buffer size", - MessageManager.TITLE_MESSAGE); - return; - } - } - - // put buffer size - actual = txtPutBufferSize.getText(); - if (actual.isEmpty()) { - } else { - try { - Integer.parseInt(actual); - idropCore.getIdropConfigurationService().updateConfig( - IdropConfigurationService.IRODS_IO_PUT_BUFFER_SIZE, - actual); - } catch (NumberFormatException nfe) { - txtPutBufferSize.setBackground(Color.red); - MessageManager.showWarning(this, "Invalid put buffer size", - MessageManager.TITLE_MESSAGE); - return; - } - } - - // input to output copy buffer size - actual = txtInputToOutputCopyBufferSize.getText(); - if (actual.isEmpty()) { - } else { - try { - Integer.parseInt(actual); - idropCore - .getIdropConfigurationService() - .updateConfig( - IdropConfigurationService.IRODS_IO_INPUT_TO_OUTPUT_COPY_BUFFER_SIZE, - actual); - } catch (NumberFormatException nfe) { - txtInputToOutputCopyBufferSize.setBackground(Color.red); - MessageManager.showWarning(this, - "Invalid input to output copy buffer size", - MessageManager.TITLE_MESSAGE); - return; - } - } - - // internal cache buffer size - actual = txtInternalCacheBufferSize.getText(); - if (actual.isEmpty()) { - } else { - try { - Integer.parseInt(actual); - idropCore - .getIdropConfigurationService() - .updateConfig( - IdropConfigurationService.IRODS_IO_INTERNAL_CACHE_BUFFER_SIZE, - actual); - } catch (NumberFormatException nfe) { - txtInternalCacheBufferSize.setBackground(Color.red); - MessageManager.showWarning(this, - "Invalid internal cache buffer size", - MessageManager.TITLE_MESSAGE); - return; - } - } - - idropCore.getIdropConfigurationService().updateConfig( - IdropConfigurationService.IRODS_PARALLEL_USE_PARALLEL, - Boolean.toString(checkAllowParallelTransfers.isSelected())); - idropCore.getIdropConfigurationService().updateConfig( - IdropConfigurationService.IRODS_PARALLEL_USE_NIO, - Boolean.toString(checkUseNIOForParallelTransfers - .isSelected())); - idropCore - .getIdropConfigurationService() - .updateConfig( - IdropConfigurationService.IRODS_PARALLEL_CONNECTION_MAX_THREADS, - spinnerIrodsMaxParallelThreads.getValue() - .toString()); - idropCore - .getIdropConfigurationService() - .updateConfig( - IdropConfigurationService.IRODS_PARALLEL_CONNECTION_TIMEOUT, - spinnerIrodsParallelSocketTimeout.getValue() - .toString()); - idropCore.getIdropConfigurationService().updateConfig( - IdropConfigurationService.IRODS_CONNECTION_TIMEOUT, - spinnerIrodsSocketTimeout.getValue().toString()); - - idropCore.getIdropConfigurationService() - .updateJargonPropertiesBasedOnIDROPConfig(); - } catch (Exception ex) { - log.error("error setting property", ex); - throw new IdropRuntimeException(ex); - } - }// GEN-LAST:event_btnApplyPipelineConfigActionPerformed - - private void btnRestoreDefaultsActionPerformed( - final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnRestoreDefaultsActionPerformed - log.info("restoring pipeline config to jargon properties settings"); - try { - JargonProperties defaultJargonProperties = new DefaultPropertiesJargonConfig(); - IdropConfigurationService configService = idropCore - .getIdropConfigurationService(); - configService - .restoreIDROPConfigFromJargonProperties(defaultJargonProperties); - initWithConfigData(); - MessageManager.showMessage(this, - "Values restored to defaults, hit apply to update", - MessageManager.TITLE_MESSAGE); - } catch (JargonException ex) { - log.error("unable to restore jargon properties", ex); - throw new IdropRuntimeException( - "unable to restore jargon properties", ex); - } - - }// GEN-LAST:event_btnRestoreDefaultsActionPerformed - - private void comboPrefsDefaultResourceActionPerformed( - final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_comboPrefsDefaultResourceActionPerformed - String newResource = (String) comboPrefsDefaultResource - .getSelectedItem(); - idropCore.getIrodsAccount().setDefaultStorageResource(newResource); - if (!initializing) { - idropGui.reinitializeForChangedIRODSAccount(); - } else { - initializing = false; - } - }// GEN-LAST:event_comboPrefsDefaultResourceActionPerformed - - private void checkConnectionRestartActionPerformed( - final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_checkConnectionRestartActionPerformed - - }// GEN-LAST:event_checkConnectionRestartActionPerformed - - private void checkConnectionRestartItemStateChanged( - final java.awt.event.ItemEvent evt) {// GEN-FIRST:event_checkConnectionRestartItemStateChanged - boolean isSelected = false; - if (evt.getStateChange() == ItemEvent.SELECTED) { - isSelected = true; - } - log.info("updating connection restart to:{}", isSelected); - try { - idropCore.getIdropConfigurationService().updateConfig( - IdropConfigurationService.IRODS_CONNECTION_RESTART, - Boolean.toString(isSelected)); - idropCore.getIdropConfigurationService() - .updateJargonPropertiesBasedOnIDROPConfig(); - } catch (Exception ex) { - log.error("error setting property", ex); - throw new IdropRuntimeException(ex); - } - }// GEN-LAST:event_checkConnectionRestartItemStateChanged - - private void btnOKActionPerformed(final java.awt.event.ActionEvent evt) { - dispose(); - } - - private void checkShowGUIActionPerformed( - final java.awt.event.ActionEvent evt) { - // - } - - private void checkLogSuccessfulTransferActionPerformed( - final java.awt.event.ActionEvent evt) { - // - } - - private void pnlConfigSynchComponentShown( - final java.awt.event.ComponentEvent evt) { - - refreshSynchConfigPanel(); - - } - - private void refreshSynchConfigPanel() { - log.info("lazily loading synch data"); - - final IDROPConfigurationPanel thisPanel = this; - - java.awt.EventQueue.invokeLater(new Runnable() { - - @Override - public void run() { - - SynchManagerService synchConfigurationService = idropCore - .getTransferManager().getTransferServiceFactory() - .instanceSynchManagerService(); - - try { - thisPanel.setCursor(Cursor - .getPredefinedCursor(Cursor.WAIT_CURSOR)); - List<Synchronization> synchronizations = synchConfigurationService - .listAllSynchronizations(); - SynchConfigTableModel synchConfigTableModel = null; - if (jTableSynch == null) { - synchConfigTableModel = new SynchConfigTableModel( - idropCore, synchronizations); - jTableSynch = new JTable(synchConfigTableModel); - jTableSynch - .getSelectionModel() - .addListSelectionListener( - new SynchListSelectionHandler(thisPanel)); - scrollSynchTable.setViewportView(jTableSynch); - scrollSynchTable.validate(); - pnlConfigSynchListing.validate(); - } else { - synchConfigTableModel = (SynchConfigTableModel) jTableSynch - .getModel(); - synchConfigTableModel - .setSynchronizations(synchronizations); - synchConfigTableModel.fireTableDataChanged(); - } - - if (synchConfigTableModel.getRowCount() > 0) { - jTableSynch.setRowSelectionInterval(0, 0); - } else { - lockSynchPanelForNewOnly(); - } - } catch (SynchException ex) { - log.error("error setting up synchs table", ex); - throw new IdropRuntimeException(ex); - } finally { - thisPanel.setCursor(Cursor - .getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - } - } - - private void lockSynchPanelForNewOnly() { - clearAndResetSynchPanel(); - setLockStatusSynchPanel(false); - } - }); - } - - private void txtLocalPathActionPerformed( - final java.awt.event.ActionEvent evt) { - // TODO add your handling code here: - } - - private void btnChooseLocalSynchActionPerformed( - final java.awt.event.ActionEvent evt) { - // TODO add your handling code here: - JFileChooser localFileChooser = new JFileChooser(); - localFileChooser.setMultiSelectionEnabled(false); - localFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - localFileChooser.showOpenDialog(this); - txtLocalPath.setText(localFileChooser.getSelectedFile() - .getAbsolutePath()); - } - - private void txtIrodsPathActionPerformed( - final java.awt.event.ActionEvent evt) { - // TODO add your handling code here: - } - - private void btnChooseIrodsSynchActionPerformed( - final java.awt.event.ActionEvent evt) { - try { - IRODSFinderDialog irodsFileSystemChooserView = new IRODSFinderDialog( - null, true, idropCore); - final Toolkit toolkit = Toolkit.getDefaultToolkit(); - final Dimension screenSize = toolkit.getScreenSize(); - final int x = (screenSize.width - irodsFileSystemChooserView - .getWidth()) / 2; - final int y = (screenSize.height - irodsFileSystemChooserView - .getHeight()) / 2; - irodsFileSystemChooserView.setLocation(x, y); - irodsFileSystemChooserView.setVisible(true); - String absPath = irodsFileSystemChooserView - .getSelectedAbsolutePath(); - irodsFileSystemChooserView.dispose(); - if (absPath != null) { - txtIrodsPath.setText(irodsFileSystemChooserView - .getSelectedAbsolutePath()); - } - - // int returnVal = irodsFileChooser.showSaveDialog(this); - } catch (Exception e) { - log.error("exception choosings iRODS file"); - throw new IdropRuntimeException("exception choosing irods fie", e); - } finally { - idropCore.getIrodsFileSystem().closeAndEatExceptions(); - } - } - - /** - * Delete the selected synchronization - * - * @param evt - */ - private void btnDeleteSynchActionPerformed( - final java.awt.event.ActionEvent evt) { - - final IDROPConfigurationPanel thisPanel = this; - - java.awt.EventQueue.invokeLater(new Runnable() { - - @Override - public void run() { - - if (selectedSynchronization == null) { - MessageManager.showError(thisPanel, - "Please select a synchronization from the table", - MessageManager.TITLE_MESSAGE); - return; - } - Synchronization synchronization = selectedSynchronization; - - int result = JOptionPane.showConfirmDialog(thisPanel, - "Do you wish to delete this synchronization?", - MessageManager.TITLE_MESSAGE, - JOptionPane.OK_CANCEL_OPTION); - if (result == JOptionPane.CANCEL_OPTION) { - return; - } - try { - thisPanel.setCursor(Cursor - .getPredefinedCursor(Cursor.WAIT_CURSOR)); - SynchManagerService synchConfigurationService = idropCore - .getTransferManager().getTransferServiceFactory() - .instanceSynchManagerService(); - log.info("deleting synchronization:{}", synchronization); - - if (synchConfigurationService - .isSynchRunning(synchronization)) { - MessageManager - .showMessage( - thisPanel, - "Cannot delete the synchronization, a synch is currently running", - MessageManager.TITLE_MESSAGE); - return; - } - - thisPanel.getSynchTable().getSelectionModel(); - SynchConfigTableModel model = (SynchConfigTableModel) thisPanel - .getSynchTable().getModel(); - - synchConfigurationService - .deleteSynchronization(synchronization); - log.info("synch deleted, refreshing model"); - List<Synchronization> synchronizations = synchConfigurationService - .listAllSynchronizations(); - - model.setSynchronizations(synchronizations); - model.fireTableDataChanged(); - - MessageManager.showMessage(thisPanel, - "Configuration deleted", - MessageManager.TITLE_MESSAGE); - btnDeleteSynch.setEnabled(false); - btnUpdateSynch.setEnabled(false); - btnSynchNow.setEnabled(false); - refreshSynchConfigPanel(); - } catch (Exception ex) { - MessageManager.showError(thisPanel, ex.getMessage(), - MessageManager.TITLE_MESSAGE); - } finally { - thisPanel.setCursor(Cursor - .getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - idropCore.closeIRODSConnection(idropCore.getIrodsAccount()); - } - } - }); - } - - /** - * Called to clear and prepare for adding a new synchronization - * - * @param evt - */ - private void btnNewSynchActionPerformed(final java.awt.event.ActionEvent evt) { - clearAndResetSynchPanel(); - if (jTableSynch.getModel().getRowCount() > 0) { - jTableSynch.getSelectionModel().removeIndexInterval(0, - jTableSynch.getModel().getRowCount() - 1); - } - selectedSynchronization = new Synchronization(); - btnDeleteSynch.setEnabled(false); - btnUpdateSynch.setEnabled(true); - btnSynchNow.setEnabled(false); - MessageManager - .showMessage( - this, - "Enter the data for the new Synchronization and press Update to save", - MessageManager.TITLE_MESSAGE); - setLockStatusSynchPanel(true); - btnSynchNow.setEnabled(false); - btnDeleteSynch.setEnabled(false); - } - - /** - * User signals that the displayed synchronization should be updated - * - * @param evt - */ - private void btnUpdateSynchActionPerformed( - final java.awt.event.ActionEvent evt) { - updateSynch(); - } - - private void updateSynch() { - final IDROPConfigurationPanel thisPanel = this; - - java.awt.EventQueue.invokeLater(new Runnable() { - - @Override - public void run() { - - resetSynchPanel(); - if (selectedSynchronization == null) { - MessageManager.showError(thisPanel, - "Please select a synchronization from the table", - MessageManager.TITLE_MESSAGE); - return; - } - - if (txtLocalPath.getText().trim().isEmpty()) { - txtLocalPath.setBackground(Color.RED); - MessageManager.showError(thisPanel, - "Please select a local path", - MessageManager.TITLE_MESSAGE); - return; - } - - if (txtIrodsPath.getText().trim().isEmpty()) { - txtIrodsPath.setBackground(Color.RED); - MessageManager.showError(thisPanel, - "Please select an iRODS path", - MessageManager.TITLE_MESSAGE); - return; - } - - if (txtSynchName.getText().trim().isEmpty()) { - txtSynchName.setBackground(Color.RED); - MessageManager - .showError( - thisPanel, - "Please enter a unique name for this synchronization", - MessageManager.TITLE_MESSAGE); - return; - } - - boolean isNew = (selectedSynchronization.getId() == null); - if (isNew) { - log.info("adding new synch"); - } - - SynchManagerService synchConfigurationService = idropCore - .getTransferManager().getTransferServiceFactory() - .instanceSynchManagerService(); - - // edits pass, do update - log.info("saving synch data"); - Synchronization synchronization = selectedSynchronization; - synchronization.setUpdatedAt(new Date()); - synchronization.setFrequencyType(getSynchFrequencyFromGUI()); - - synchronization.setName(txtSynchName.getText().trim()); - synchronization.setSynchronizationMode(getSynchTypeFromGUI()); - synchronization.setLocalSynchDirectory(txtLocalPath.getText() - .trim()); - synchronization.setIrodsSynchDirectory(txtIrodsPath.getText() - .trim()); - IRODSAccount irodsAccount = idropCore.getIrodsAccount(); - synchronization.setIrodsHostName(irodsAccount.getHost()); - - try { - synchronization.setIrodsPassword(HibernateUtil - .obfuscate(irodsAccount.getPassword())); - } catch (JargonException ex) { - log.error("exception obfuscating password", ex); - MessageManager.showError(thisPanel, ex.getMessage(), - MessageManager.TITLE_MESSAGE); - throw new IdropRuntimeException(ex); - } - - synchronization.setIrodsPort(irodsAccount.getPort()); - synchronization.setIrodsUserName(irodsAccount.getUserName()); - synchronization.setIrodsZone(irodsAccount.getZone()); - synchronization.setDefaultResourceName(irodsAccount - .getDefaultStorageResource()); - synchronization.setCreatedAt(new Date()); - selectedSynchronization = synchronization; - - try { - thisPanel.setCursor(Cursor - .getPredefinedCursor(Cursor.WAIT_CURSOR)); - if (synchConfigurationService - .isSynchRunning(selectedSynchronization)) { - MessageManager - .showMessage( - thisPanel, - "Cannot update the synchronization, a synch is currently running", - MessageManager.TITLE_MESSAGE); - return; - } - - idropCore.getIdropConfigurationService() - .updateSynchronization(synchronization); - MessageManager.showMessage(thisPanel, - "Configuration updated", - MessageManager.TITLE_MESSAGE); - ListSelectionModel lsm = thisPanel.getSynchTable() - .getSelectionModel(); - SynchConfigTableModel model = (SynchConfigTableModel) thisPanel - .getSynchTable().getModel(); - - if (isNew) { - - List<Synchronization> synchronizations = synchConfigurationService - .listAllSynchronizations(); - - model.setSynchronizations(synchronizations); - model.fireTableDataChanged(); - } else { - if (lsm.isSelectionEmpty()) { - return; - } else { - // Find out which indexes are selected. - int minIndex = lsm.getMinSelectionIndex(); - int maxIndex = lsm.getMaxSelectionIndex(); - for (int i = minIndex; i <= maxIndex; i++) { - if (lsm.isSelectedIndex(i)) { - int modelIdx = thisPanel.getSynchTable() - .convertRowIndexToModel(i); - - model.getSynchronizations().set(modelIdx, - synchronization); - model.fireTableDataChanged(); - break; - } - } - } - } - - btnDeleteSynch.setEnabled(true); - btnUpdateSynch.setEnabled(true); - btnSynchNow.setEnabled(true); - - } catch (IdropException ex) { - MessageManager.showError(thisPanel, ex.getMessage(), - MessageManager.TITLE_MESSAGE); - } catch (SynchException ex) { - MessageManager.showError(thisPanel, ex.getMessage(), - MessageManager.TITLE_MESSAGE); - } finally { - thisPanel.setCursor(Cursor - .getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - idropCore.closeIRODSConnection(idropCore.getIrodsAccount()); - } - } - }); - } - - /** - * Force a synchronization process on the selected synchronization - * - * @param evt - */ - private void btnSynchNowActionPerformed(final java.awt.event.ActionEvent evt) { - log.info("synch now button pressed"); - if (selectedSynchronization == null) { - MessageManager.showWarning(this, "Please select a synhronization", - MessageManager.TITLE_MESSAGE); - return; - } - - log.info("selected synchronization is:{}", selectedSynchronization); - boolean synchIsUnchanged = checkIfSynchChanged(); - - if (!synchIsUnchanged) { - log.info("synch had been changed, update first"); - updateSynch(); - } - - int result = JOptionPane - .showConfirmDialog(this, "Synchronize?", - "Do you want to synchronize now?", - JOptionPane.OK_CANCEL_OPTION); - if (result == JOptionPane.OK_OPTION) { - try { - SynchManagerService synchConfigurationService = idropCore - .getTransferManager().getTransferServiceFactory() - .instanceSynchManagerService(); - - if (synchConfigurationService - .isSynchRunning(selectedSynchronization)) { - MessageManager - .showMessage( - this, - "Cannot schedule the synchronization, a synch is currently running", - MessageManager.TITLE_MESSAGE); - return; - } - idropCore.getTransferManager().enqueueASynch( - selectedSynchronization, - selectedSynchronization - .buildIRODSAccountFromSynchronizationData()); - } catch (Exception ex) { - log.error("error starting synch", ex); - MessageManager.showError(this, ex.getMessage(), - MessageManager.TITLE_MESSAGE); - throw new IdropRuntimeException(ex); - } - } - } - - private void checkVerifyChecksumOnTransferActionPerformed( - final java.awt.event.ActionEvent evt) { - // - } - - private void btnLogoutActionPerformed(final java.awt.event.ActionEvent evt) { - log.info("logging out to log in to a new grid"); - - final IDROPConfigurationPanel thisPanel = this; - - java.awt.EventQueue.invokeLater(new Runnable() { - - @Override - public void run() { - - IRODSAccount savedAccount = idropCore.getIrodsAccount(); - idropCore.setIrodsAccount(null); - iDrop idrop = (iDrop) thisPanel.getParent(); - LoginDialog loginDialog = new LoginDialog(thisPanel, idropCore); - loginDialog.setVisible(true); - - if (idropCore.getIrodsAccount() == null) { - log.warn("no account, reverting"); - idropCore.setIrodsAccount(savedAccount); - } else { - idrop.reinitializeForChangedIRODSAccount(); - } - refreshAccountData(); - } - }); - - } - - private void btnChangePasswordActionPerformed( - final java.awt.event.ActionEvent evt) { - ChangePasswordDialog changePasswordDialog = new ChangePasswordDialog( - (iDrop) getParent(), this, true); - changePasswordDialog.setLocationRelativeTo(this); - changePasswordDialog.setVisible(true); - } - - protected JTable getSynchTable() { - return jTableSynch; - } - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JButton btnApplyPipelineConfig; - private javax.swing.JButton btnChangePassword; - private javax.swing.JButton btnChooseIrodsSynch; - private javax.swing.JButton btnChooseLocalSynch; - private javax.swing.JButton btnDeleteSynch; - private javax.swing.JButton btnLogout; - private javax.swing.JButton btnNewSynch; - private javax.swing.JButton btnOK; - private javax.swing.JButton btnRefreshSynch; - private javax.swing.JButton btnRestoreDefaults; - private javax.swing.JButton btnSynchNow; - private javax.swing.JButton btnUpdateSynch; - private javax.swing.ButtonGroup buttonGroupSynchMode; - private javax.swing.JCheckBox checkAllowParallelTransfers; - private javax.swing.JCheckBox checkAllowRerouting; - private javax.swing.JCheckBox checkConnectionRestart; - private javax.swing.JCheckBox checkLogSuccessfulTransfer; - private javax.swing.JCheckBox checkShowFileProgress; - private javax.swing.JCheckBox checkShowGUI; - private javax.swing.JCheckBox checkUseExecutorPool; - private javax.swing.JCheckBox checkUseNIOForParallelTransfers; - private javax.swing.JCheckBox checkVerifyChecksumOnTransfer; - private javax.swing.JComboBox comboPrefsDefaultResource; - private javax.swing.JLabel jLabel1; - private javax.swing.JLabel jLabel5; - private javax.swing.JComboBox jcomboSynchFrequency; - private javax.swing.JLabel lblGetBufferSize; - private javax.swing.JLabel lblHost; - private javax.swing.JLabel lblHostLabel; - private javax.swing.JLabel lblInternalCacheBufferSize; - private javax.swing.JLabel lblInternalInputBufferSize; - private javax.swing.JLabel lblInternalOutputBufferSize; - private javax.swing.JLabel lblIputToOutputCopyBufferSize; - private javax.swing.JLabel lblIrodsParallelSocketTimeout; - private javax.swing.JLabel lblIrodsSocketTimeout; - private javax.swing.JLabel lblLocalFileInputBufferSize; - private javax.swing.JLabel lblLocalFileOutputBufferSize; - private javax.swing.JLabel lblMaximumParallelTransferThreads; - private javax.swing.JLabel lblPort; - private javax.swing.JLabel lblPortLabel; - private javax.swing.JLabel lblPutBufferSize; - private javax.swing.JLabel lblResourceLabel; - private javax.swing.JLabel lblSynchDate; - private javax.swing.JLabel lblSynchDateLabel; - private javax.swing.JLabel lblSynchName; - private javax.swing.JLabel lblSynchStatus; - private javax.swing.JLabel lblUserName; - private javax.swing.JLabel lblUserNameLabel; - private javax.swing.JLabel lblZone; - private javax.swing.JLabel lblZoneLabel; - private javax.swing.JPanel panelSynchToolbar; - private javax.swing.JPanel plnPipelineConfiguration; - private javax.swing.JPanel pnlBottom; - private javax.swing.JPanel pnlBuffers; - private javax.swing.JPanel pnlCenter; - private javax.swing.JPanel pnlConfigGrids; - private javax.swing.JPanel pnlConfigIdrop; - private javax.swing.JPanel pnlConfigSynch; - private javax.swing.JPanel pnlConfigSynchDetails; - private javax.swing.JPanel pnlConfigSynchListing; - private javax.swing.JPanel pnlConfigTransfers; - private javax.swing.JPanel pnlCurrentGrid; - private javax.swing.JPanel pnlCurrentGridToolbar; - private javax.swing.JPanel pnlIrodsSynch; - private javax.swing.JPanel pnlLocalSynch; - private javax.swing.JPanel pnlParallelTransferOptions; - private javax.swing.JPanel pnlSynchData; - private javax.swing.JPanel pnlSynchFrequency; - private javax.swing.JPanel pnlSynchIcon; - private javax.swing.JPanel pnlSynchMode; - private javax.swing.JPanel pnlSynchName; - private javax.swing.JPanel pnlSynchRefresh; - private javax.swing.JPanel pnlTop; - private javax.swing.JPanel pnlTransferManagement; - private javax.swing.JRadioButton radioBackup; - private javax.swing.JRadioButton radioFeed; - private javax.swing.JRadioButton radioSynch; - private javax.swing.JScrollPane scrollSynchTable; - private javax.swing.JSpinner spinnerIrodsMaxParallelThreads; - private javax.swing.JSpinner spinnerIrodsParallelSocketTimeout; - private javax.swing.JSpinner spinnerIrodsSocketTimeout; - private javax.swing.JTabbedPane tabConfig; - private javax.swing.JTextField txtGetBufferSize; - private javax.swing.JTextField txtInputToOutputCopyBufferSize; - private javax.swing.JTextField txtInternalCacheBufferSize; - private javax.swing.JTextField txtInternalInputBufferSize; - private javax.swing.JTextField txtInternalOutputBufferSize; - private javax.swing.JTextField txtIrodsPath; - private javax.swing.JTextField txtLocalFileInputBufferSize; - private javax.swing.JTextField txtLocalFileOutputBufferSize; - private javax.swing.JTextField txtLocalPath; - private javax.swing.JTextField txtPutBufferSize; - private javax.swing.JTextField txtSynchName; - - // End of variables declaration//GEN-END:variables - - private void initWithConfigData() { - resetTransferPipelineEditColors(); - IdropConfig idropConfig = idropCore.getIdropConfig(); - checkShowGUI.setSelected(idropConfig.isShowGuiAtStartup()); - checkLogSuccessfulTransfer.setSelected(idropConfig - .isLogSuccessfulTransfers()); - checkUseExecutorPool.setSelected(idropConfig.isParallelUsePool()); - checkVerifyChecksumOnTransfer.setSelected(idropConfig - .isVerifyChecksum()); - checkShowFileProgress.setSelected(idropConfig - .isIntraFileStatusCallbacks()); - checkAllowRerouting.setSelected(idropConfig - .isAllowConnectionRerouting()); - checkUseExecutorPool.setSelected(idropConfig.isParallelUsePool()); - spinnerIrodsSocketTimeout.setValue(idropConfig - .getIrodsConnectionTimeout()); - spinnerIrodsParallelSocketTimeout.setValue(idropConfig - .getIrodsParallelConnectionTimeout()); - spinnerIrodsMaxParallelThreads.setValue(idropConfig - .getIrodsParallelTransferMaxThreads()); - checkAllowParallelTransfers.setSelected(idropConfig - .isUseParallelTransfers()); - checkConnectionRestart.setSelected(idropConfig.isConnectionRestart()); - checkUseNIOForParallelTransfers.setSelected(idropConfig - .isUseNIOForParallelTransfers()); - txtInternalInputBufferSize.setText(String.valueOf(idropConfig - .getInternalInputStreamBufferSize())); - txtInternalOutputBufferSize.setText(String.valueOf(idropConfig - .getInternalOutputStreamBufferSize())); - txtLocalFileInputBufferSize.setText(String.valueOf(idropConfig - .getLocalFileInputStreamBufferSize())); - txtLocalFileOutputBufferSize.setText(String.valueOf(idropConfig - .getLocalFileOutputStreamBufferSize())); - txtGetBufferSize - .setText(String.valueOf(idropConfig.getGetBufferSize())); - txtPutBufferSize - .setText(String.valueOf(idropConfig.getPutBufferSize())); - txtInputToOutputCopyBufferSize.setText(String.valueOf(idropConfig - .getInputToOutputCopyBufferByteSize())); - txtInternalCacheBufferSize.setText(String.valueOf(idropConfig - .getInternalCacheBufferSize())); - refreshAccountData(); - } - - /** - * Reset colors in synch panel when re-validating - */ - private void resetSynchPanel() { - txtLocalPath.setBackground(Color.WHITE); - txtIrodsPath.setBackground(Color.WHITE); - txtSynchName.setBackground(Color.WHITE); - } - - /** - * Clear synch panel values and colors - */ - private void clearAndResetSynchPanel() { - resetSynchPanel(); - txtLocalPath.setText(""); - txtIrodsPath.setText(""); - txtSynchName.setText(""); - radioBackup.setSelected(true); - lblSynchDate.setText(""); - pnlSynchIcon.removeAll(); - pnlSynchIcon.validate(); - jcomboSynchFrequency.setSelectedIndex(0); - } - - private void refreshAccountData() { - - if (idropCore.getIrodsAccount() == null) { - lblHost.setText(""); - lblPort.setText(""); - lblZone.setText(""); - comboPrefsDefaultResource.setModel(new DefaultComboBoxModel()); - lblUserName.setText(""); - } else { - lblHost.setText(idropCore.getIrodsAccount().getHost()); - lblPort.setText(String.valueOf(idropCore.getIrodsAccount() - .getPort())); - lblZone.setText(idropCore.getIrodsAccount().getZone()); - lblUserName.setText(idropCore.getIrodsAccount().getUserName()); - try { - ResourceAO resourceAO = idropCore.getIRODSAccessObjectFactory() - .getResourceAO(idropCore.getIrodsAccount()); - log.info("getting a list of all resources in the zone"); - List<String> resources = resourceAO.listResourceNames(); - comboPrefsDefaultResource.setModel(new DefaultComboBoxModel( - resources.toArray())); - comboPrefsDefaultResource.setSelectedItem(idropCore - .getIrodsAccount().getDefaultStorageResource()); - } catch (JargonException ex) { - log.error("error getting resource list", ex); - throw new IdropRuntimeException("error getting resource list", - ex); - } - } - // check to see if default resource editing is allowed - String allowEdit = idropCore.getIdropConfig().getPropertyForKey( - IdropConfigurationService.IDROP_ENABLE_RESC_EDIT); - if (allowEdit != null && allowEdit.equals("false")) { - comboPrefsDefaultResource.setEnabled(false); - } - } - - protected void updateDetailsForSelectedSynch(final int i) { - // make sure the most up-to-date information is displayed - int modelIdx = getSynchTable().convertRowIndexToModel(i); - SynchConfigTableModel model = (SynchConfigTableModel) getSynchTable() - .getModel(); - - selectedSynchronization = model.getSynchronizationAt(modelIdx); - - if (selectedSynchronization == null) { - model.removeRow(modelIdx); - return; - } - - // initialize data - txtLocalPath.setText(selectedSynchronization.getLocalSynchDirectory()); - txtIrodsPath.setText(selectedSynchronization.getIrodsSynchDirectory()); - txtSynchName.setText(selectedSynchronization.getName()); - - if (selectedSynchronization.getFrequencyType() == FrequencyType.EVERY_HOUR) { - jcomboSynchFrequency.setSelectedIndex(0); - } else if (selectedSynchronization.getFrequencyType() == FrequencyType.EVERY_WEEK) { - jcomboSynchFrequency.setSelectedIndex(1); - } else if (selectedSynchronization.getFrequencyType() == FrequencyType.EVERY_DAY) { - jcomboSynchFrequency.setSelectedIndex(2); - } else if (selectedSynchronization.getFrequencyType() == FrequencyType.EVERY_TWO_MINUTES) { - jcomboSynchFrequency.setSelectedIndex(3); - } else { - // default to hourly to avoid errors - log.error("unknown frequency type for synch:{}", - selectedSynchronization.getFrequencyType()); - jcomboSynchFrequency.setSelectedIndex(0); - } - - if (selectedSynchronization.getSynchronizationMode() == SynchronizationType.BI_DIRECTIONAL) { - radioSynch.setSelected(true); - } else if (selectedSynchronization.getSynchronizationMode() == SynchronizationType.ONE_WAY_IRODS_TO_LOCAL) { - radioFeed.setSelected(true); - } else if (selectedSynchronization.getSynchronizationMode() == SynchronizationType.ONE_WAY_LOCAL_TO_IRODS) { - radioBackup.setSelected(true); - } else { - log.error("unknown synchronization mode for synch:{}", - selectedSynchronization.getSynchronizationMode()); - throw new IdropRuntimeException("unknown synchronization mode"); - } - - btnDeleteSynch.setEnabled(true); - btnUpdateSynch.setEnabled(true); - btnSynchNow.setEnabled(true); - - setSynchIcon(selectedSynchronization); - if (selectedSynchronization.getLastSynchronized() == null) { - lblSynchDate.setText("None"); - } else { - lblSynchDate.setText(dateFormat.format(selectedSynchronization - .getLastSynchronized())); - } - - } - - protected void setLockStatusSynchPanel(final boolean lockStatus) { - txtSynchName.setEnabled(lockStatus); - txtLocalPath.setEnabled(lockStatus); - btnChooseLocalSynch.setEnabled(lockStatus); - radioBackup.setEnabled(lockStatus); - // radioFeed.setEnabled(lockStatus); - // radioSynch.setEnabled(lockStatus); - jcomboSynchFrequency.setEnabled(lockStatus); - txtIrodsPath.setEnabled(lockStatus); - btnChooseIrodsSynch.setEnabled(lockStatus); - btnDeleteSynch.setEnabled(lockStatus); - btnUpdateSynch.setEnabled(lockStatus); - btnSynchNow.setEnabled(lockStatus); - // btnSynchDetails.setEnabled(lockStatus); - } - - private void setSynchIcon(final Synchronization synchronization) { - - JLabel labelToUse = null; - - SynchManagerService synchManagerService = idropCore - .getTransferManager().getTransferServiceFactory() - .instanceSynchManagerService(); - try { - boolean isRunning = synchManagerService - .isSynchRunning(synchronization); - if (isRunning) { - labelToUse = IconHelper.getRunningIcon(); - } else if (synchronization.getLastSynchronizationStatus() == null) { - labelToUse = IconHelper.getOkIcon(); - } else if (synchronization.getLastSynchronizationStatus() == TransferStatus.ERROR) { - labelToUse = IconHelper.getErrorIcon(); - } else { - labelToUse = IconHelper.getOkIcon(); - } - } catch (SynchException ex) { - log.error("error checking if synch is already running:{}", - synchronization, ex); - throw new IdropRuntimeException( - "exception checking if synch is already running", ex); - } - - pnlSynchIcon.removeAll(); - lblSynchStatus = labelToUse; - pnlSynchIcon.add(lblSynchStatus); - pnlSynchIcon.validate(); - - } + private final IDROPCore idropCore; + private static final org.slf4j.Logger log = LoggerFactory.getLogger(IDROPConfigurationPanel.class); + private JTable jTableSynch = null; + private Synchronization selectedSynchronization = null; + private DateFormat dateFormat = SimpleDateFormat.getDateTimeInstance(); + private final iDrop idropGui; + + /** + * Creates new form IDROPConfigurationPanel + */ + public IDROPConfigurationPanel(java.awt.Frame parent, boolean modal, IDROPCore idropCore) { + super(parent, modal); + this.idropCore = idropCore; + this.idropGui = (iDrop) parent; + initComponents(); + initPublicLinkComponents(); + initWithConfigData(); + } + + private void initPublicLinkComponents(){ + pnlConfigPublicLinks = new JPanel(); + pnlConfigPublicLinks.setLayout(new FlowLayout()); + txtPublicLinks = new JTextField("",30); + + txtPublicLinks.addFocusListener(new FocusListener() { + + @Override + public void focusGained(FocusEvent focusEvent) { + //noting to do + } + + @Override + public void focusLost(FocusEvent focusEvent) { + JTextField tgt = (JTextField) focusEvent.getSource(); + try { + idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.IDROP_PUBLIC_LINK_SERVICE, tgt.getText()); + } catch (IdropException e) { + throw new IdropRuntimeException(e); + } + } + + }); + pnlConfigPublicLinks.add(txtPublicLinks); + tabConfig.addTab("Public links", pnlConfigPublicLinks); + } + + private boolean checkIfSynchChanged() throws IdropRuntimeException { + // compare data and update synch first if necessary + + boolean areEqual = true; + + if (!selectedSynchronization.getLocalSynchDirectory().equals(txtLocalPath.getText())) { + areEqual = false; + } + + if (!selectedSynchronization.getName().equals(txtSynchName.getText())) { + areEqual = false; + } + + if (!selectedSynchronization.getIrodsSynchDirectory().equals(txtIrodsPath.getText())) { + areEqual = false; + } + + SynchronizationType currentSynchronizationType = getSynchTypeFromGUI(); + + if (currentSynchronizationType != selectedSynchronization.getSynchronizationMode()) { + areEqual = false; + } + + FrequencyType currentFrequencyType = null; + currentFrequencyType = getSynchFrequencyFromGUI(); + + if (selectedSynchronization.getFrequencyType() != currentFrequencyType) { + areEqual = false; + } + + return areEqual; + } + + private FrequencyType getSynchFrequencyFromGUI() { + FrequencyType currentFrequencyType = null; + if (jcomboSynchFrequency.getSelectedIndex() == 0) { + currentFrequencyType = FrequencyType.EVERY_HOUR; + } else if (jcomboSynchFrequency.getSelectedIndex() == 1) { + currentFrequencyType = FrequencyType.EVERY_WEEK; + } else if (jcomboSynchFrequency.getSelectedIndex() == 2) { + currentFrequencyType = FrequencyType.EVERY_DAY; + } else if (jcomboSynchFrequency.getSelectedIndex() == 3) { + currentFrequencyType = FrequencyType.EVERY_TWO_MINUTES; + } + return currentFrequencyType; + } + + private SynchronizationType getSynchTypeFromGUI() throws IdropRuntimeException { + SynchronizationType currentSynchronizationType; + if (radioBackup.isSelected()) { + currentSynchronizationType = SynchronizationType.ONE_WAY_LOCAL_TO_IRODS; + } else if (radioFeed.isSelected()) { + currentSynchronizationType = SynchronizationType.ONE_WAY_IRODS_TO_LOCAL; + } else if (radioSynch.isSelected()) { + currentSynchronizationType = SynchronizationType.BI_DIRECTIONAL; + } else { + log.error("unknown synchronization type in GUI"); + throw new IdropRuntimeException("unknown synchroization type in GUI"); + } + return currentSynchronizationType; + } + + /** + * This method is called from within the constructor to initialize the form. WARNING: Do NOT + * modify this code. The content of this method is always regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + java.awt.GridBagConstraints gridBagConstraints; + + buttonGroupSynchMode = new javax.swing.ButtonGroup(); + pnlTop = new javax.swing.JPanel(); + pnlCenter = new javax.swing.JPanel(); + tabConfig = new javax.swing.JTabbedPane(); + pnlConfigIdrop = new javax.swing.JPanel(); + checkShowGUI = new javax.swing.JCheckBox(); + checkShowFileProgress = new javax.swing.JCheckBox(); + pnlConfigGrids = new javax.swing.JPanel(); + pnlCurrentGrid = new javax.swing.JPanel(); + lblHostLabel = new javax.swing.JLabel(); + lblHost = new javax.swing.JLabel(); + lblPortLabel = new javax.swing.JLabel(); + lblPort = new javax.swing.JLabel(); + lblZoneLabel = new javax.swing.JLabel(); + lblZone = new javax.swing.JLabel(); + lblResourceLabel = new javax.swing.JLabel(); + lblUserNameLabel = new javax.swing.JLabel(); + lblUserName = new javax.swing.JLabel(); + pnlCurrentGridToolbar = new javax.swing.JPanel(); + btnLogout = new javax.swing.JButton(); + btnChangePassword = new javax.swing.JButton(); + comboPrefsDefaultResource = new javax.swing.JComboBox(); + pnlConfigTransfers = new javax.swing.JPanel(); + pnlTransferManagement = new javax.swing.JPanel(); + checkLogSuccessfulTransfer = new javax.swing.JCheckBox(); + checkVerifyChecksumOnTransfer = new javax.swing.JCheckBox(); + checkAllowRerouting = new javax.swing.JCheckBox(); + checkConnectionRestart = new javax.swing.JCheckBox(); + plnPipelineConfiguration = new javax.swing.JPanel(); + lblIrodsSocketTimeout = new javax.swing.JLabel(); + spinnerIrodsSocketTimeout = new javax.swing.JSpinner(); + pnlParallelTransferOptions = new javax.swing.JPanel(); + checkAllowParallelTransfers = new javax.swing.JCheckBox(); + checkUseNIOForParallelTransfers = new javax.swing.JCheckBox(); + checkUseExecutorPool = new javax.swing.JCheckBox(); + lblIrodsParallelSocketTimeout = new javax.swing.JLabel(); + spinnerIrodsParallelSocketTimeout = new javax.swing.JSpinner(); + lblMaximumParallelTransferThreads = new javax.swing.JLabel(); + spinnerIrodsMaxParallelThreads = new javax.swing.JSpinner(); + pnlBuffers = new javax.swing.JPanel(); + lblInternalInputBufferSize = new javax.swing.JLabel(); + txtInternalInputBufferSize = new javax.swing.JTextField(); + lblInternalOutputBufferSize = new javax.swing.JLabel(); + txtInternalOutputBufferSize = new javax.swing.JTextField(); + lblLocalFileInputBufferSize = new javax.swing.JLabel(); + txtLocalFileInputBufferSize = new javax.swing.JTextField(); + lblLocalFileOutputBufferSize = new javax.swing.JLabel(); + txtLocalFileOutputBufferSize = new javax.swing.JTextField(); + lblPutBufferSize = new javax.swing.JLabel(); + txtPutBufferSize = new javax.swing.JTextField(); + lblGetBufferSize = new javax.swing.JLabel(); + txtGetBufferSize = new javax.swing.JTextField(); + lblIputToOutputCopyBufferSize = new javax.swing.JLabel(); + txtInputToOutputCopyBufferSize = new javax.swing.JTextField(); + lblInternalCacheBufferSize = new javax.swing.JLabel(); + txtInternalCacheBufferSize = new javax.swing.JTextField(); + btnRestoreDefaults = new javax.swing.JButton(); + btnApplyPipelineConfig = new javax.swing.JButton(); + pnlConfigSynch = new javax.swing.JPanel(); + pnlConfigSynchListing = new javax.swing.JPanel(); + pnlSynchRefresh = new javax.swing.JPanel(); + btnRefreshSynch = new javax.swing.JButton(); + scrollSynchTable = new javax.swing.JScrollPane(); + pnlConfigSynchDetails = new javax.swing.JPanel(); + pnlSynchData = new javax.swing.JPanel(); + pnlSynchName = new javax.swing.JPanel(); + lblSynchName = new javax.swing.JLabel(); + txtSynchName = new javax.swing.JTextField(); + lblSynchDateLabel = new javax.swing.JLabel(); + lblSynchDate = new javax.swing.JLabel(); + pnlSynchIcon = new javax.swing.JPanel(); + lblSynchStatus = new javax.swing.JLabel(); + pnlLocalSynch = new javax.swing.JPanel(); + txtLocalPath = new javax.swing.JTextField(); + btnChooseLocalSynch = new javax.swing.JButton(); + pnlSynchMode = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + radioBackup = new javax.swing.JRadioButton(); + radioFeed = new javax.swing.JRadioButton(); + radioSynch = new javax.swing.JRadioButton(); + pnlSynchFrequency = new javax.swing.JPanel(); + jLabel5 = new javax.swing.JLabel(); + jcomboSynchFrequency = new javax.swing.JComboBox(); + pnlIrodsSynch = new javax.swing.JPanel(); + txtIrodsPath = new javax.swing.JTextField(); + btnChooseIrodsSynch = new javax.swing.JButton(); + panelSynchToolbar = new javax.swing.JPanel(); + btnDeleteSynch = new javax.swing.JButton(); + btnNewSynch = new javax.swing.JButton(); + btnUpdateSynch = new javax.swing.JButton(); + btnSynchNow = new javax.swing.JButton(); + pnlBottom = new javax.swing.JPanel(); + btnOK = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.title")); // NOI18N + + org.jdesktop.layout.GroupLayout pnlTopLayout = new org.jdesktop.layout.GroupLayout(pnlTop); + pnlTop.setLayout(pnlTopLayout); + pnlTopLayout.setHorizontalGroup( + pnlTopLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(0, 1067, Short.MAX_VALUE) + ); + pnlTopLayout.setVerticalGroup( + pnlTopLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(0, 0, Short.MAX_VALUE) + ); + + getContentPane().add(pnlTop, java.awt.BorderLayout.NORTH); + + pnlConfigIdrop.setLayout(new java.awt.GridBagLayout()); + + checkShowGUI.setMnemonic('s'); + checkShowGUI.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.checkShowGUI.text")); // NOI18N + checkShowGUI.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.checkShowGUI.toolTipText")); // NOI18N + checkShowGUI.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + checkShowGUIItemStateChanged(evt); + } + }); + checkShowGUI.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + checkShowGUIActionPerformed(evt); + } + }); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 0; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + pnlConfigIdrop.add(checkShowGUI, gridBagConstraints); + + checkShowFileProgress.setMnemonic('w'); + checkShowFileProgress.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.checkShowFileProgress.text")); // NOI18N + checkShowFileProgress.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.checkShowFileProgress.toolTipText")); // NOI18N + checkShowFileProgress.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + checkShowFileProgressItemStateChanged(evt); + } + }); + checkShowFileProgress.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + checkShowFileProgressActionPerformed(evt); + } + }); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + pnlConfigIdrop.add(checkShowFileProgress, gridBagConstraints); + + tabConfig.addTab(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.pnlConfigIdrop.TabConstraints.tabTitle"), pnlConfigIdrop); // NOI18N + + pnlConfigGrids.setLayout(new java.awt.BorderLayout()); + + pnlCurrentGrid.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.pnlCurrentGrid.border.title"))); // NOI18N + pnlCurrentGrid.setLayout(new java.awt.GridBagLayout()); + + lblHostLabel.setFont(new java.awt.Font("Lucida Grande", 1, 13)); // NOI18N + lblHostLabel.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblHostLabel.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; + pnlCurrentGrid.add(lblHostLabel, gridBagConstraints); + + lblHost.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblHost.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + pnlCurrentGrid.add(lblHost, gridBagConstraints); + lblHost.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblHost.AccessibleContext.accessibleDescription")); // NOI18N + + lblPortLabel.setFont(new java.awt.Font("Lucida Grande", 1, 13)); // NOI18N + lblPortLabel.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblPortLabel.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; + pnlCurrentGrid.add(lblPortLabel, gridBagConstraints); + + lblPort.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblPort.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 1; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + pnlCurrentGrid.add(lblPort, gridBagConstraints); + lblPort.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblPort.AccessibleContext.accessibleDescription")); // NOI18N + + lblZoneLabel.setFont(new java.awt.Font("Lucida Grande", 1, 13)); // NOI18N + lblZoneLabel.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblZoneLabel.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; + pnlCurrentGrid.add(lblZoneLabel, gridBagConstraints); + + lblZone.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblZone.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + pnlCurrentGrid.add(lblZone, gridBagConstraints); + lblZone.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblZone.AccessibleContext.accessibleDescription")); // NOI18N + + lblResourceLabel.setFont(new java.awt.Font("Lucida Grande", 1, 13)); // NOI18N + lblResourceLabel.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblResourceLabel.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 4; + gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; + pnlCurrentGrid.add(lblResourceLabel, gridBagConstraints); + + lblUserNameLabel.setFont(new java.awt.Font("Lucida Grande", 1, 13)); // NOI18N + lblUserNameLabel.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblUserNameLabel.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 3; + gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; + pnlCurrentGrid.add(lblUserNameLabel, gridBagConstraints); + + lblUserName.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblUserName.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 3; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + pnlCurrentGrid.add(lblUserName, gridBagConstraints); + lblUserName.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblUserName.AccessibleContext.accessibleName")); // NOI18N + + btnLogout.setMnemonic('l'); + btnLogout.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnLogout.text")); // NOI18N + btnLogout.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnLogout.toolTipText")); // NOI18N + btnLogout.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnLogoutActionPerformed(evt); + } + }); + pnlCurrentGridToolbar.add(btnLogout); + + btnChangePassword.setMnemonic('c'); + btnChangePassword.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnChangePassword.text")); // NOI18N + btnChangePassword.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnChangePassword.toolTipText")); // NOI18N + btnChangePassword.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnChangePasswordActionPerformed(evt); + } + }); + pnlCurrentGridToolbar.add(btnChangePassword); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 5; + gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; + gridBagConstraints.insets = new java.awt.Insets(20, 0, 0, 0); + pnlCurrentGrid.add(pnlCurrentGridToolbar, gridBagConstraints); + + comboPrefsDefaultResource.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); + comboPrefsDefaultResource.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + comboPrefsDefaultResourceActionPerformed(evt); + } + }); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 4; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + pnlCurrentGrid.add(comboPrefsDefaultResource, gridBagConstraints); + + pnlConfigGrids.add(pnlCurrentGrid, java.awt.BorderLayout.CENTER); + + tabConfig.addTab(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.pnlConfigGrids.TabConstraints.tabTitle"), pnlConfigGrids); // NOI18N + + pnlConfigTransfers.setLayout(new java.awt.GridBagLayout()); + + pnlTransferManagement.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.pnlTransferManagement.border.title"))); // NOI18N + pnlTransferManagement.setLayout(new javax.swing.BoxLayout(pnlTransferManagement, javax.swing.BoxLayout.PAGE_AXIS)); + + checkLogSuccessfulTransfer.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.checkLogSuccessfulTransfer.text")); // NOI18N + checkLogSuccessfulTransfer.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.checkLogSuccessfulTransfer.toolTipText")); // NOI18N + checkLogSuccessfulTransfer.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + checkLogSuccessfulTransferItemStateChanged(evt); + } + }); + checkLogSuccessfulTransfer.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + checkLogSuccessfulTransferActionPerformed(evt); + } + }); + pnlTransferManagement.add(checkLogSuccessfulTransfer); + + checkVerifyChecksumOnTransfer.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.checkVerifyChecksumOnTransfer.text")); // NOI18N + checkVerifyChecksumOnTransfer.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + checkVerifyChecksumOnTransferItemStateChanged(evt); + } + }); + checkVerifyChecksumOnTransfer.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + checkVerifyChecksumOnTransferActionPerformed(evt); + } + }); + pnlTransferManagement.add(checkVerifyChecksumOnTransfer); + + checkAllowRerouting.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.checkAllowRerouting.text")); // NOI18N + checkAllowRerouting.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.checkAllowRerouting.toolTipText")); // NOI18N + checkAllowRerouting.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + checkAllowReroutingItemStateChanged(evt); + } + }); + pnlTransferManagement.add(checkAllowRerouting); + + checkConnectionRestart.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.checkConnectionRestart.text")); // NOI18N + checkConnectionRestart.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.checkConnectionRestart.toolTipText")); // NOI18N + checkConnectionRestart.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + checkConnectionRestartItemStateChanged(evt); + } + }); + checkConnectionRestart.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + checkConnectionRestartActionPerformed(evt); + } + }); + pnlTransferManagement.add(checkConnectionRestart); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 0; + gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; + gridBagConstraints.gridheight = java.awt.GridBagConstraints.RELATIVE; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + pnlConfigTransfers.add(pnlTransferManagement, gridBagConstraints); + + plnPipelineConfiguration.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.plnPipelineConfiguration.border.title"))); // NOI18N + plnPipelineConfiguration.setLayout(new java.awt.GridBagLayout()); + + lblIrodsSocketTimeout.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblIrodsSocketTimeout.text")); // NOI18N + lblIrodsSocketTimeout.setPreferredSize(null); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; + plnPipelineConfiguration.add(lblIrodsSocketTimeout, gridBagConstraints); + + spinnerIrodsSocketTimeout.setModel(new javax.swing.SpinnerNumberModel(0, 0, 600, 10)); + spinnerIrodsSocketTimeout.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.spinnerIrodsSocketTimeout.toolTipText")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + plnPipelineConfiguration.add(spinnerIrodsSocketTimeout, gridBagConstraints); + + pnlParallelTransferOptions.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.pnlParallelTransferOptions.border.title"))); // NOI18N + pnlParallelTransferOptions.setLayout(new java.awt.GridBagLayout()); + + checkAllowParallelTransfers.setMnemonic('p'); + checkAllowParallelTransfers.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.checkAllowParallelTransfers.text")); // NOI18N + checkAllowParallelTransfers.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.checkAllowParallelTransfers.toolTipText")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 0; + gridBagConstraints.gridwidth = 2; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + pnlParallelTransferOptions.add(checkAllowParallelTransfers, gridBagConstraints); + + checkUseNIOForParallelTransfers.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.checkUseNIOForParallelTransfers.text")); // NOI18N + checkUseNIOForParallelTransfers.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.checkUseNIOForParallelTransfers.toolTipText")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.gridwidth = 2; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + pnlParallelTransferOptions.add(checkUseNIOForParallelTransfers, gridBagConstraints); + + checkUseExecutorPool.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.checkUseExecutorPool.text")); // NOI18N + checkUseExecutorPool.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + checkUseExecutorPoolItemStateChanged(evt); + } + }); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 2; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + pnlParallelTransferOptions.add(checkUseExecutorPool, gridBagConstraints); + + lblIrodsParallelSocketTimeout.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblIrodsParallelSocketTimeout.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 6; + gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; + gridBagConstraints.insets = new java.awt.Insets(28, 0, 0, 0); + pnlParallelTransferOptions.add(lblIrodsParallelSocketTimeout, gridBagConstraints); + + spinnerIrodsParallelSocketTimeout.setModel(new javax.swing.SpinnerNumberModel(0, 0, 600, 10)); + spinnerIrodsParallelSocketTimeout.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.spinnerIrodsParallelSocketTimeout.toolTipText")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 6; + gridBagConstraints.ipadx = 159; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(22, 0, 0, 0); + pnlParallelTransferOptions.add(spinnerIrodsParallelSocketTimeout, gridBagConstraints); + + lblMaximumParallelTransferThreads.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblMaximumParallelTransferThreads.text")); // NOI18N + lblMaximumParallelTransferThreads.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblMaximumParallelTransferThreads.toolTipText")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 7; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(6, 180, 0, 0); + pnlParallelTransferOptions.add(lblMaximumParallelTransferThreads, gridBagConstraints); + + spinnerIrodsMaxParallelThreads.setModel(new javax.swing.SpinnerNumberModel(4, 0, 16, 1)); + spinnerIrodsMaxParallelThreads.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.spinnerIrodsMaxParallelThreads.toolTipText")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 7; + gridBagConstraints.gridheight = 2; + gridBagConstraints.ipadx = 171; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 22, 0); + pnlParallelTransferOptions.add(spinnerIrodsMaxParallelThreads, gridBagConstraints); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + plnPipelineConfiguration.add(pnlParallelTransferOptions, gridBagConstraints); + + pnlBuffers.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.pnlBuffers.border.title"))); // NOI18N + pnlBuffers.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.pnlBuffers.toolTipText")); // NOI18N + pnlBuffers.setLayout(new java.awt.GridBagLayout()); + + lblInternalInputBufferSize.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblInternalInputBufferSize.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 0; + gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; + pnlBuffers.add(lblInternalInputBufferSize, gridBagConstraints); + + txtInternalInputBufferSize.setColumns(20); + txtInternalInputBufferSize.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtInternalInputBufferSize.text")); // NOI18N + txtInternalInputBufferSize.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtInternalInputBufferSize.toolTipText")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 2; + gridBagConstraints.gridy = 0; + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; + pnlBuffers.add(txtInternalInputBufferSize, gridBagConstraints); + + lblInternalOutputBufferSize.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblInternalOutputBufferSize.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; + pnlBuffers.add(lblInternalOutputBufferSize, gridBagConstraints); + + txtInternalOutputBufferSize.setColumns(20); + txtInternalOutputBufferSize.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtInternalOutputBufferSize.text")); // NOI18N + txtInternalOutputBufferSize.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtInternalOutputBufferSize.toolTipText")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 2; + gridBagConstraints.gridy = 1; + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; + pnlBuffers.add(txtInternalOutputBufferSize, gridBagConstraints); + + lblLocalFileInputBufferSize.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblLocalFileInputBufferSize.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 2; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; + pnlBuffers.add(lblLocalFileInputBufferSize, gridBagConstraints); + + txtLocalFileInputBufferSize.setColumns(20); + txtLocalFileInputBufferSize.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtLocalFileInputBufferSize.text")); // NOI18N + txtLocalFileInputBufferSize.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtLocalFileInputBufferSize.toolTipText")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 2; + gridBagConstraints.gridy = 2; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + pnlBuffers.add(txtLocalFileInputBufferSize, gridBagConstraints); + + lblLocalFileOutputBufferSize.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblLocalFileOutputBufferSize.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 3; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; + pnlBuffers.add(lblLocalFileOutputBufferSize, gridBagConstraints); + + txtLocalFileOutputBufferSize.setColumns(20); + txtLocalFileOutputBufferSize.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtLocalFileOutputBufferSize.text")); // NOI18N + txtLocalFileOutputBufferSize.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtLocalFileOutputBufferSize.toolTipText")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 2; + gridBagConstraints.gridy = 3; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + pnlBuffers.add(txtLocalFileOutputBufferSize, gridBagConstraints); + + lblPutBufferSize.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblPutBufferSize.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 5; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; + pnlBuffers.add(lblPutBufferSize, gridBagConstraints); + + txtPutBufferSize.setColumns(20); + txtPutBufferSize.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtPutBufferSize.text")); // NOI18N + txtPutBufferSize.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtPutBufferSize.toolTipText")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 2; + gridBagConstraints.gridy = 5; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + pnlBuffers.add(txtPutBufferSize, gridBagConstraints); + + lblGetBufferSize.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblGetBufferSize.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 4; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; + pnlBuffers.add(lblGetBufferSize, gridBagConstraints); + + txtGetBufferSize.setColumns(20); + txtGetBufferSize.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtGetBufferSize.text")); // NOI18N + txtGetBufferSize.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtGetBufferSize.toolTipText")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 2; + gridBagConstraints.gridy = 4; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + pnlBuffers.add(txtGetBufferSize, gridBagConstraints); + + lblIputToOutputCopyBufferSize.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblIputToOutputCopyBufferSize.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 6; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; + pnlBuffers.add(lblIputToOutputCopyBufferSize, gridBagConstraints); + + txtInputToOutputCopyBufferSize.setColumns(20); + txtInputToOutputCopyBufferSize.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtInputToOutputCopyBufferSize.text")); // NOI18N + txtInputToOutputCopyBufferSize.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtInputToOutputCopyBufferSize.toolTipText")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 2; + gridBagConstraints.gridy = 6; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + pnlBuffers.add(txtInputToOutputCopyBufferSize, gridBagConstraints); + + lblInternalCacheBufferSize.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblInternalCacheBufferSize.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 7; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; + pnlBuffers.add(lblInternalCacheBufferSize, gridBagConstraints); + + txtInternalCacheBufferSize.setColumns(20); + txtInternalCacheBufferSize.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtInternalCacheBufferSize.text")); // NOI18N + txtInternalCacheBufferSize.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtInternalCacheBufferSize.toolTipText")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 2; + gridBagConstraints.gridy = 7; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + pnlBuffers.add(txtInternalCacheBufferSize, gridBagConstraints); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 1; + gridBagConstraints.gridwidth = 3; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + plnPipelineConfiguration.add(pnlBuffers, gridBagConstraints); + + btnRestoreDefaults.setMnemonic('a'); + btnRestoreDefaults.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnRestoreDefaults.text")); // NOI18N + btnRestoreDefaults.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnRestoreDefaults.toolTipText")); // NOI18N + btnRestoreDefaults.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnRestoreDefaultsActionPerformed(evt); + } + }); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 2; + gridBagConstraints.gridy = 3; + plnPipelineConfiguration.add(btnRestoreDefaults, gridBagConstraints); + + btnApplyPipelineConfig.setMnemonic('a'); + btnApplyPipelineConfig.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnApplyPipelineConfig.text")); // NOI18N + btnApplyPipelineConfig.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnApplyPipelineConfig.toolTipText")); // NOI18N + btnApplyPipelineConfig.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnApplyPipelineConfigActionPerformed(evt); + } + }); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 3; + gridBagConstraints.gridy = 3; + plnPipelineConfiguration.add(btnApplyPipelineConfig, gridBagConstraints); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 2; + gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + pnlConfigTransfers.add(plnPipelineConfiguration, gridBagConstraints); + + tabConfig.addTab(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.pnlConfigTransfers.TabConstraints.tabTitle"), pnlConfigTransfers); // NOI18N + + pnlConfigSynch.addComponentListener(new java.awt.event.ComponentAdapter() { + public void componentShown(java.awt.event.ComponentEvent evt) { + pnlConfigSynchComponentShown(evt); + } + }); + pnlConfigSynch.setLayout(new java.awt.BorderLayout()); + + pnlConfigSynchListing.setMinimumSize(new java.awt.Dimension(23, 100)); + pnlConfigSynchListing.setLayout(new java.awt.BorderLayout()); + + btnRefreshSynch.setMnemonic('r'); + btnRefreshSynch.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnRefreshSynch.text")); // NOI18N + btnRefreshSynch.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnRefreshSynch.toolTipText")); // NOI18N + btnRefreshSynch.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnRefreshSynchActionPerformed(evt); + } + }); + pnlSynchRefresh.add(btnRefreshSynch); + + pnlConfigSynchListing.add(pnlSynchRefresh, java.awt.BorderLayout.NORTH); + + scrollSynchTable.setMinimumSize(new java.awt.Dimension(23, 100)); + scrollSynchTable.setPreferredSize(new java.awt.Dimension(100, 100)); + pnlConfigSynchListing.add(scrollSynchTable, java.awt.BorderLayout.CENTER); + + pnlConfigSynch.add(pnlConfigSynchListing, java.awt.BorderLayout.CENTER); + + pnlConfigSynchDetails.setLayout(new java.awt.BorderLayout()); + + pnlSynchData.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); + pnlSynchData.setLayout(new java.awt.GridBagLayout()); + + pnlSynchName.setLayout(new java.awt.GridBagLayout()); + + lblSynchName.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblSynchName.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; + pnlSynchName.add(lblSynchName, gridBagConstraints); + + txtSynchName.setColumns(40); + txtSynchName.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtSynchName.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 1; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + pnlSynchName.add(txtSynchName, gridBagConstraints); + + lblSynchDateLabel.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblSynchDateLabel.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; + pnlSynchName.add(lblSynchDateLabel, gridBagConstraints); + + lblSynchDate.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblSynchDate.text")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; + pnlSynchName.add(lblSynchDate, gridBagConstraints); + + lblSynchStatus.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.lblSynchStatus.text")); // NOI18N + lblSynchStatus.setMaximumSize(null); + lblSynchStatus.setMinimumSize(new java.awt.Dimension(10, 10)); + lblSynchStatus.setPreferredSize(new java.awt.Dimension(10, 10)); + pnlSynchIcon.add(lblSynchStatus); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 2; + gridBagConstraints.gridy = 2; + gridBagConstraints.gridwidth = 3; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + pnlSynchName.add(pnlSynchIcon, gridBagConstraints); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 0; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; + gridBagConstraints.insets = new java.awt.Insets(20, 20, 30, 20); + pnlSynchData.add(pnlSynchName, gridBagConstraints); + + txtLocalPath.setColumns(80); + txtLocalPath.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtLocalPath.text")); // NOI18N + txtLocalPath.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtLocalPath.toolTipText")); // NOI18N + txtLocalPath.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtLocalPathActionPerformed(evt); + } + }); + pnlLocalSynch.add(txtLocalPath); + + btnChooseLocalSynch.setMnemonic('c'); + btnChooseLocalSynch.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnChooseLocalSynch.text")); // NOI18N + btnChooseLocalSynch.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnChooseLocalSynch.toolTipText")); // NOI18N + btnChooseLocalSynch.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnChooseLocalSynchActionPerformed(evt); + } + }); + pnlLocalSynch.add(btnChooseLocalSynch); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.gridwidth = 9; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; + gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 10); + pnlSynchData.add(pnlLocalSynch, gridBagConstraints); + + pnlSynchMode.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + pnlSynchMode.setLayout(new java.awt.GridLayout(0, 1)); + + jLabel1.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.jLabel1.text")); // NOI18N + pnlSynchMode.add(jLabel1); + + buttonGroupSynchMode.add(radioBackup); + radioBackup.setSelected(true); + radioBackup.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.radioBackup.text")); // NOI18N + pnlSynchMode.add(radioBackup); + + buttonGroupSynchMode.add(radioFeed); + radioFeed.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.radioFeed.text")); // NOI18N + radioFeed.setEnabled(false); + pnlSynchMode.add(radioFeed); + + buttonGroupSynchMode.add(radioSynch); + radioSynch.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.radioSynch.text")); // NOI18N + radioSynch.setEnabled(false); + pnlSynchMode.add(radioSynch); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 2; + gridBagConstraints.gridwidth = 9; + gridBagConstraints.gridheight = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + gridBagConstraints.insets = new java.awt.Insets(20, 20, 20, 20); + pnlSynchData.add(pnlSynchMode, gridBagConstraints); + + pnlSynchFrequency.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + pnlSynchFrequency.setLayout(new java.awt.GridLayout(0, 1)); + + jLabel5.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.jLabel5.text")); // NOI18N + pnlSynchFrequency.add(jLabel5); + + jcomboSynchFrequency.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Hourly", "Weekly", "Daily", "Every 2 Minutes (testing)", "", "" })); + jcomboSynchFrequency.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.jcomboSynchFrequency.toolTipText")); // NOI18N + pnlSynchFrequency.add(jcomboSynchFrequency); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 4; + gridBagConstraints.gridwidth = 9; + gridBagConstraints.gridheight = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + gridBagConstraints.insets = new java.awt.Insets(20, 20, 20, 20); + pnlSynchData.add(pnlSynchFrequency, gridBagConstraints); + + txtIrodsPath.setColumns(80); + txtIrodsPath.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtIrodsPath.text")); // NOI18N + txtIrodsPath.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.txtIrodsPath.toolTipText")); // NOI18N + txtIrodsPath.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtIrodsPathActionPerformed(evt); + } + }); + pnlIrodsSynch.add(txtIrodsPath); + + btnChooseIrodsSynch.setMnemonic('i'); + btnChooseIrodsSynch.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnChooseIrodsSynch.text")); // NOI18N + btnChooseIrodsSynch.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnChooseIrodsSynch.toolTipText")); // NOI18N + btnChooseIrodsSynch.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnChooseIrodsSynchActionPerformed(evt); + } + }); + pnlIrodsSynch.add(btnChooseIrodsSynch); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 6; + gridBagConstraints.gridwidth = 9; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; + gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 10); + pnlSynchData.add(pnlIrodsSynch, gridBagConstraints); + + pnlConfigSynchDetails.add(pnlSynchData, java.awt.BorderLayout.CENTER); + + btnDeleteSynch.setMnemonic('d'); + btnDeleteSynch.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnDeleteSynch.text")); // NOI18N + btnDeleteSynch.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnDeleteSynch.toolTipText")); // NOI18N + btnDeleteSynch.setEnabled(false); + btnDeleteSynch.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnDeleteSynchActionPerformed(evt); + } + }); + panelSynchToolbar.add(btnDeleteSynch); + + btnNewSynch.setMnemonic('n'); + btnNewSynch.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnNewSynch.text")); // NOI18N + btnNewSynch.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnNewSynch.toolTipText")); // NOI18N + btnNewSynch.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnNewSynchActionPerformed(evt); + } + }); + panelSynchToolbar.add(btnNewSynch); + + btnUpdateSynch.setMnemonic('u'); + btnUpdateSynch.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnUpdateSynch.text")); // NOI18N + btnUpdateSynch.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnUpdateSynch.toolTipText")); // NOI18N + btnUpdateSynch.setEnabled(false); + btnUpdateSynch.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnUpdateSynchActionPerformed(evt); + } + }); + panelSynchToolbar.add(btnUpdateSynch); + + btnSynchNow.setMnemonic('s'); + btnSynchNow.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnSynchNow.text")); // NOI18N + btnSynchNow.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnSynchNow.toolTipText")); // NOI18N + btnSynchNow.setEnabled(false); + btnSynchNow.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSynchNowActionPerformed(evt); + } + }); + panelSynchToolbar.add(btnSynchNow); + + pnlConfigSynchDetails.add(panelSynchToolbar, java.awt.BorderLayout.SOUTH); + + pnlConfigSynch.add(pnlConfigSynchDetails, java.awt.BorderLayout.SOUTH); + + tabConfig.addTab(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.pnlConfigSynch.TabConstraints.tabTitle"), pnlConfigSynch); // NOI18N + + pnlCenter.add(tabConfig); + + getContentPane().add(pnlCenter, java.awt.BorderLayout.CENTER); + + pnlBottom.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT)); + + btnOK.setMnemonic('O'); + btnOK.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnOK.text")); // NOI18N + btnOK.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnOK.toolTipText")); // NOI18N + btnOK.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnOKActionPerformed(evt); + } + }); + pnlBottom.add(btnOK); + + getContentPane().add(pnlBottom, java.awt.BorderLayout.SOUTH); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + /** + * Refresh the displayed synch + * + * @param evt + */ + private void btnRefreshSynchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRefreshSynchActionPerformed + refreshSynchConfigPanel(); + }//GEN-LAST:event_btnRefreshSynchActionPerformed + + private void checkShowFileProgressActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkShowFileProgressActionPerformed + // + }//GEN-LAST:event_checkShowFileProgressActionPerformed + + private void checkShowGUIItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_checkShowGUIItemStateChanged + + boolean isSelected = false; + if (evt.getStateChange() == ItemEvent.SELECTED) { + isSelected = true; + } + log.info("updating show gui at startup to:{}", isSelected); + try { + idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.SHOW_GUI, Boolean.toString(isSelected)); + } catch (IdropException ex) { + log.error("error setting show gui property", ex); + throw new IdropRuntimeException(ex); + } + }//GEN-LAST:event_checkShowGUIItemStateChanged + + private void checkShowFileProgressItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_checkShowFileProgressItemStateChanged + boolean isSelected = false; + if (evt.getStateChange() == ItemEvent.SELECTED) { + isSelected = true; + } + log.info("updating show intra-file progress to:{}", isSelected); + try { + idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.INTRA_FILE_STATUS_CALLBACKS, Boolean.toString(isSelected)); + idropCore.getIdropConfigurationService().updateJargonPropertiesBasedOnIDROPConfig(); + } catch (Exception ex) { + log.error("error setting property", ex); + throw new IdropRuntimeException(ex); + } + }//GEN-LAST:event_checkShowFileProgressItemStateChanged + + private void checkVerifyChecksumOnTransferItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_checkVerifyChecksumOnTransferItemStateChanged + updateConfigForGivenPropertyBasedOnCheckboxStateChange(evt, IdropConfigurationService.VERIFY_CHECKSUM_ON_TRANSFER); + } + + private void updateConfigForGivenPropertyBasedOnCheckboxStateChange(ItemEvent evt, String propertyName) throws IdropRuntimeException { + boolean isSelected = false; + if (evt.getStateChange() == ItemEvent.SELECTED) { + isSelected = true; + } + log.info("updating verify checksum to:{}", isSelected); + try { + idropCore.getIdropConfigurationService().updateConfig(propertyName, Boolean.toString(isSelected)); + idropCore.getIdropConfigurationService().updateJargonPropertiesBasedOnIDROPConfig(); + } catch (Exception ex) { + log.error("error setting property", ex); + throw new IdropRuntimeException(ex); + } + }//GEN-LAST:event_checkVerifyChecksumOnTransferItemStateChanged + + private void checkLogSuccessfulTransferItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_checkLogSuccessfulTransferItemStateChanged + + updateConfigForGivenPropertyBasedOnCheckboxStateChange(evt, IdropConfigurationService.TRANSFER_ENGINE_RECORD_SUCCESSFUL_FILES); + }//GEN-LAST:event_checkLogSuccessfulTransferItemStateChanged + + private void checkUseExecutorPoolItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_checkUseExecutorPoolItemStateChanged + updateConfigForGivenPropertyBasedOnCheckboxStateChange(evt, IdropConfigurationService.IRODS_PARALLEL_USE_POOL); + }//GEN-LAST:event_checkUseExecutorPoolItemStateChanged + + private void checkAllowReroutingItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_checkAllowReroutingItemStateChanged + boolean isSelected = false; + if (evt.getStateChange() == ItemEvent.SELECTED) { + isSelected = true; + } + log.info("updating allow rerouting to:{}", isSelected); + try { + idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.ALLOW_CONNECTION_REROUTING, Boolean.toString(isSelected)); + idropCore.getIdropConfigurationService().updateJargonPropertiesBasedOnIDROPConfig(); + } catch (Exception ex) { + log.error("error setting property", ex); + throw new IdropRuntimeException(ex); + } + }//GEN-LAST:event_checkAllowReroutingItemStateChanged + + private void resetTransferPipelineEditColors() { + txtInternalInputBufferSize.setBackground(Color.white); + txtInternalOutputBufferSize.setBackground(Color.white); + txtLocalFileInputBufferSize.setBackground(Color.white); + txtLocalFileOutputBufferSize.setBackground(Color.white); + txtGetBufferSize.setBackground(Color.white); + txtPutBufferSize.setBackground(Color.white); + txtInputToOutputCopyBufferSize.setBackground(Color.white); + txtInternalCacheBufferSize.setBackground(Color.white); + } + + /** + * Update the pipeline configuration information properties based on the screen data + * + * @param evt + */ + private void btnApplyPipelineConfigActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnApplyPipelineConfigActionPerformed + try { + + resetTransferPipelineEditColors(); + // edit and set + + // internal input buffer size + String actual = txtInternalInputBufferSize.getText(); + int actualAsInt = 0; + if (actual.isEmpty()) { + actualAsInt = 0; + } else { + try { + actualAsInt = Integer.parseInt(actual); + idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.IRODS_IO_INTERNAL_INPUT_STREAM_BUFFER_SIZE, actual); + } catch (NumberFormatException nfe) { + txtInternalInputBufferSize.setBackground(Color.red); + MessageManager.showWarning(this, "Invalid internal input buffer size", MessageManager.TITLE_MESSAGE); + return; + } + } + + // internal output buffer size + actual = txtInternalOutputBufferSize.getText(); + actualAsInt = 0; + if (actual.isEmpty()) { + actualAsInt = 0; + } else { + try { + actualAsInt = Integer.parseInt(actual); + idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.IRODS_IO_INTERNAL_OUTPUT_STREAM_BUFFER_SIZE, actual); + } catch (NumberFormatException nfe) { + txtInternalOutputBufferSize.setBackground(Color.red); + MessageManager.showWarning(this, "Invalid internal output buffer size", MessageManager.TITLE_MESSAGE); + return; + } + } + + // local file input buffer size + actual = txtLocalFileInputBufferSize.getText(); + actualAsInt = 0; + if (actual.isEmpty()) { + actualAsInt = 0; + } else { + try { + actualAsInt = Integer.parseInt(actual); + idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.IRODS_IO_LOCAL_INPUT_STREAM_BUFFER_SIZE, actual); + } catch (NumberFormatException nfe) { + txtLocalFileInputBufferSize.setBackground(Color.red); + MessageManager.showWarning(this, "Invalid local file input buffer size", MessageManager.TITLE_MESSAGE); + return; + } + } + + // local file output buffer size + actual = txtLocalFileOutputBufferSize.getText(); + actualAsInt = 0; + if (actual.isEmpty()) { + actualAsInt = 0; + } else { + try { + actualAsInt = Integer.parseInt(actual); + idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.IRODS_IO_LOCAL_OUTPUT_STREAM_BUFFER_SIZE, actual); + } catch (NumberFormatException nfe) { + txtLocalFileOutputBufferSize.setBackground(Color.red); + MessageManager.showWarning(this, "Invalid local file output buffer size", MessageManager.TITLE_MESSAGE); + return; + } + } + + // get buffer size + actual = txtGetBufferSize.getText(); + actualAsInt = 0; + if (actual.isEmpty()) { + actualAsInt = 0; + } else { + try { + actualAsInt = Integer.parseInt(actual); + idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.IRODS_IO_GET_BUFFER_SIZE, actual); + } catch (NumberFormatException nfe) { + txtGetBufferSize.setBackground(Color.red); + MessageManager.showWarning(this, "Invalid get buffer size", MessageManager.TITLE_MESSAGE); + return; + } + } + + // put buffer size + actual = txtPutBufferSize.getText(); + actualAsInt = 0; + if (actual.isEmpty()) { + actualAsInt = 0; + } else { + try { + actualAsInt = Integer.parseInt(actual); + idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.IRODS_IO_PUT_BUFFER_SIZE, actual); + } catch (NumberFormatException nfe) { + txtPutBufferSize.setBackground(Color.red); + MessageManager.showWarning(this, "Invalid put buffer size", MessageManager.TITLE_MESSAGE); + return; + } + } + + // input to output copy buffer size + actual = txtInputToOutputCopyBufferSize.getText(); + actualAsInt = 0; + if (actual.isEmpty()) { + actualAsInt = 0; + } else { + try { + actualAsInt = Integer.parseInt(actual); + idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.IRODS_IO_INPUT_TO_OUTPUT_COPY_BUFFER_SIZE, actual); + } catch (NumberFormatException nfe) { + txtInputToOutputCopyBufferSize.setBackground(Color.red); + MessageManager.showWarning(this, "Invalid input to output copy buffer size", MessageManager.TITLE_MESSAGE); + return; + } + } + + // internal cache buffer size + actual = txtInternalCacheBufferSize.getText(); + actualAsInt = 0; + if (actual.isEmpty()) { + actualAsInt = 0; + } else { + try { + actualAsInt = Integer.parseInt(actual); + idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.IRODS_IO_INTERNAL_CACHE_BUFFER_SIZE, actual); + } catch (NumberFormatException nfe) { + txtInternalCacheBufferSize.setBackground(Color.red); + MessageManager.showWarning(this, "Invalid internal cache buffer size", MessageManager.TITLE_MESSAGE); + return; + } + } + + idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.IRODS_PARALLEL_USE_PARALLEL, Boolean.toString(checkAllowParallelTransfers.isSelected())); + idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.IRODS_PARALLEL_USE_NIO, Boolean.toString(checkUseNIOForParallelTransfers.isSelected())); + idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.IRODS_PARALLEL_CONNECTION_MAX_THREADS, spinnerIrodsMaxParallelThreads.getValue().toString()); + idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.IRODS_PARALLEL_CONNECTION_TIMEOUT, spinnerIrodsParallelSocketTimeout.getValue().toString()); + idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.IRODS_CONNECTION_TIMEOUT, spinnerIrodsSocketTimeout.getValue().toString()); + + idropCore.getIdropConfigurationService().updateJargonPropertiesBasedOnIDROPConfig(); + } catch (Exception ex) { + log.error("error setting property", ex); + throw new IdropRuntimeException(ex); + } + }//GEN-LAST:event_btnApplyPipelineConfigActionPerformed + + private void btnRestoreDefaultsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRestoreDefaultsActionPerformed + log.info("restoring pipeline config to jargon properties settings"); + try { + JargonProperties defaultJargonProperties = new DefaultPropertiesJargonConfig(); + IdropConfigurationService configService = idropCore.getIdropConfigurationService(); + configService.restoreIDROPConfigFromJargonProperties(defaultJargonProperties); + initWithConfigData(); + MessageManager.showMessage(this, "Values restored to defaults, hit apply to update", MessageManager.TITLE_MESSAGE); + } catch (JargonException ex) { + log.error("unable to restore jargon properties", ex); + throw new IdropRuntimeException("unable to restore jargon properties", ex); + } + + }//GEN-LAST:event_btnRestoreDefaultsActionPerformed + + private void comboPrefsDefaultResourceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboPrefsDefaultResourceActionPerformed + String newResource = (String)comboPrefsDefaultResource.getSelectedItem(); + idropCore.getIrodsAccount().setDefaultStorageResource(newResource); + idropGui.reinitializeForChangedIRODSAccount(); + }//GEN-LAST:event_comboPrefsDefaultResourceActionPerformed + + private void checkConnectionRestartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkConnectionRestartActionPerformed + + + + + + }//GEN-LAST:event_checkConnectionRestartActionPerformed + + private void checkConnectionRestartItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_checkConnectionRestartItemStateChanged + boolean isSelected = false; + if (evt.getStateChange() == ItemEvent.SELECTED) { + isSelected = true; + } + log.info("updating connection restart to:{}", isSelected); + try { + idropCore.getIdropConfigurationService().updateConfig(IdropConfigurationService.IRODS_CONNECTION_RESTART, Boolean.toString(isSelected)); + idropCore.getIdropConfigurationService().updateJargonPropertiesBasedOnIDROPConfig(); + } catch (Exception ex) { + log.error("error setting property", ex); + throw new IdropRuntimeException(ex); + } + }//GEN-LAST:event_checkConnectionRestartItemStateChanged + + private void btnOKActionPerformed(java.awt.event.ActionEvent evt) { + this.dispose(); + } + + private void checkShowGUIActionPerformed(java.awt.event.ActionEvent evt) { + // + } + + private void checkLogSuccessfulTransferActionPerformed(java.awt.event.ActionEvent evt) { + // + } + + private void pnlConfigSynchComponentShown(java.awt.event.ComponentEvent evt) { + + refreshSynchConfigPanel(); + + } + + private void refreshSynchConfigPanel() { + log.info("lazily loading synch data"); + + final IDROPConfigurationPanel thisPanel = this; + + java.awt.EventQueue.invokeLater(new Runnable() { + + @Override + public void run() { + + + SynchManagerService synchConfigurationService = idropCore.getTransferManager().getTransferServiceFactory().instanceSynchManagerService(); + + try { + thisPanel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + List<Synchronization> synchronizations = synchConfigurationService.listAllSynchronizations(); + SynchConfigTableModel synchConfigTableModel = null; + if (jTableSynch == null) { + synchConfigTableModel = new SynchConfigTableModel(idropCore, synchronizations); + jTableSynch = new JTable(synchConfigTableModel); + jTableSynch.getSelectionModel().addListSelectionListener(new SynchListSelectionHandler(thisPanel)); + scrollSynchTable.setViewportView(jTableSynch); + scrollSynchTable.validate(); + pnlConfigSynchListing.validate(); + } else { + synchConfigTableModel = (SynchConfigTableModel) jTableSynch.getModel(); + synchConfigTableModel.setSynchronizations(synchronizations); + synchConfigTableModel.fireTableDataChanged(); + } + + if (synchConfigTableModel.getRowCount() > 0) { + jTableSynch.setRowSelectionInterval(0, 0); + } else { + lockSynchPanelForNewOnly(); + } + } catch (SynchException ex) { + log.error("error setting up synchs table", ex); + throw new IdropRuntimeException(ex); + } finally { + thisPanel.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + } + } + + private void lockSynchPanelForNewOnly() { + clearAndResetSynchPanel(); + setLockStatusSynchPanel(false); + } + }); + } + + private void txtLocalPathActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + } + + private void btnChooseLocalSynchActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + JFileChooser localFileChooser = new JFileChooser(); + localFileChooser.setMultiSelectionEnabled(false); + localFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + int returnVal = localFileChooser.showOpenDialog(this); + txtLocalPath.setText(localFileChooser.getSelectedFile().getAbsolutePath()); + } + + private void txtIrodsPathActionPerformed(java.awt.event.ActionEvent evt) { + // TODO add your handling code here: + } + + private void btnChooseIrodsSynchActionPerformed(java.awt.event.ActionEvent evt) { + try { + IRODSFinderDialog irodsFileSystemChooserView = new IRODSFinderDialog(null, true, idropCore); + final Toolkit toolkit = Toolkit.getDefaultToolkit(); + final Dimension screenSize = toolkit.getScreenSize(); + final int x = (screenSize.width - irodsFileSystemChooserView.getWidth()) / 2; + final int y = (screenSize.height - irodsFileSystemChooserView.getHeight()) / 2; + irodsFileSystemChooserView.setLocation(x, y); + irodsFileSystemChooserView.setVisible(true); + String absPath = irodsFileSystemChooserView.getSelectedAbsolutePath(); + irodsFileSystemChooserView.dispose(); + if (absPath != null) { + txtIrodsPath.setText(irodsFileSystemChooserView.getSelectedAbsolutePath()); + } + + // int returnVal = irodsFileChooser.showSaveDialog(this); + } catch (Exception e) { + log.error("exception choosings iRODS file"); + throw new IdropRuntimeException("exception choosing irods fie", e); + } finally { + idropCore.getIrodsFileSystem().closeAndEatExceptions(); + } + } + + /** + * Delete the selected synchronization + * + * @param evt + */ + private void btnDeleteSynchActionPerformed(java.awt.event.ActionEvent evt) { + + final IDROPConfigurationPanel thisPanel = this; + + java.awt.EventQueue.invokeLater(new Runnable() { + + @Override + public void run() { + + if (selectedSynchronization == null) { + MessageManager.showError(thisPanel, "Please select a synchronization from the table", MessageManager.TITLE_MESSAGE); + return; + } + Synchronization synchronization = selectedSynchronization; + + int result = JOptionPane.showConfirmDialog(thisPanel, + "Do you wish to delete this synchronization?", + MessageManager.TITLE_MESSAGE, + JOptionPane.OK_CANCEL_OPTION); + if (result == JOptionPane.CANCEL_OPTION) { + return; + } + try { + thisPanel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + SynchManagerService synchConfigurationService = idropCore.getTransferManager().getTransferServiceFactory().instanceSynchManagerService(); + log.info("deleting synchronization:{}", synchronization); + + if (synchConfigurationService.isSynchRunning(synchronization)) { + MessageManager.showMessage(thisPanel, "Cannot delete the synchronization, a synch is currently running", MessageManager.TITLE_MESSAGE); + return; + } + + ListSelectionModel lsm = (ListSelectionModel) thisPanel.getSynchTable().getSelectionModel(); + SynchConfigTableModel model = (SynchConfigTableModel) thisPanel.getSynchTable().getModel(); + + synchConfigurationService.deleteSynchronization(synchronization); + log.info("synch deleted, refreshing model"); + List<Synchronization> synchronizations = synchConfigurationService.listAllSynchronizations(); + + model.setSynchronizations(synchronizations); + model.fireTableDataChanged(); + + MessageManager.showMessage(thisPanel, "Configuration deleted", MessageManager.TITLE_MESSAGE); + btnDeleteSynch.setEnabled(false); + btnUpdateSynch.setEnabled(false); + btnSynchNow.setEnabled(false); + refreshSynchConfigPanel(); + } catch (Exception ex) { + MessageManager.showError(thisPanel, ex.getMessage(), MessageManager.TITLE_MESSAGE); + } finally { + thisPanel.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + idropCore.closeIRODSConnection( + idropCore.getIrodsAccount()); + } + } + }); + } + + /** + * Called to clear and prepare for adding a new synchronization + * + * @param evt + */ + private void btnNewSynchActionPerformed(java.awt.event.ActionEvent evt) { + clearAndResetSynchPanel(); + if (jTableSynch.getModel().getRowCount() > 0) { + jTableSynch.getSelectionModel().removeIndexInterval(0, jTableSynch.getModel().getRowCount() - 1); + } + selectedSynchronization = new Synchronization(); + btnDeleteSynch.setEnabled(false); + btnUpdateSynch.setEnabled(true); + btnSynchNow.setEnabled(false); + MessageManager.showMessage(this, "Enter the data for the new Synchronization and press Update to save", MessageManager.TITLE_MESSAGE); + setLockStatusSynchPanel(true); + btnSynchNow.setEnabled(false); + btnDeleteSynch.setEnabled(false); + } + + /** + * User signals that the displayed synchronization should be updated + * + * @param evt + */ + private void btnUpdateSynchActionPerformed(java.awt.event.ActionEvent evt) { + updateSynch(); + } + + private void updateSynch() { + final IDROPConfigurationPanel thisPanel = this; + + java.awt.EventQueue.invokeLater(new Runnable() { + + @Override + public void run() { + + resetSynchPanel(); + if (selectedSynchronization == null) { + MessageManager.showError(thisPanel, "Please select a synchronization from the table", MessageManager.TITLE_MESSAGE); + return; + } + + if (txtLocalPath.getText().trim().isEmpty()) { + txtLocalPath.setBackground(Color.RED); + MessageManager.showError(thisPanel, "Please select a local path", MessageManager.TITLE_MESSAGE); + return; + } + + if (txtIrodsPath.getText().trim().isEmpty()) { + txtIrodsPath.setBackground(Color.RED); + MessageManager.showError(thisPanel, "Please select an iRODS path", MessageManager.TITLE_MESSAGE); + return; + } + + if (txtSynchName.getText().trim().isEmpty()) { + txtSynchName.setBackground(Color.RED); + MessageManager.showError(thisPanel, "Please enter a unique name for this synchronization", MessageManager.TITLE_MESSAGE); + return; + } + + boolean isNew = (selectedSynchronization.getId() == null); + if (isNew) { + log.info("adding new synch"); + } + + SynchManagerService synchConfigurationService = idropCore.getTransferManager().getTransferServiceFactory().instanceSynchManagerService(); + + // edits pass, do update + log.info("saving synch data"); + Synchronization synchronization = selectedSynchronization; + synchronization.setUpdatedAt(new Date()); + synchronization.setFrequencyType(getSynchFrequencyFromGUI()); + + synchronization.setName(txtSynchName.getText().trim()); + synchronization.setSynchronizationMode(getSynchTypeFromGUI()); + synchronization.setLocalSynchDirectory(txtLocalPath.getText().trim()); + synchronization.setIrodsSynchDirectory(txtIrodsPath.getText().trim()); + IRODSAccount irodsAccount = idropCore.getIrodsAccount(); + synchronization.setIrodsHostName(irodsAccount.getHost()); + + try { + synchronization.setIrodsPassword(HibernateUtil.obfuscate(irodsAccount.getPassword())); + } catch (JargonException ex) { + log.error("exception obfuscating password", ex); + MessageManager.showError(thisPanel, ex.getMessage(), MessageManager.TITLE_MESSAGE); + throw new IdropRuntimeException(ex); + } + + synchronization.setIrodsPort(irodsAccount.getPort()); + synchronization.setIrodsUserName(irodsAccount.getUserName()); + synchronization.setIrodsZone(irodsAccount.getZone()); + synchronization.setDefaultResourceName(irodsAccount.getDefaultStorageResource()); + synchronization.setCreatedAt(new Date()); + selectedSynchronization = synchronization; + + try { + thisPanel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + if (synchConfigurationService.isSynchRunning(selectedSynchronization)) { + MessageManager.showMessage(thisPanel, "Cannot update the synchronization, a synch is currently running", MessageManager.TITLE_MESSAGE); + return; + } + + idropCore.getIdropConfigurationService().updateSynchronization(synchronization); + MessageManager.showMessage(thisPanel, "Configuration updated", MessageManager.TITLE_MESSAGE); + ListSelectionModel lsm = (ListSelectionModel) thisPanel.getSynchTable().getSelectionModel(); + SynchConfigTableModel model = (SynchConfigTableModel) thisPanel.getSynchTable().getModel(); + + if (isNew) { + + List<Synchronization> synchronizations = synchConfigurationService.listAllSynchronizations(); + + model.setSynchronizations(synchronizations); + model.fireTableDataChanged(); + } else { + if (lsm.isSelectionEmpty()) { + return; + } else { + // Find out which indexes are selected. + int minIndex = lsm.getMinSelectionIndex(); + int maxIndex = lsm.getMaxSelectionIndex(); + for (int i = minIndex; i <= maxIndex; i++) { + if (lsm.isSelectedIndex(i)) { + int modelIdx = thisPanel.getSynchTable().convertRowIndexToModel(i); + + model.getSynchronizations().set(modelIdx, synchronization); + model.fireTableDataChanged(); + break; + } + } + } + } + + btnDeleteSynch.setEnabled(true); + btnUpdateSynch.setEnabled(true); + btnSynchNow.setEnabled(true); + + } catch (IdropException ex) { + MessageManager.showError(thisPanel, ex.getMessage(), MessageManager.TITLE_MESSAGE); + } catch (SynchException ex) { + MessageManager.showError(thisPanel, ex.getMessage(), MessageManager.TITLE_MESSAGE); + } finally { + thisPanel.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + idropCore.closeIRODSConnection( + idropCore.getIrodsAccount()); + } + } + }); + } + + /** + * Force a synchronization process on the selected synchronization + * + * @param evt + */ + private void btnSynchNowActionPerformed(java.awt.event.ActionEvent evt) { + log.info("synch now button pressed"); + if (selectedSynchronization == null) { + MessageManager.showWarning(this, "Please select a synhronization", MessageManager.TITLE_MESSAGE); + return; + } + + log.info("selected synchronization is:{}", selectedSynchronization); + boolean synchIsUnchanged = checkIfSynchChanged(); + + if (!synchIsUnchanged) { + log.info("synch had been changed, update first"); + updateSynch(); + } + + int result = JOptionPane.showConfirmDialog(this, + "Synchronize?", + "Do you want to synchronize now?", + JOptionPane.OK_CANCEL_OPTION); + if (result == JOptionPane.OK_OPTION) { + try { + SynchManagerService synchConfigurationService = idropCore.getTransferManager().getTransferServiceFactory().instanceSynchManagerService(); + + if (synchConfigurationService.isSynchRunning(selectedSynchronization)) { + MessageManager.showMessage(this, "Cannot schedule the synchronization, a synch is currently running", MessageManager.TITLE_MESSAGE); + return; + } + idropCore.getTransferManager().enqueueASynch(selectedSynchronization, selectedSynchronization.buildIRODSAccountFromSynchronizationData()); + } catch (Exception ex) { + log.error("error starting synch", ex); + MessageManager.showError(this, ex.getMessage(), MessageManager.TITLE_MESSAGE); + throw new IdropRuntimeException(ex); + } + } + } + + private void checkVerifyChecksumOnTransferActionPerformed(java.awt.event.ActionEvent evt) { + // + } + + private void btnLogoutActionPerformed(java.awt.event.ActionEvent evt) { + log.info("logging out to log in to a new grid"); + + final IDROPConfigurationPanel thisPanel = this; + + java.awt.EventQueue.invokeLater(new Runnable() { + + @Override + public void run() { + + IRODSAccount savedAccount = idropCore.getIrodsAccount(); + idropCore.setIrodsAccount(null); + iDrop idrop = (iDrop) thisPanel.getParent(); + LoginDialog loginDialog = new LoginDialog(thisPanel, idropCore); + loginDialog.setVisible(true); + + if (idropCore.getIrodsAccount() == null) { + log.warn("no account, reverting"); + idropCore.setIrodsAccount(savedAccount); + } else { + idrop.reinitializeForChangedIRODSAccount(); + } + refreshAccountData(); + } + }); + + } + + private void btnChangePasswordActionPerformed(java.awt.event.ActionEvent evt) { + ChangePasswordDialog changePasswordDialog = new ChangePasswordDialog((iDrop) this.getParent(), this, true); + changePasswordDialog.setLocationRelativeTo(this); + changePasswordDialog.setVisible(true); + } + + protected JTable getSynchTable() { + return jTableSynch; + } + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton btnApplyPipelineConfig; + private javax.swing.JButton btnChangePassword; + private javax.swing.JButton btnChooseIrodsSynch; + private javax.swing.JButton btnChooseLocalSynch; + private javax.swing.JButton btnDeleteSynch; + private javax.swing.JButton btnLogout; + private javax.swing.JButton btnNewSynch; + private javax.swing.JButton btnOK; + private javax.swing.JButton btnRefreshSynch; + private javax.swing.JButton btnRestoreDefaults; + private javax.swing.JButton btnSynchNow; + private javax.swing.JButton btnUpdateSynch; + private javax.swing.ButtonGroup buttonGroupSynchMode; + private javax.swing.JCheckBox checkAllowParallelTransfers; + private javax.swing.JCheckBox checkAllowRerouting; + private javax.swing.JCheckBox checkConnectionRestart; + private javax.swing.JCheckBox checkLogSuccessfulTransfer; + private javax.swing.JCheckBox checkShowFileProgress; + private javax.swing.JCheckBox checkShowGUI; + private javax.swing.JCheckBox checkUseExecutorPool; + private javax.swing.JCheckBox checkUseNIOForParallelTransfers; + private javax.swing.JCheckBox checkVerifyChecksumOnTransfer; + private javax.swing.JComboBox comboPrefsDefaultResource; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel5; + private javax.swing.JComboBox jcomboSynchFrequency; + private javax.swing.JLabel lblGetBufferSize; + private javax.swing.JLabel lblHost; + private javax.swing.JLabel lblHostLabel; + private javax.swing.JLabel lblInternalCacheBufferSize; + private javax.swing.JLabel lblInternalInputBufferSize; + private javax.swing.JLabel lblInternalOutputBufferSize; + private javax.swing.JLabel lblIputToOutputCopyBufferSize; + private javax.swing.JLabel lblIrodsParallelSocketTimeout; + private javax.swing.JLabel lblIrodsSocketTimeout; + private javax.swing.JLabel lblLocalFileInputBufferSize; + private javax.swing.JLabel lblLocalFileOutputBufferSize; + private javax.swing.JLabel lblMaximumParallelTransferThreads; + private javax.swing.JLabel lblPort; + private javax.swing.JLabel lblPortLabel; + private javax.swing.JLabel lblPutBufferSize; + private javax.swing.JLabel lblResourceLabel; + private javax.swing.JLabel lblSynchDate; + private javax.swing.JLabel lblSynchDateLabel; + private javax.swing.JLabel lblSynchName; + private javax.swing.JLabel lblSynchStatus; + private javax.swing.JLabel lblUserName; + private javax.swing.JLabel lblUserNameLabel; + private javax.swing.JLabel lblZone; + private javax.swing.JLabel lblZoneLabel; + private javax.swing.JPanel panelSynchToolbar; + private javax.swing.JPanel plnPipelineConfiguration; + private javax.swing.JPanel pnlBottom; + private javax.swing.JPanel pnlBuffers; + private javax.swing.JPanel pnlCenter; + private javax.swing.JPanel pnlConfigGrids; + private javax.swing.JPanel pnlConfigIdrop; + private javax.swing.JPanel pnlConfigSynch; + private javax.swing.JPanel pnlConfigSynchDetails; + private javax.swing.JPanel pnlConfigSynchListing; + private javax.swing.JPanel pnlConfigTransfers; + private javax.swing.JPanel pnlCurrentGrid; + private javax.swing.JPanel pnlCurrentGridToolbar; + private javax.swing.JPanel pnlIrodsSynch; + private javax.swing.JPanel pnlLocalSynch; + private javax.swing.JPanel pnlParallelTransferOptions; + private javax.swing.JPanel pnlSynchData; + private javax.swing.JPanel pnlSynchFrequency; + private javax.swing.JPanel pnlSynchIcon; + private javax.swing.JPanel pnlSynchMode; + private javax.swing.JPanel pnlSynchName; + private javax.swing.JPanel pnlSynchRefresh; + private javax.swing.JPanel pnlTop; + private javax.swing.JPanel pnlTransferManagement; + private javax.swing.JRadioButton radioBackup; + private javax.swing.JRadioButton radioFeed; + private javax.swing.JRadioButton radioSynch; + private javax.swing.JScrollPane scrollSynchTable; + private javax.swing.JSpinner spinnerIrodsMaxParallelThreads; + private javax.swing.JSpinner spinnerIrodsParallelSocketTimeout; + private javax.swing.JSpinner spinnerIrodsSocketTimeout; + private javax.swing.JTabbedPane tabConfig; + private javax.swing.JTextField txtGetBufferSize; + private javax.swing.JTextField txtInputToOutputCopyBufferSize; + private javax.swing.JTextField txtInternalCacheBufferSize; + private javax.swing.JTextField txtInternalInputBufferSize; + private javax.swing.JTextField txtInternalOutputBufferSize; + private javax.swing.JTextField txtIrodsPath; + private javax.swing.JTextField txtLocalFileInputBufferSize; + private javax.swing.JTextField txtLocalFileOutputBufferSize; + private javax.swing.JTextField txtLocalPath; + private javax.swing.JTextField txtPutBufferSize; + private javax.swing.JTextField txtSynchName; + // End of variables declaration//GEN-END:variables + + // variable declarations for non-generated components + private javax.swing.JPanel pnlConfigPublicLinks; + private javax.swing.JTextField txtPublicLinks; + // end + + private void initWithConfigData() { + resetTransferPipelineEditColors(); + IdropConfig idropConfig = idropCore.getIdropConfig(); + checkShowGUI.setSelected(idropConfig.isShowGuiAtStartup()); + checkLogSuccessfulTransfer.setSelected(idropConfig.isLogSuccessfulTransfers()); + checkUseExecutorPool.setSelected(idropConfig.isParallelUsePool()); + checkVerifyChecksumOnTransfer.setSelected(idropConfig.isVerifyChecksum()); + checkShowFileProgress.setSelected(idropConfig.isIntraFileStatusCallbacks()); + checkAllowRerouting.setSelected(idropConfig.isAllowConnectionRerouting()); + checkUseExecutorPool.setSelected(idropConfig.isParallelUsePool()); + spinnerIrodsSocketTimeout.setValue(idropConfig.getIrodsConnectionTimeout()); + spinnerIrodsParallelSocketTimeout.setValue(idropConfig.getIrodsParallelConnectionTimeout()); + spinnerIrodsMaxParallelThreads.setValue(idropConfig.getIrodsParallelTransferMaxThreads()); + checkAllowParallelTransfers.setSelected(idropConfig.isUseParallelTransfers()); + checkConnectionRestart.setSelected(idropConfig.isConnectionRestart()); + checkUseNIOForParallelTransfers.setSelected(idropConfig.isUseNIOForParallelTransfers()); + txtInternalInputBufferSize.setText(String.valueOf(idropConfig.getInternalInputStreamBufferSize())); + txtInternalOutputBufferSize.setText(String.valueOf(idropConfig.getInternalOutputStreamBufferSize())); + txtLocalFileInputBufferSize.setText(String.valueOf(idropConfig.getLocalFileInputStreamBufferSize())); + txtLocalFileOutputBufferSize.setText(String.valueOf(idropConfig.getLocalFileOutputStreamBufferSize())); + txtGetBufferSize.setText(String.valueOf(idropConfig.getGetBufferSize())); + txtPutBufferSize.setText(String.valueOf(idropConfig.getPutBufferSize())); + txtInputToOutputCopyBufferSize.setText(String.valueOf(idropConfig.getInputToOutputCopyBufferByteSize())); + txtInternalCacheBufferSize.setText(String.valueOf(idropConfig.getInternalCacheBufferSize())); + txtPublicLinks.setText(idropConfig.getPublicLinkServiceUrl()); + refreshAccountData(); + } + + /** + * Reset colors in synch panel when re-validating + */ + private void resetSynchPanel() { + txtLocalPath.setBackground(Color.WHITE); + txtIrodsPath.setBackground(Color.WHITE); + txtSynchName.setBackground(Color.WHITE); + } + + /** + * Clear synch panel values and colors + */ + private void clearAndResetSynchPanel() { + resetSynchPanel(); + txtLocalPath.setText(""); + txtIrodsPath.setText(""); + txtSynchName.setText(""); + radioBackup.setSelected(true); + lblSynchDate.setText(""); + pnlSynchIcon.removeAll(); + pnlSynchIcon.validate(); + jcomboSynchFrequency.setSelectedIndex(0); + } + + private void refreshAccountData() { + + if (idropCore.getIrodsAccount() == null) { + lblHost.setText(""); + lblPort.setText(""); + lblZone.setText(""); + comboPrefsDefaultResource.setModel(new DefaultComboBoxModel()); + lblUserName.setText(""); + } else { + lblHost.setText(idropCore.getIrodsAccount().getHost()); + lblPort.setText(String.valueOf(idropCore.getIrodsAccount().getPort())); + lblZone.setText(idropCore.getIrodsAccount().getZone()); + lblUserName.setText(idropCore.getIrodsAccount().getUserName()); + try { + ResourceAO resourceAO = idropCore.getIRODSAccessObjectFactory().getResourceAO(idropCore.getIrodsAccount()); + log.info("getting a list of all resources in the zone"); + List<String> resources = resourceAO.listResourceNames(); + comboPrefsDefaultResource.setModel(new DefaultComboBoxModel(resources.toArray())); + comboPrefsDefaultResource.setSelectedItem(idropCore.getIrodsAccount().getDefaultStorageResource()); + } catch (JargonException ex) { + log.error("error getting resource list", ex); + throw new IdropRuntimeException("error getting resource list", ex); + } + } + // check to see if default resource editing is allowed + String allowEdit = idropCore.getIdropConfig().getPropertyForKey(IdropConfigurationService.IDROP_ENABLE_RESC_EDIT); + if (allowEdit != null && allowEdit.equals("false")) { + comboPrefsDefaultResource.setEnabled(false); + } + } + + protected void updateDetailsForSelectedSynch(int i) { + // make sure the most up-to-date information is displayed + int modelIdx = getSynchTable().convertRowIndexToModel(i); + SynchConfigTableModel model = (SynchConfigTableModel) getSynchTable().getModel(); + + selectedSynchronization = model.getSynchronizationAt(modelIdx); + + if (selectedSynchronization == null) { + model.removeRow(modelIdx); + return; + } + + // initialize data + txtLocalPath.setText(selectedSynchronization.getLocalSynchDirectory()); + txtIrodsPath.setText(selectedSynchronization.getIrodsSynchDirectory()); + txtSynchName.setText(selectedSynchronization.getName()); + + if (selectedSynchronization.getFrequencyType() == FrequencyType.EVERY_HOUR) { + jcomboSynchFrequency.setSelectedIndex(0); + } else if (selectedSynchronization.getFrequencyType() == FrequencyType.EVERY_WEEK) { + jcomboSynchFrequency.setSelectedIndex(1); + } else if (selectedSynchronization.getFrequencyType() == FrequencyType.EVERY_DAY) { + jcomboSynchFrequency.setSelectedIndex(2); + } else if (selectedSynchronization.getFrequencyType() == FrequencyType.EVERY_TWO_MINUTES) { + jcomboSynchFrequency.setSelectedIndex(3); + } else { + // default to hourly to avoid errors + log.error("unknown frequency type for synch:{}", selectedSynchronization.getFrequencyType()); + jcomboSynchFrequency.setSelectedIndex(0); + } + + if (selectedSynchronization.getSynchronizationMode() == SynchronizationType.BI_DIRECTIONAL) { + radioSynch.setSelected(true); + } else if (selectedSynchronization.getSynchronizationMode() == SynchronizationType.ONE_WAY_IRODS_TO_LOCAL) { + radioFeed.setSelected(true); + } else if (selectedSynchronization.getSynchronizationMode() == SynchronizationType.ONE_WAY_LOCAL_TO_IRODS) { + radioBackup.setSelected(true); + } else { + log.error("unknown synchronization mode for synch:{}", selectedSynchronization.getSynchronizationMode()); + throw new IdropRuntimeException("unknown synchronization mode"); + } + + btnDeleteSynch.setEnabled(true); + btnUpdateSynch.setEnabled(true); + btnSynchNow.setEnabled(true); + + setSynchIcon(selectedSynchronization); + if (selectedSynchronization.getLastSynchronized() == null) { + lblSynchDate.setText("None"); + } else { + lblSynchDate.setText(dateFormat.format(selectedSynchronization.getLastSynchronized())); + } + + } + + protected void setLockStatusSynchPanel(boolean lockStatus) { + txtSynchName.setEnabled(lockStatus); + txtLocalPath.setEnabled(lockStatus); + btnChooseLocalSynch.setEnabled(lockStatus); + radioBackup.setEnabled(lockStatus); + //radioFeed.setEnabled(lockStatus); + //radioSynch.setEnabled(lockStatus); + jcomboSynchFrequency.setEnabled(lockStatus); + txtIrodsPath.setEnabled(lockStatus); + btnChooseIrodsSynch.setEnabled(lockStatus); + btnDeleteSynch.setEnabled(lockStatus); + btnUpdateSynch.setEnabled(lockStatus); + btnSynchNow.setEnabled(lockStatus); + //btnSynchDetails.setEnabled(lockStatus); + } + + private void setSynchIcon(Synchronization synchronization) { + + JLabel labelToUse = null; + + SynchManagerService synchManagerService = idropCore.getTransferManager().getTransferServiceFactory().instanceSynchManagerService(); + try { + boolean isRunning = synchManagerService.isSynchRunning(synchronization); + if (isRunning) { + labelToUse = IconHelper.getRunningIcon(); + } else if (synchronization.getLastSynchronizationStatus() == null) { + labelToUse = IconHelper.getOkIcon(); + } else if (synchronization.getLastSynchronizationStatus() == TransferStatus.ERROR) { + labelToUse = IconHelper.getErrorIcon(); + } else { + labelToUse = IconHelper.getOkIcon(); + } + } catch (SynchException ex) { + log.error("error checking if synch is already running:{}", synchronization, ex); + throw new IdropRuntimeException("exception checking if synch is already running", ex); + } + + pnlSynchIcon.removeAll(); + lblSynchStatus = labelToUse; + pnlSynchIcon.add(lblSynchStatus); + pnlSynchIcon.validate(); + + } } class SynchListSelectionHandler implements ListSelectionListener { - private final IDROPConfigurationPanel idropConfigurationPanel; + private final IDROPConfigurationPanel idropConfigurationPanel; - SynchListSelectionHandler(final IDROPConfigurationPanel configurationPanel) { - idropConfigurationPanel = configurationPanel; - } + SynchListSelectionHandler(IDROPConfigurationPanel configurationPanel) { + this.idropConfigurationPanel = configurationPanel; + } - @Override - public void valueChanged(final ListSelectionEvent e) { + @Override + public void valueChanged(ListSelectionEvent e) { - if (e.getValueIsAdjusting() == true) { - return; - } + if (e.getValueIsAdjusting() == true) { + return; + } - ListSelectionModel lsm = (ListSelectionModel) e.getSource(); + ListSelectionModel lsm = (ListSelectionModel) e.getSource(); - if (lsm.isSelectionEmpty()) { - return; - } else { - // Find out which indexes are selected. - int minIndex = lsm.getMinSelectionIndex(); - int maxIndex = lsm.getMaxSelectionIndex(); - for (int i = minIndex; i <= maxIndex; i++) { - if (lsm.isSelectedIndex(i)) { - idropConfigurationPanel.updateDetailsForSelectedSynch(i); - } - } - } + if (lsm.isSelectionEmpty()) { + return; + } else { + // Find out which indexes are selected. + int minIndex = lsm.getMinSelectionIndex(); + int maxIndex = lsm.getMaxSelectionIndex(); + for (int i = minIndex; i <= maxIndex; i++) { + if (lsm.isSelectedIndex(i)) { + idropConfigurationPanel.updateDetailsForSelectedSynch(i); + } + } + } - } + } }
\ No newline at end of file diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/PublicLinkDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/PublicLinkDialog.java new file mode 100644 index 0000000..a1938e5 --- /dev/null +++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/PublicLinkDialog.java @@ -0,0 +1,59 @@ +package org.irods.jargon.idrop.desktop.systraygui; + +import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSNode; +import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSTree; + +import javax.swing.*; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; + +public class PublicLinkDialog extends JDialog { + + private final iDrop idrop; + + private final IRODSTree irodsTree; + + private final IRODSNode linkedNode; + + private JTextField linkField; + + private JButton copyToClipboardBtn; + + public PublicLinkDialog(final iDrop parent, final boolean modal, final IRODSTree irodsTree, final IRODSNode linkedNode){ + super(parent, modal); + this.idrop = parent; + this.irodsTree = irodsTree; + this.linkedNode = linkedNode; + initialize(); + + } + + private void initialize(){ + initComponents(); + } + + private void initComponents(){ + + } + + class GetPublicLink extends SwingWorker<String,Void>{ + + + + @Override + protected String doInBackground() throws Exception { + URL url = new URL("http://salvia.man.poznan.pl:8080/gdrop-servlet/hello"); + HttpURLConnection con = (HttpURLConnection) url.openConnection(); + if(con.getResponseCode()==200){ + BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream())); + return br.readLine(); + + }else{ + throw new Exception("error occurred while obtaining link"); + } + } + + } +} diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java index a7a98f5..30257cc 100644 --- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java +++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java @@ -1,7 +1,6 @@ package org.irods.jargon.idrop.desktop.systraygui.services; import java.util.Properties; - import org.irods.jargon.core.connection.IRODSAccount; import org.irods.jargon.core.connection.JargonProperties; import org.irods.jargon.core.exception.JargonException; @@ -13,119 +12,106 @@ import org.irods.jargon.transfer.engine.synch.ConflictingSynchException; * * @author mikeconway */ -public interface IdropConfigurationService { - - public static final String IDROP_VERSION_FILE_NAME = ".idropVersion"; - - public static final String VERSION_3_1 = "3.1.0.0"; - - public static final String VERSION_NUMBER = "idrop.version"; - public static final String IDROP_PROPS_FILE_NAME = "idrop.properties"; - public static final String FORCE_MODE = "force.mode"; - public static final String FORCE_NO_SYNCH = "force.no.synch"; - public static final String LOGIN_PRESET = "login.preset"; - public static final String SHOW_STARTUP = "show.startup"; - public static final String SHOW_GUI = "idrop.show.gui"; - public static final String DEVICE_NAME = "idrop.device.name"; - // account info for cache - public static final String ACCOUNT_CACHE_HOST = "irods.account.host"; - public static final String ACCOUNT_CACHE_PORT = "irods.account.port"; - public static final String ACCOUNT_CACHE_ZONE = "irods.account.zone"; - public static final String ACCOUNT_CACHE_RESOURCE = "irods.account.resource"; - public static final String ACCOUNT_CACHE_USER_NAME = "irods.account.user"; - public static final String ACCOUNT_CACHE_ROOT_DIR = "irods.account.root.dir"; - public static final String ACCOUNT_CACHE_LOGIN_MODE = "irods.account.login.mode"; - public static final String POLICY_AWARE_PROPERTY = "policy.aware"; - public static final String LOOK_AND_FEEL = "idrop.lookandfeel"; - public static final String TRANSFER_ENGINE_RECORD_SUCCESSFUL_FILES = "transferengine.record.successful.files"; - public static final String VERIFY_CHECKSUM_ON_TRANSFER = "transfer.computeandvalidate.checksum"; - public static final String ALLOW_CONNECTION_REROUTING = "transfer.allow.redirects"; - public static final String INTRA_FILE_STATUS_CALLBACKS = "transfer.intra.file.callbacks"; - public static final String IRODS_CONNECTION_TIMEOUT = "socket.timeout"; - public static final String IRODS_PARALLEL_CONNECTION_TIMEOUT = "parallel.socket.timeout"; - public static final String IRODS_PARALLEL_CONNECTION_MAX_THREADS = "transfer.max.parallel.threads"; - public static final String IRODS_PARALLEL_USE_PARALLEL = "transfer.use.parallel"; - public static final String IRODS_PARALLEL_USE_NIO = "transfer.use.nio.for.parallel"; - public static final String IRODS_PARALLEL_USE_POOL = "transfer.use.pool"; - public static final String IRODS_IO_INTERNAL_INPUT_STREAM_BUFFER_SIZE = "jargon.io.internal.input.stream.buffer.size"; - public static final String IRODS_IO_INTERNAL_OUTPUT_STREAM_BUFFER_SIZE = "jargon.io.internal.output.stream.buffer.size"; - public static final String IRODS_IO_INTERNAL_CACHE_BUFFER_SIZE = "jargon.io.internal.cache.buffer.size"; - public static final String IRODS_IO_SEND_INPUT_STREAM_BUFFER_SIZE = "jargon.io.send.input.stream.buffer.size"; - public static final String IRODS_IO_INPUT_TO_OUTPUT_COPY_BUFFER_SIZE = "jargon.io.input.to.output.copy.byte.buffer.size"; - public static final String IRODS_IO_LOCAL_INPUT_STREAM_BUFFER_SIZE = "jargon.io.local.input.stream.buffer.size"; - public static final String IRODS_IO_LOCAL_OUTPUT_STREAM_BUFFER_SIZE = "jargon.io.local.output.stream.buffer.size"; - public static final String IRODS_IO_PUT_BUFFER_SIZE = "jargon.put.buffer.size"; - public static final String IRODS_IO_GET_BUFFER_SIZE = "jargon.get.buffer.size"; - public static final String IRODS_CONNECTION_RESTART = "transfer.reconnect"; - public static final String IDROP_ENABLE_RESC_EDIT = "idrop.settings.enable_default_resc_edit"; - - Properties bootstrapConfigurationAndMergePropertiesFromLocalAndClasspath() - throws IdropException; - - /** - * Save the database configuration information to a properties file - * - * @throws IdropException - */ - void saveConfigurationToPropertiesFile() throws IdropException; - - /** - * Update the configuration database, and update the cached configs, with - * the given information - * - * @param key - * @param value - * @throws IdropException - */ - void updateConfig(final String key, final String value) - throws IdropException; - - /** - * Save a given iRODS account as a cached last login in the configuration - * database - * - * @param irodsAccount - * {@link IRODSAccount} to be cached - * @throws IdropException - */ - void saveLogin(final IRODSAccount irodsAccount) throws IdropException; - - void removeConfigProperty(final String key) throws IdropException; - - /** - * Create a new synchronization configuration, checking for conflicts and - * properly configuring both local and iRODS configuration - * - * @param synchConfiguration - * {@link Synchronization} - * @throws IdropException - * @throws ConflictingSynchException - */ - void createNewSynchronization(final Synchronization synchConfiguration) - throws IdropException, ConflictingSynchException; - - void updateSynchronization(final Synchronization synchConfiguration) - throws IdropException, ConflictingSynchException; - - /** - * Cause the transfer options using in the transfer engine to be updated - * - * @throws JargonException - */ - void updateTransferOptions() throws JargonException; - - void updateJargonPropertiesBasedOnIDROPConfig() throws JargonException; - - void pushIDROPConfigToJargonAndTransfer() throws IdropException; - - /** - * Set the idrop configuration to values defined in the jargon properties - * file in the classpath. These should contain (hopefully) sensible defaults - * - * @param jargonProperties - * @throws JargonException - */ - void restoreIDROPConfigFromJargonProperties( - final JargonProperties jargonProperties) throws JargonException; +public interface IdropConfigurationService { + + public static final String IDROP_VERSION_FILE_NAME = ".idropVersion"; + + public static final String VERSION_3_1 = "3.1.0.0"; + + public static final String VERSION_NUMBER = "idrop.version"; + public static final String IDROP_PROPS_FILE_NAME = "idrop.properties"; + public static final String FORCE_MODE = "force.mode"; + public static final String FORCE_NO_SYNCH = "force.no.synch"; + public static final String LOGIN_PRESET = "login.preset"; + public static final String SHOW_STARTUP = "show.startup"; + public static final String SHOW_GUI = "idrop.show.gui"; + public static final String DEVICE_NAME = "idrop.device.name"; + // account info for cache + public static final String ACCOUNT_CACHE_HOST = "irods.account.host"; + public static final String ACCOUNT_CACHE_PORT = "irods.account.port"; + public static final String ACCOUNT_CACHE_ZONE = "irods.account.zone"; + public static final String ACCOUNT_CACHE_RESOURCE = "irods.account.resource"; + public static final String ACCOUNT_CACHE_USER_NAME = "irods.account.user"; + public static final String ACCOUNT_CACHE_ROOT_DIR = "irods.account.root.dir"; + public static final String ACCOUNT_CACHE_LOGIN_MODE = "irods.account.login.mode"; + public static final String POLICY_AWARE_PROPERTY = "policy.aware"; + public static final String LOOK_AND_FEEL = "idrop.lookandfeel"; + public static final String TRANSFER_ENGINE_RECORD_SUCCESSFUL_FILES = "transferengine.record.successful.files"; + public static final String VERIFY_CHECKSUM_ON_TRANSFER = "transfer.computeandvalidate.checksum"; + public static final String ALLOW_CONNECTION_REROUTING = "transfer.allow.redirects"; + public static final String INTRA_FILE_STATUS_CALLBACKS = "transfer.intra.file.callbacks"; + public static final String IRODS_CONNECTION_TIMEOUT = "socket.timeout"; + public static final String IRODS_PARALLEL_CONNECTION_TIMEOUT = "parallel.socket.timeout"; + public static final String IRODS_PARALLEL_CONNECTION_MAX_THREADS = "transfer.max.parallel.threads"; + public static final String IRODS_PARALLEL_USE_PARALLEL = "transfer.use.parallel"; + public static final String IRODS_PARALLEL_USE_NIO = "transfer.use.nio.for.parallel"; + public static final String IRODS_PARALLEL_USE_POOL = "transfer.use.pool"; + public static final String IRODS_IO_INTERNAL_INPUT_STREAM_BUFFER_SIZE = "jargon.io.internal.input.stream.buffer.size"; + public static final String IRODS_IO_INTERNAL_OUTPUT_STREAM_BUFFER_SIZE = "jargon.io.internal.output.stream.buffer.size"; + public static final String IRODS_IO_INTERNAL_CACHE_BUFFER_SIZE = "jargon.io.internal.cache.buffer.size"; + public static final String IRODS_IO_SEND_INPUT_STREAM_BUFFER_SIZE = "jargon.io.send.input.stream.buffer.size"; + public static final String IRODS_IO_INPUT_TO_OUTPUT_COPY_BUFFER_SIZE = "jargon.io.input.to.output.copy.byte.buffer.size"; + public static final String IRODS_IO_LOCAL_INPUT_STREAM_BUFFER_SIZE = "jargon.io.local.input.stream.buffer.size"; + public static final String IRODS_IO_LOCAL_OUTPUT_STREAM_BUFFER_SIZE = "jargon.io.local.output.stream.buffer.size"; + public static final String IRODS_IO_PUT_BUFFER_SIZE = "jargon.put.buffer.size"; + public static final String IRODS_IO_GET_BUFFER_SIZE = "jargon.get.buffer.size"; + public static final String IRODS_CONNECTION_RESTART = "transfer.reconnect"; + public static final String IDROP_ENABLE_RESC_EDIT = "idrop.settings.enable_default_resc_edit"; + public static final String IDROP_PUBLIC_LINK_SERVICE = "idrop.public.link.service.url"; + + Properties bootstrapConfigurationAndMergePropertiesFromLocalAndClasspath() throws IdropException; + + /** + * Save the database configuration information to a properties file + * + * @throws IdropException + */ + void saveConfigurationToPropertiesFile() throws IdropException; + + /** + * Update the configuration database, and update the cached configs, with the given information + * @param key + * @param value + * @throws IdropException + */ + void updateConfig(final String key, final String value) throws IdropException; + + /** + * Save a given iRODS account as a cached last login in the configuration database + * @param irodsAccount {@link IRODSAccount} to be cached + * @throws IdropException + */ + void saveLogin(final IRODSAccount irodsAccount) throws IdropException; + + void removeConfigProperty(final String key) throws IdropException; + + /** + * Create a new synchronization configuration, checking for conflicts and properly configuring both local and iRODS configuration + * @param synchConfiguration {@link Synchronization} + * @throws IdropException + * @throws ConflictingSynchException + */ + void createNewSynchronization(final Synchronization synchConfiguration) throws IdropException, ConflictingSynchException; + + void updateSynchronization(final Synchronization synchConfiguration) throws IdropException, ConflictingSynchException; + + /** + * Cause the transfer options using in the transfer engine to be updated + * @throws JargonException + */ + void updateTransferOptions() throws JargonException; + + void updateJargonPropertiesBasedOnIDROPConfig() throws JargonException; + + void pushIDROPConfigToJargonAndTransfer() throws IdropException; + + /** + * Set the idrop configuration to values defined in the jargon properties file in the classpath. These should contain + * (hopefully) sensible defaults + * @param jargonProperties + * @throws JargonException + */ + void restoreIDROPConfigFromJargonProperties(final JargonProperties jargonProperties) throws JargonException; + } diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java index 2663d32..89aa42e 100644 --- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java +++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java @@ -7,498 +7,489 @@ import org.apache.log4j.Level; import org.apache.log4j.PatternLayout; import org.apache.log4j.RollingFileAppender; import org.irods.jargon.core.connection.IRODSCommands; -import org.irods.jargon.core.connection.IRODSConnection; import org.irods.jargon.idrop.desktop.systraygui.services.IdropConfigurationService; /** - * Access data about the configuration of Idrop. This serves as a view to the - * loaded cache of properties that iDrop consults. The properties are originally - * 'bootstrapped' at load time and resolved from various sources to come up with - * the operative set. This bootstrapping is done by the - * {@link IdropConfigurationService}. + * Access data about the configuration of Idrop. This serves as a view to the loaded cache of + * properties that iDrop consults. The properties are originally 'bootstrapped' at load time and + * resolved from various sources to come up with the operative set. This bootstrapping is done by + * the {@link IdropConfigurationService}. * <p/> - * In normal operation, this config class is queried by iDrop to save database - * accesses. When any configuration information is updated, this is through the - * <code>IdropConfigurationService</code>, which will make necessary database - * updates, and then update this cache. - * + * In normal operation, this config class is queried by iDrop to save database accesses. When any + * configuration information is updated, this is through the + * <code>IdropConfigurationService</code>, which will make necessary database updates, and then + * update this cache. + * * @author Mike Conway - DICE (www.irods.org) */ public class IdropConfig { - private final Properties idropProperties; - - /** - * Given a key, get the value in the cached properties (this is not going - * against the config database) - * - * @param propKey - * <code>String</code> with the key of the property - * @return <code>String</code> with the resulting value, or - * <code>null</code> if not found - */ - public String getPropertyForKey(final String propKey) { - return idropProperties.getProperty(propKey); - } - - /** - * General method to set a property in the cached properties (this does not - * update the config database) - * - * @param propKey - * <code>String</code> with the name of the property, cannot be - * null - * @param propValue - * <code>String</code> with the value of the property, can be - * null - */ - public void setProperty(final String propKey, final String propValue) { - if (propKey == null) { - throw new IllegalArgumentException("null propKey"); - } - idropProperties.put(propKey, propValue); - } - - public Properties getIdropProperties() { - return idropProperties; - } - - /** - * Initialize this wrapper around properties with the - * <code>Properties</code> that represent the idrop configuration. - * - * @param properties - */ - public IdropConfig(final Properties properties) { - if (properties == null) { - throw new IllegalArgumentException("null properties"); - } - idropProperties = properties; - } - - /** - * Does iDrop need to display policy-aware features? - * - * @return <code>boolean</code> that will be <code>true</code> if policy - * features are displayed. - */ - public boolean isPolicyAware() { - boolean policyAware = false; - String policyAwareValue = idropProperties - .getProperty(IdropConfigurationService.POLICY_AWARE_PROPERTY); - - if (policyAwareValue != null && policyAwareValue.equals("true")) { - policyAware = true; - } - - return policyAware; - - } - - /** - * Does iDrop need to display advanced options? Otherwise, a simpler client - * is presented - * - * @return <code>boolean</code> that will be <code>true</code> if policy - * features are displayed. - */ - public boolean isAdvancedView() { - boolean advancedView = false; - String propValue = idropProperties - .getProperty(IdropPropertiesHelper.ADVANCED_VIEW_PROPERTY); - - if (propValue != null && propValue.equals("true")) { - advancedView = true; - } - - return advancedView; - - } - - public String getTransferDatabaseName() { - String propValue = idropProperties - .getProperty(IdropPropertiesHelper.TRANSFER_DATABASE_NAME); - - if (propValue != null) { - return propValue; - } else { - return "transferDatabase"; - } - } - - /** - * Should iDrop display a preset login limited to a user's home directory? - * - * @return - */ - public boolean isLoginPreset() { - boolean loginPreset = false; - String loginPresetValue = idropProperties - .getProperty(IdropPropertiesHelper.LOGIN_PRESET); - - if (loginPresetValue != null && loginPresetValue.equals("true")) { - loginPreset = true; - } - - return loginPreset; - } - - /** - * Should successful transfers be logged to the internal database? - * - * @return - */ - public boolean isLogSuccessfulTransfers() { - boolean logSuccessful = false; - String logSuccessfulTransfers = idropProperties - .getProperty(IdropConfigurationService.TRANSFER_ENGINE_RECORD_SUCCESSFUL_FILES); - - if (logSuccessfulTransfers != null - && logSuccessfulTransfers.equals("true")) { - logSuccessful = true; - } - - return logSuccessful; - } - - /** - * Should a checksum be created and verifed during get/put transfers? - * - * @return - */ - public boolean isVerifyChecksum() { - boolean verify = false; - String verifyChecksumValue = idropProperties - .getProperty(IdropConfigurationService.VERIFY_CHECKSUM_ON_TRANSFER); - - if (verifyChecksumValue != null && verifyChecksumValue.equals("true")) { - verify = true; - } - - return verify; - } - - /** - * Should connections be re-routed on put/get based on file resource - * containing files - * - * @return - */ - public boolean isAllowConnectionRerouting() { - boolean bool = false; - String val = idropProperties - .getProperty(IdropConfigurationService.ALLOW_CONNECTION_REROUTING); - - if (val != null && val.equals("true")) { - bool = true; - } - return bool; - } - - /** - * Should transfer progress within a file be shown? - * - * @return <code>boolean</code> that will be <code>true</code> if intra-file - * call-backs are desired. - */ - public boolean isIntraFileStatusCallbacks() { - return getBooleanForKey(IdropConfigurationService.INTRA_FILE_STATUS_CALLBACKS); - } - - /** - * Time-out (in seconds) for the main iRODS connection. This can be set to 0 - * or less to inactivate - * - * @return - */ - public int getIrodsConnectionTimeout() { - return getIntForKey(IdropConfigurationService.IRODS_CONNECTION_TIMEOUT); - } - - /** - * Time-out (in seconds) for iRODS connections during parallel transfer. - * This can be set to 0 or less to inactivate - * - * @return - */ - public int getIrodsParallelConnectionTimeout() { - return getIntForKey(IdropConfigurationService.IRODS_PARALLEL_CONNECTION_TIMEOUT); - } - - /** - * Maximum number of threads in parallel transfers. This is a trade-off in - * performance and through-put - * - * @return - */ - public int getIrodsParallelTransferMaxThreads() { - return getIntForKey(IdropConfigurationService.IRODS_PARALLEL_CONNECTION_MAX_THREADS); - } - - /** - * Indicates whether a pool is used to maintain parallel transfer threads - * - * @return - */ - public boolean isParallelUsePool() { - return getBooleanForKey(IdropConfigurationService.IRODS_PARALLEL_USE_POOL); - } - - /** - * Do I use parallel transfers at all? - * - * @return - */ - public boolean isUseParallelTransfers() { - return getBooleanForKey(IdropConfigurationService.IRODS_PARALLEL_USE_PARALLEL); - } - - public boolean isUseNIOForParallelTransfers() { - return getBooleanForKey(IdropConfigurationService.IRODS_PARALLEL_USE_NIO); - } - - /** - * Get the internal buffer size used for the input stream between Jargon and - * iRODS. See https://code.renci.org/gf/project/jargon/wiki/?pagename= - * NormalIOArrangement return <code>int</code> with the buffer size for the - * input stream buffer. (0 = use defaults, -1 = do not wrap with buffered - * input stream) jargon.io.internal.input.stream.buffer.size - */ - public int getInternalInputStreamBufferSize() { - return getIntForKey(IdropConfigurationService.IRODS_IO_INTERNAL_INPUT_STREAM_BUFFER_SIZE); - } - - /** - * Get the internal buffer size used for the output stream between Jargon - * and iRODS. See https://code.renci.org/gf/project/jargon/wiki/?pagename= - * NormalIOArrangement return <code>int</code> with the buffer size for the - * output stream buffer. (0 = use defaults, -1 = do not wrap with buffered - * input stream) jargon.io.internal.output.stream.buffer.size - */ - public int getInternalOutputStreamBufferSize() { - return getIntForKey(IdropConfigurationService.IRODS_IO_INTERNAL_OUTPUT_STREAM_BUFFER_SIZE); - } - - /** - * Get the size of the internal buffer cache . See - * https://code.renci.org/gf/ - * project/jargon/wiki/?pagename=NormalIOArrangement. Jargon has an internal - * buffer where the various <code>send()</code> methods in - * {@link IRODSConnection} write data to iRODS. In these methods, Jargon - * uses an internal cache buffer for the sends. This has been done - * historically, but the benefits of this cache have not yet been measured. - * Setting this as a parameter to turn off will assist in testing the use of - * the buffer, and the option of eliminating the buffer altogether. return - * <code>int</code> with the size of the internal cache (0 = do not utilize - * the cache buffer) jargon.io.internal.cache.buffer.size - */ - public int getInternalCacheBufferSize() { - return getIntForKey(IdropConfigurationService.IRODS_IO_INTERNAL_CACHE_BUFFER_SIZE); - } - - /** - * Get the buffer size used for the input stream between Jargon and iRODS - * passed to the <code>send()</code> method of {@link IRODSConnection}. This - * input stream would typically be from a local file that was being sent to - * iRODS, or other such source. The {@link IRODSCommands} object, using the - * <code>irodsFunction</code> method with the <code>InputStream</code> - * parameter, will wrap the given input stream in a - * <code>BufferedInputStream</code> based on the setting of this parameter. - * - * See https://code.renci.org/gf/project/jargon/wiki/?pagename= - * NormalIOArrangement return <code>int</code> with the buffer size for the - * buffered stream that will wrap an <code>InputStream</code> to be sent to - * iRODS. (0 = use defaults, -1 = do not wrap with buffered input stream) - * jargon.io.send.input.stream.buffer.size - */ - public int getSendInputStreamBufferSize() { - return getIntForKey(IdropConfigurationService.IRODS_IO_SEND_INPUT_STREAM_BUFFER_SIZE); - } - - /** - * Get the size of the buffer used in read/write operations to copy data - * from an input stream to output stream in the {@link IRODSConnection} - * class <code>send()</code> methods. - * - * @return <code>int</code> with the size of the read/write loop buffer - * jargon.io.input.to.output.copy.byte.buffer.size - */ - public int getInputToOutputCopyBufferByteSize() { - return getIntForKey(IdropConfigurationService.IRODS_IO_INPUT_TO_OUTPUT_COPY_BUFFER_SIZE); - } - - /** - * Get the size of the buffer used in a <code>BufferedOutputStream</code> - * that wraps the output stream for the local file. This is used in - * processing get operations where the iRODS data is being saved to the - * local file system. (0 = use defaults, -1 = do not wrap with buffered - * output stream) jargon.io.local.output.stream.buffer.size - * - * @return <code>int</code> with the buffer size - */ - public int getLocalFileOutputStreamBufferSize() { - return getIntForKey(IdropConfigurationService.IRODS_IO_LOCAL_OUTPUT_STREAM_BUFFER_SIZE); - } - - /** - * Get the size of the buffer used in a <code>BufferedInputStream</code> - * that wraps the intput stream for the local file. This is used in - * processing operations where the data is being read from the local file - * system. (0 = use defaults, -1 = do not wrap with buffered output stream) - * jargon.io.local.input.stream.buffer.size - * - * @return <code>int</code> with the buffer size - */ - public int getLocalFileInputStreamBufferSize() { - return getIntForKey(IdropConfigurationService.IRODS_IO_LOCAL_INPUT_STREAM_BUFFER_SIZE); - } - - /** - * Get the size of the file segment for each successive call in normal put - * operations. - * - * @return - */ - public int getPutBufferSize() { - return getIntForKey(IdropConfigurationService.IRODS_IO_PUT_BUFFER_SIZE); - } - - /** - * Get the size of the file segment for each successive call in normal get - * operations. - * - * @return <code>int</code> with buffer size - */ - public int getGetBufferSize() { - return getIntForKey(IdropConfigurationService.IRODS_IO_GET_BUFFER_SIZE); - } - - /** - * Get the configured synch device name. If not set, this will return a - * <code>null</code> - * - * @return - */ - public String getSynchDeviceName() { - return idropProperties - .getProperty(IdropConfigurationService.DEVICE_NAME); - } - - /** - * Should the startup wizard be shown - * - * @return - */ - public boolean isShowStartupWizard() { - boolean showWizard = false; - String showStartup = idropProperties - .getProperty(IdropConfigurationService.SHOW_STARTUP); - - if (showStartup != null && showStartup.equals("true")) { - showWizard = true; - } - - return showWizard; - - } - - /** - * Should I have a rolling log in the user dir? Will return null of no - * logging desired, otherwise, will return a log level - * - * @return - */ - public String getLogLevelForRollingLog() { - String propValue = idropProperties - .getProperty(IdropPropertiesHelper.ROLLING_LOG_LEVEL); - return propValue; - - } - - public void setUpLogging() { - String rollingLogLevel = getLogLevelForRollingLog(); - - if (rollingLogLevel == null) { - return; - } - - // log level is specified, set up a rolling logger - - String userHomeDirectory = System.getProperty("user.home"); - StringBuilder sb = new StringBuilder(); - sb.append(userHomeDirectory); - sb.append("/.idrop/idrop.log"); - - org.apache.log4j.Logger rootLogger = org.apache.log4j.Logger - .getRootLogger(); - if (rollingLogLevel.equalsIgnoreCase("INFO")) { - rootLogger.setLevel(Level.INFO); - } else if (rollingLogLevel.equalsIgnoreCase("DEBUG")) { - rootLogger.setLevel(Level.DEBUG); - } else if (rollingLogLevel.equalsIgnoreCase("WARN")) { - rootLogger.setLevel(Level.WARN); - } else { - rootLogger.setLevel(Level.ERROR); - } - - PatternLayout layout = new PatternLayout( - "%d %-4r [%t] %-5p %c %x - %m%n"); - - try { - RollingFileAppender rfa = new RollingFileAppender(layout, - sb.toString()); - rfa.setMaximumFileSize(1000000); - rootLogger.addAppender(rfa); - } catch (IOException e) { - // e.printStackTrace(); - } - - } - - public boolean isShowGuiAtStartup() { - boolean propBoolean = false; - String propString = idropProperties - .getProperty(IdropConfigurationService.SHOW_GUI); - - if (propString != null && propString.equals("true")) { - propBoolean = true; - } - - return propBoolean; - } - - private boolean getBooleanForKey(final String key) { - boolean propBoolean = false; - String propString = idropProperties.getProperty(key); - - if (propString != null && propString.equals("true")) { - propBoolean = true; - } - return propBoolean; - } - - private int getIntForKey(final String key) { - int propInt = -1; - String propString = idropProperties.getProperty(key); - - if (propString == null) { - return propInt; - } - - propInt = Integer.parseInt(propString.trim()); - - return propInt; - } - - public boolean isConnectionRestart() { - boolean propBoolean = false; - String propString = idropProperties - .getProperty(IdropConfigurationService.IRODS_CONNECTION_RESTART); - - if (propString != null && propString.equals("true")) { - propBoolean = true; - } - - return propBoolean; - } + private final Properties idropProperties; + + /** + * Given a key, get the value in the cached properties (this is not going against the config + * database) + * + * @param propKey + * <code>String</code> with the key of the property + * @return + * <code>String</code> with the resulting value, or + * <code>null</code> if not found + */ + public String getPropertyForKey(final String propKey) { + return idropProperties.getProperty(propKey); + } + + /** + * General method to set a property in the cached properties (this does not update the config + * database) + * + * @param propKey + * <code>String</code> with the name of the property, cannot be null + * @param propValue + * <code>String</code> with the value of the property, can be null + */ + public void setProperty(final String propKey, final String propValue) { + if (propKey == null) { + throw new IllegalArgumentException("null propKey"); + } + idropProperties.put(propKey, propValue); + } + + public Properties getIdropProperties() { + return idropProperties; + } + + /** + * Initialize this wrapper around properties with the + * <code>Properties</code> that represent the idrop configuration. + * + * @param properties + */ + public IdropConfig(final Properties properties) { + if (properties == null) { + throw new IllegalArgumentException("null properties"); + } + this.idropProperties = properties; + } + + /** + * Does iDrop need to display policy-aware features? + * + * @return + * <code>boolean</code> that will be + * <code>true</code> if policy features are displayed. + */ + public boolean isPolicyAware() { + boolean policyAware = false; + String policyAwareValue = idropProperties.getProperty(IdropConfigurationService.POLICY_AWARE_PROPERTY); + + if (policyAwareValue != null && policyAwareValue.equals("true")) { + policyAware = true; + } + + return policyAware; + + } + + /** + * Does iDrop need to display advanced options? Otherwise, a simpler client is presented + * + * @return + * <code>boolean</code> that will be + * <code>true</code> if policy features are displayed. + */ + public boolean isAdvancedView() { + boolean advancedView = false; + String propValue = idropProperties.getProperty(IdropPropertiesHelper.ADVANCED_VIEW_PROPERTY); + + if (propValue != null && propValue.equals("true")) { + advancedView = true; + } + + return advancedView; + + } + + public String getTransferDatabaseName() { + String propValue = idropProperties.getProperty(IdropPropertiesHelper.TRANSFER_DATABASE_NAME); + + if (propValue != null) { + return propValue; + } else { + return "transferDatabase"; + } + } + + /** + * Should iDrop display a preset login limited to a user's home directory? + * + * @return + */ + public boolean isLoginPreset() { + boolean loginPreset = false; + String loginPresetValue = idropProperties.getProperty(IdropPropertiesHelper.LOGIN_PRESET); + + if (loginPresetValue != null && loginPresetValue.equals("true")) { + loginPreset = true; + } + + return loginPreset; + } + + /** + * Should successful transfers be logged to the internal database? + * + * @return + */ + public boolean isLogSuccessfulTransfers() { + boolean logSuccessful = false; + String logSuccessfulTransfers = idropProperties.getProperty(IdropConfigurationService.TRANSFER_ENGINE_RECORD_SUCCESSFUL_FILES); + + if (logSuccessfulTransfers != null + && logSuccessfulTransfers.equals("true")) { + logSuccessful = true; + } + + return logSuccessful; + } + + /** + * Should a checksum be created and verifed during get/put transfers? + * + * @return + */ + public boolean isVerifyChecksum() { + boolean verify = false; + String verifyChecksumValue = idropProperties.getProperty(IdropConfigurationService.VERIFY_CHECKSUM_ON_TRANSFER); + + if (verifyChecksumValue != null + && verifyChecksumValue.equals("true")) { + verify = true; + } + + return verify; + } + + /** + * Should connections be re-routed on put/get based on file resource containing files + * + * @return + */ + public boolean isAllowConnectionRerouting() { + boolean bool = false; + String val = idropProperties.getProperty(IdropConfigurationService.ALLOW_CONNECTION_REROUTING); + + if (val != null + && val.equals("true")) { + bool = true; + } + return bool; + } + + /** + * Should transfer progress within a file be shown? + * + * @return + * <code>boolean</code> that will be + * <code>true</code> if intra-file call-backs are desired. + */ + public boolean isIntraFileStatusCallbacks() { + return getBooleanForKey(IdropConfigurationService.INTRA_FILE_STATUS_CALLBACKS); + } + + /** + * Time-out (in seconds) for the main iRODS connection. This can be set to 0 or less to + * inactivate + * + * @return + */ + public int getIrodsConnectionTimeout() { + return getIntForKey(IdropConfigurationService.IRODS_CONNECTION_TIMEOUT); + } + + /** + * Time-out (in seconds) for iRODS connections during parallel transfer. This can be set to 0 or + * less to inactivate + * + * @return + */ + public int getIrodsParallelConnectionTimeout() { + return getIntForKey(IdropConfigurationService.IRODS_PARALLEL_CONNECTION_TIMEOUT); + } + + /** + * Maximum number of threads in parallel transfers. This is a trade-off in performance and + * through-put + * + * @return + */ + public int getIrodsParallelTransferMaxThreads() { + return getIntForKey(IdropConfigurationService.IRODS_PARALLEL_CONNECTION_MAX_THREADS); + } + + /** + * Indicates whether a pool is used to maintain parallel transfer threads + * + * @return + */ + public boolean isParallelUsePool() { + return getBooleanForKey(IdropConfigurationService.IRODS_PARALLEL_USE_POOL); + } + + /** + * Do I use parallel transfers at all? + * @return + */ + public boolean isUseParallelTransfers() { + return getBooleanForKey(IdropConfigurationService.IRODS_PARALLEL_USE_PARALLEL); + } + + public boolean isUseNIOForParallelTransfers() { + return getBooleanForKey(IdropConfigurationService.IRODS_PARALLEL_USE_NIO); + } + + /** + * Get the internal buffer size used for the input stream between Jargon and iRODS. See + * https://code.renci.org/gf/project/jargon/wiki/?pagename= NormalIOArrangement return + * <code>int</code> with the buffer size for the input stream buffer. (0 = use defaults, -1 = do + * not wrap with buffered input stream) jargon.io.internal.input.stream.buffer.size + */ + public int getInternalInputStreamBufferSize() { + return getIntForKey(IdropConfigurationService.IRODS_IO_INTERNAL_INPUT_STREAM_BUFFER_SIZE); + } + + /** + * Get the internal buffer size used for the output stream between Jargon and iRODS. See + * https://code.renci.org/gf/project/jargon/wiki/?pagename= NormalIOArrangement return + * <code>int</code> with the buffer size for the output stream buffer. (0 = use defaults, -1 = + * do not wrap with buffered input stream) jargon.io.internal.output.stream.buffer.size + */ + public int getInternalOutputStreamBufferSize() { + return getIntForKey(IdropConfigurationService.IRODS_IO_INTERNAL_OUTPUT_STREAM_BUFFER_SIZE); + } + + /** + * Get the size of the internal buffer cache . See https://code.renci.org/gf/ + * project/jargon/wiki/?pagename=NormalIOArrangement. Jargon has an internal buffer where the + * various + * <code>send()</code> methods in + * {@link IRODSConnection} write data to iRODS. In these methods, Jargon uses an internal cache + * buffer for the sends. This has been done historically, but the benefits of this cache have + * not yet been measured. Setting this as a parameter to turn off will assist in testing the use + * of the buffer, and the option of eliminating the buffer altogether. return + * <code>int</code> with the size of the internal cache (0 = do not utilize the cache buffer) + * jargon.io.internal.cache.buffer.size + */ + public int getInternalCacheBufferSize() { + return getIntForKey(IdropConfigurationService.IRODS_IO_INTERNAL_CACHE_BUFFER_SIZE); + } + + /** + * Get the buffer size used for the input stream between Jargon and iRODS passed to the + * <code>send()</code> method of {@link IRODSConnection}. This input stream would typically be + * from a local file that was being sent to iRODS, or other such source. The {@link IRODSCommands} + * object, using the + * <code>irodsFunction</code> method with the + * <code>InputStream</code> parameter, will wrap the given input stream in a + * <code>BufferedInputStream</code> based on the setting of this parameter. + * + * See https://code.renci.org/gf/project/jargon/wiki/?pagename= NormalIOArrangement return + * <code>int</code> with the buffer size for the buffered stream that will wrap an + * <code>InputStream</code> to be sent to iRODS. (0 = use defaults, -1 = do not wrap with + * buffered input stream) jargon.io.send.input.stream.buffer.size + */ + public int getSendInputStreamBufferSize() { + return getIntForKey(IdropConfigurationService.IRODS_IO_SEND_INPUT_STREAM_BUFFER_SIZE); + } + + /** + * Get the size of the buffer used in read/write operations to copy data from an input stream to + * output stream in the {@link IRODSConnection} class + * <code>send()</code> methods. + * + * @return + * <code>int</code> with the size of the read/write loop buffer + * jargon.io.input.to.output.copy.byte.buffer.size + */ + public int getInputToOutputCopyBufferByteSize() { + return getIntForKey(IdropConfigurationService.IRODS_IO_INPUT_TO_OUTPUT_COPY_BUFFER_SIZE); + } + + /** + * Get the size of the buffer used in a + * <code>BufferedOutputStream</code> that wraps the output stream for the local file. This is + * used in processing get operations where the iRODS data is being saved to the local file + * system. (0 = use defaults, -1 = do not wrap with buffered output stream) + * jargon.io.local.output.stream.buffer.size + * + * @return + * <code>int</code> with the buffer size + */ + public int getLocalFileOutputStreamBufferSize() { + return getIntForKey(IdropConfigurationService.IRODS_IO_LOCAL_OUTPUT_STREAM_BUFFER_SIZE); + } + + /** + * Get the size of the buffer used in a + * <code>BufferedInputStream</code> that wraps the intput stream for the local file. This is + * used in processing operations where the data is being read from the local file system. (0 = + * use defaults, -1 = do not wrap with buffered output stream) + * jargon.io.local.input.stream.buffer.size + * + * @return + * <code>int</code> with the buffer size + */ + public int getLocalFileInputStreamBufferSize() { + return getIntForKey(IdropConfigurationService.IRODS_IO_LOCAL_INPUT_STREAM_BUFFER_SIZE); + } + + /** + * Get the size of the file segment for each successive call in normal put operations. + * + * @return + */ + public int getPutBufferSize() { + return getIntForKey(IdropConfigurationService.IRODS_IO_PUT_BUFFER_SIZE); + } + + /** + * Get the size of the file segment for each successive call in normal get operations. + * + * @return + * <code>int</code> with buffer size + */ + public int getGetBufferSize() { + return getIntForKey(IdropConfigurationService.IRODS_IO_GET_BUFFER_SIZE); + } + + /** + * Get the configured synch device name. If not set, this will return a + * <code>null</code> + * + * @return + */ + public String getSynchDeviceName() { + return idropProperties.getProperty(IdropConfigurationService.DEVICE_NAME); + } + + /** + * Should the startup wizard be shown + * + * @return + */ + public boolean isShowStartupWizard() { + boolean showWizard = false; + String showStartup = idropProperties.getProperty(IdropConfigurationService.SHOW_STARTUP); + + if (showStartup != null && showStartup.equals("true")) { + showWizard = true; + } + + return showWizard; + + } + + /** + * Should I have a rolling log in the user dir? Will return null of no logging desired, + * otherwise, will return a log level + * + * @return + */ + public String getLogLevelForRollingLog() { + String propValue = idropProperties.getProperty(IdropPropertiesHelper.ROLLING_LOG_LEVEL); + return propValue; + + } + + public void setUpLogging() { + String rollingLogLevel = getLogLevelForRollingLog(); + + if (rollingLogLevel == null) { + return; + } + + // log level is specified, set up a rolling logger + + String userHomeDirectory = System.getProperty("user.home"); + StringBuilder sb = new StringBuilder(); + sb.append(userHomeDirectory); + sb.append("/.idrop/idrop.log"); + + org.apache.log4j.Logger rootLogger = org.apache.log4j.Logger.getRootLogger(); + if (rollingLogLevel.equalsIgnoreCase("INFO")) { + rootLogger.setLevel(Level.INFO); + } else if (rollingLogLevel.equalsIgnoreCase("DEBUG")) { + rootLogger.setLevel(Level.DEBUG); + } else if (rollingLogLevel.equalsIgnoreCase("WARN")) { + rootLogger.setLevel(Level.WARN); + } else { + rootLogger.setLevel(Level.ERROR); + } + + PatternLayout layout = new PatternLayout( + "%d %-4r [%t] %-5p %c %x - %m%n"); + + try { + RollingFileAppender rfa = new RollingFileAppender(layout, + sb.toString()); + rfa.setMaximumFileSize(1000000); + rootLogger.addAppender(rfa); + } catch (IOException e) { + // e.printStackTrace(); + } + + } + + public boolean isShowGuiAtStartup() { + boolean propBoolean = false; + String propString = idropProperties.getProperty(IdropConfigurationService.SHOW_GUI); + + if (propString != null && propString.equals("true")) { + propBoolean = true; + } + + return propBoolean; + } + + private boolean getBooleanForKey(String key) { + boolean propBoolean = false; + String propString = idropProperties.getProperty(key); + + if (propString != null && propString.equals("true")) { + propBoolean = true; + } + return propBoolean; + } + + private int getIntForKey(String key) { + int propInt = -1; + String propString = idropProperties.getProperty(key); + + if (propString == null) { + return propInt; + } + + + propInt = Integer.parseInt(propString.trim()); + + return propInt; + } + + public boolean isConnectionRestart() { + boolean propBoolean = false; + String propString = idropProperties.getProperty(IdropConfigurationService.IRODS_CONNECTION_RESTART); + + if (propString != null && propString.equals("true")) { + propBoolean = true; + } + + return propBoolean; + } + + public String getPublicLinkServiceUrl(){ + return idropProperties.getProperty(IdropConfigurationService.IDROP_PUBLIC_LINK_SERVICE); + } + + } diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java index c2d1dc7..a8fcf87 100644 --- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java +++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/Version.java @@ -1,5 +1,5 @@ package org.irods.jargon.idrop.desktop.systraygui.utils; public final class Version { public static String VERSION="2.0.1-SNAPSHOT"; - public static String BUILD_TIME="20130605-1641"; + public static String BUILD_TIME="20130806-1316"; } diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSOutlineModel.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSOutlineModel.java index 6a06167..fd89aac 100644 --- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSOutlineModel.java +++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSOutlineModel.java @@ -13,8 +13,10 @@ import javax.swing.tree.TreeModel; import javax.swing.tree.TreePath; import org.irods.jargon.core.exception.JargonException; +import org.irods.jargon.core.pub.IRODSFileSystemAO; import org.irods.jargon.core.pub.io.IRODSFile; import org.irods.jargon.core.pub.io.IRODSFileFactory; +import org.irods.jargon.core.pub.io.IRODSFileImpl; import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry; import org.irods.jargon.core.transfer.TransferStatus; import org.irods.jargon.core.transfer.TransferStatus.TransferState; @@ -31,184 +33,170 @@ import org.slf4j.LoggerFactory; */ public class IRODSOutlineModel extends DefaultOutlineModel { - public static final org.slf4j.Logger log = LoggerFactory - .getLogger(IRODSOutlineModel.class); - private final IRODSFileSystemModel treeModel; - - public IRODSFileSystemModel getTreeModel() { - return treeModel; - } - - private iDrop idrop; - - public IRODSOutlineModel(final iDrop idrop, final TreeModel tm, - final TableModel tm1, final boolean bln, final String string) { - super(tm, tm1, bln, string); - treeModel = (IRODSFileSystemModel) tm; - this.idrop = idrop; - - } - - public IRODSOutlineModel(final iDrop idrop, final TreeModel tm, - final RowModel rm, final boolean bln, final String string) { - super(tm, rm, bln, string); - treeModel = (IRODSFileSystemModel) tm; - - this.idrop = idrop; - } - - public void notifyFileShouldBeRemoved(final IRODSNode deletedNode) - throws IdropException { - - if (deletedNode == null) { - return; - } - log.info("deleting node from parent:{}", deletedNode); - final IRODSNode parent = (IRODSNode) deletedNode.getParent(); - - if (parent == null) { - return; - } - - final IRODSOutlineModel thisModel = this; - - java.awt.EventQueue.invokeLater(new Runnable() { - - @Override - public void run() { - deletedNode.getUserObject(); - CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) (parent) - .getUserObject(); - IRODSTree stagingViewTree = idrop.getIrodsTree(); - try { - TreeUtils.buildTreePathForIrodsAbsolutePath( - stagingViewTree, entry.getFormattedAbsolutePath()); - - } catch (IdropException ex) { - Logger.getLogger(IRODSOutlineModel.class.getName()).log( - Level.SEVERE, null, ex); - throw new IdropRuntimeException(ex); - } - - thisModel.treeModel.removeNodeFromParent(deletedNode); - - } - }); - } - - public void notifyCompletionOfOperation(final IRODSTree irodsTree, - final TransferStatus transferStatus) throws IdropException { - log.info("tree model notified of status:{}", transferStatus); - - if (transferStatus.getTransferState() != TransferState.OVERALL_COMPLETION) { - return; - } - - // for put or copy operation, highlight the new node - if (transferStatus.getTransferType() == TransferStatus.TransferType.PUT - || transferStatus.getTransferType() == TransferStatus.TransferType.COPY) { - log.info("successful put transfer, find the parent tree node, and clear the children"); - notifyFileShouldBeAdded(irodsTree, - transferStatus.getTargetFileAbsolutePath()); - - } - } - - public void notifyFileShouldBeAdded(final IRODSTree irodsTree, - final String irodsFileAbsolutePath) { - log.info("notifyFileShouldBeAdded() for node:{}", irodsFileAbsolutePath); - - java.awt.EventQueue.invokeLater(new Runnable() { - - @Override - public void run() { - - IRODSFileFactory irodsFileFactory = idrop.getiDropCore() - .getIRODSFileFactoryForLoggedInAccount(); - try { - try { - // if the node already exists (e.g. an overwrite, don' - // add it - - TreePath currentPath = TreeUtils - .buildTreePathForIrodsAbsolutePath(irodsTree, - irodsFileAbsolutePath); - // build treePath will return parent if child not found - if (currentPath == null) { - log.warn( - "null tree path found for:{} logged and ignored as a warning", - irodsFileAbsolutePath); - return; - } - IRODSNode irodsNode = (IRODSNode) currentPath - .getLastPathComponent(); - CollectionAndDataObjectListingEntry lastPathNodeEntry = (CollectionAndDataObjectListingEntry) irodsNode - .getUserObject(); - if (irodsFileAbsolutePath.equals(lastPathNodeEntry - .getFormattedAbsolutePath())) { - log.info("path already exists, do not double-add"); - return; - } - - } catch (IdropException ex) { - Logger.getLogger(IRODSOutlineModel.class.getName()) - .log(Level.SEVERE, null, ex); - throw new IdropRuntimeException(ex); - } - - IRODSFile addedFile = irodsFileFactory - .instanceIRODSFile(irodsFileAbsolutePath); - if (!addedFile.exists()) { - log.info( - "looking for file that was added, I don't find it, so just move on: {}", - irodsFileAbsolutePath); - return; - } - TreePath parentPath; - try { - parentPath = TreeUtils - .buildTreePathForIrodsAbsolutePath(irodsTree, - addedFile.getParent()); - } catch (IdropException ex) { - Logger.getLogger(IRODSOutlineModel.class.getName()) - .log(Level.SEVERE, null, ex); - throw new IdropRuntimeException(ex); - } - - if (parentPath == null) { - log.info("null path for lookup, just move on"); - return; - } - log.info("building a new node"); - CollectionAndDataObjectListingEntry newEntry = new CollectionAndDataObjectListingEntry(); - newEntry.setCreatedAt(new Date(addedFile.lastModified())); - newEntry.setDataSize(addedFile.length()); - newEntry.setModifiedAt(new Date(addedFile.lastModified())); - - if (addedFile.isDirectory()) { - newEntry.setObjectType(CollectionAndDataObjectListingEntry.ObjectType.COLLECTION); - newEntry.setParentPath(addedFile.getParent()); - newEntry.setPathOrName(addedFile.getAbsolutePath()); - } else { - newEntry.setObjectType(CollectionAndDataObjectListingEntry.ObjectType.DATA_OBJECT); - newEntry.setParentPath(addedFile.getParent()); - newEntry.setPathOrName(addedFile.getName()); - } - - IRODSNode newNode = new IRODSNode(newEntry, idrop - .getiDropCore().getIrodsAccount(), idrop - .getiDropCore().getIrodsFileSystem(), irodsTree); - ((IRODSNode) parentPath.getLastPathComponent()) - .add(newNode); - irodsTree.highlightPath(parentPath); - } catch (JargonException ex) { - Logger.getLogger(IRODSOutlineModel.class.getName()).log( - Level.SEVERE, null, ex); - } finally { - idrop.getiDropCore() - .closeIRODSConnectionForLoggedInAccount(); - } - } - }); - } + public static final org.slf4j.Logger log = LoggerFactory.getLogger(IRODSOutlineModel.class); + private final IRODSFileSystemModel treeModel; + + public IRODSFileSystemModel getTreeModel() { + return treeModel; + } + private iDrop idrop; + + public IRODSOutlineModel(final iDrop idrop, final TreeModel tm, + final TableModel tm1, final boolean bln, final String string) { + super(tm, tm1, bln, string); + this.treeModel = (IRODSFileSystemModel) tm; + this.idrop = idrop; + + } + + public IRODSOutlineModel(final iDrop idrop, final TreeModel tm, + final RowModel rm, final boolean bln, final String string) { + super(tm, rm, bln, string); + this.treeModel = (IRODSFileSystemModel) tm; + + this.idrop = idrop; + } + + public void notifyFileShouldBeRemoved(final IRODSNode deletedNode) + throws IdropException { + + if (deletedNode == null) { + return; + } + log.info("deleting node from parent:{}", deletedNode); + final IRODSNode parent = (IRODSNode) deletedNode.getParent(); + + if (parent == null) { + return; + } + + final IRODSOutlineModel thisModel = this; + + java.awt.EventQueue.invokeLater(new Runnable() { + + @Override + public void run() { + deletedNode.getUserObject(); + CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) (parent).getUserObject(); + IRODSTree stagingViewTree = idrop.getIrodsTree(); + try { + TreeUtils.buildTreePathForIrodsAbsolutePath( + stagingViewTree, entry.getFormattedAbsolutePath()); + + } catch (IdropException ex) { + Logger.getLogger(IRODSOutlineModel.class.getName()).log( + Level.SEVERE, null, ex); + throw new IdropRuntimeException(ex); + } + + thisModel.treeModel.removeNodeFromParent(deletedNode); + + } + }); + } + + public void notifyCompletionOfOperation(final IRODSTree irodsTree, + final TransferStatus transferStatus) throws IdropException { + log.info("tree model notified of status:{}", transferStatus); + + if (transferStatus.getTransferState() != TransferState.OVERALL_COMPLETION) { + return; + } + + // for put or copy operation, highlight the new node + if (transferStatus.getTransferType() == TransferStatus.TransferType.PUT + || transferStatus.getTransferType() == TransferStatus.TransferType.COPY) { + log.info("successful put transfer, find the parent tree node, and clear the children"); + notifyFileShouldBeAdded(irodsTree, + transferStatus.getTargetFileAbsolutePath()); + + } + } + + public void notifyFileShouldBeAdded(final IRODSTree irodsTree, + final String irodsFileAbsolutePath) { + log.info("notifyFileShouldBeAdded() for node:{}", irodsFileAbsolutePath); + + java.awt.EventQueue.invokeLater(new Runnable() { + + @Override + public void run() { + + IRODSFileFactory irodsFileFactory = idrop.getiDropCore().getIRODSFileFactoryForLoggedInAccount(); + try { + try { + // if the node already exists (e.g. an overwrite, don' + // add it + + TreePath currentPath = TreeUtils.buildTreePathForIrodsAbsolutePath(irodsTree, + irodsFileAbsolutePath); + // build treePath will return parent if child not found + if (currentPath == null) { + log.warn( + "null tree path found for:{} logged and ignored as a warning", + irodsFileAbsolutePath); + return; + } + IRODSNode irodsNode = (IRODSNode) currentPath.getLastPathComponent(); + CollectionAndDataObjectListingEntry lastPathNodeEntry = (CollectionAndDataObjectListingEntry) irodsNode.getUserObject(); + if (irodsFileAbsolutePath.equals(lastPathNodeEntry.getFormattedAbsolutePath())) { + log.info("path already exists, do not double-add"); + return; + } + + } catch (IdropException ex) { + Logger.getLogger(IRODSOutlineModel.class.getName()).log(Level.SEVERE, null, ex); + throw new IdropRuntimeException(ex); + } + + IRODSFile addedFile = irodsFileFactory.instanceIRODSFile(irodsFileAbsolutePath); + if (!addedFile.exists()) { + log.info( + "looking for file that was added, I don't find it, so just move on: {}", + irodsFileAbsolutePath); + return; + } + TreePath parentPath; + try { + parentPath = TreeUtils.buildTreePathForIrodsAbsolutePath(irodsTree, + addedFile.getParent()); + } catch (IdropException ex) { + Logger.getLogger(IRODSOutlineModel.class.getName()).log(Level.SEVERE, null, ex); + throw new IdropRuntimeException(ex); + } + + if (parentPath == null) { + log.info("null path for lookup, just move on"); + return; + } + log.info("building a new node"); + CollectionAndDataObjectListingEntry newEntry = new CollectionAndDataObjectListingEntry(); + newEntry.setCreatedAt(new Date(addedFile.lastModified())); + newEntry.setDataSize(addedFile.length()); + newEntry.setModifiedAt(new Date(addedFile.lastModified())); + + if (addedFile.isDirectory()) { + newEntry.setObjectType(CollectionAndDataObjectListingEntry.ObjectType.COLLECTION); + newEntry.setParentPath(addedFile.getParent()); + newEntry.setPathOrName(addedFile.getAbsolutePath()); + } else { + newEntry.setObjectType(CollectionAndDataObjectListingEntry.ObjectType.DATA_OBJECT); + newEntry.setParentPath(addedFile.getParent()); + newEntry.setPathOrName(addedFile.getName()); + IRODSFileSystemAO ao = idrop.getiDropCore().getIRODSAccessObjectFactory().getIRODSFileSystemAO(idrop.getIrodsAccount()); + newEntry.setOwnerName(ao.getObjStat(addedFile.getAbsolutePath()).getOwnerName()); + } + + IRODSNode newNode = new IRODSNode(newEntry, idrop.getiDropCore().getIrodsAccount(), idrop.getiDropCore().getIrodsFileSystem(), irodsTree); + ((IRODSNode) parentPath.getLastPathComponent()).add(newNode); + irodsTree.highlightPath(parentPath); + } catch (JargonException ex) { + Logger.getLogger(IRODSOutlineModel.class.getName()).log( + Level.SEVERE, null, ex); + } finally { + idrop.getiDropCore().closeIRODSConnectionForLoggedInAccount(); + } + } + }); + } } diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTree.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTree.java index 18dd7c5..5804965 100644 --- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTree.java +++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTree.java @@ -1,18 +1,26 @@ package org.irods.jargon.idrop.desktop.systraygui.viscomponents; -import java.awt.Cursor; +import java.awt.*; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.StringSelection; import java.awt.event.ActionEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URI; +import java.net.URL; import java.util.ArrayList; import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; import java.util.logging.Level; import java.util.logging.Logger; -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.JOptionPane; -import javax.swing.JPopupMenu; +import javax.swing.*; import javax.swing.event.TreeExpansionEvent; import javax.swing.event.TreeExpansionListener; import javax.swing.event.TreeWillExpandListener; @@ -20,391 +28,502 @@ import javax.swing.tree.ExpandVetoException; import javax.swing.tree.TreeModel; import javax.swing.tree.TreePath; +import org.irods.jargon.core.exception.JargonException; +import org.irods.jargon.core.pub.DataObjectAO; +import org.irods.jargon.core.pub.io.IRODSFile; +import org.irods.jargon.core.pub.io.IRODSFileFactory; import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry; +import org.irods.jargon.core.utils.MiscIRODSUtils; import org.irods.jargon.idrop.desktop.systraygui.DeleteIRODSDialog; import org.irods.jargon.idrop.desktop.systraygui.IRODSTreeContainingComponent; import org.irods.jargon.idrop.desktop.systraygui.NewIRODSDirectoryDialog; import org.irods.jargon.idrop.desktop.systraygui.RenameIRODSDirectoryDialog; import org.irods.jargon.idrop.desktop.systraygui.iDrop; +import org.irods.jargon.idrop.desktop.systraygui.services.IdropConfigurationService; import org.irods.jargon.idrop.exceptions.IdropException; import org.irods.jargon.idrop.exceptions.IdropRuntimeException; +import org.irods.jargon.ticket.TicketAdminService; +import org.irods.jargon.ticket.TicketServiceFactory; +import org.irods.jargon.ticket.TicketServiceFactoryImpl; +import org.irods.jargon.ticket.packinstr.TicketCreateModeEnum; import org.netbeans.swing.outline.DefaultOutlineModel; import org.netbeans.swing.outline.Outline; +import org.netbeans.swing.outline.OutlineModel; import org.netbeans.swing.outline.TreePathSupport; import org.slf4j.LoggerFactory; /** * Swing JTree component for viewing iRODS server file system - * + * * @author Mike Conway - DICE (www.irods.org) */ public class IRODSTree extends Outline implements TreeWillExpandListener, - TreeExpansionListener, IRODSTreeContainingComponent { - - /** - * - */ - private static final long serialVersionUID = -7815706939610881953L; - public static org.slf4j.Logger log = LoggerFactory - .getLogger(IRODSTree.class); - protected iDrop idropParentGui = null; - protected JPopupMenu m_popup = null; - protected Action m_action; - protected TreePath m_clickedPath; - protected IRODSTree thisTree; - private boolean refreshingTree = false; - TreePathSupport tps; - - @Override - public boolean isRefreshingTree() { - synchronized (this) { - return refreshingTree; - } - } - - public void setRefreshingTree(final boolean refreshingTree) { - synchronized (this) { - this.refreshingTree = refreshingTree; - } - } - - public IRODSTree(final TreeModel newModel, final iDrop idropParentGui) { - super(); - - DefaultOutlineModel.createOutlineModel(newModel, new IRODSRowModel(), - true, "File System"); - this.idropParentGui = idropParentGui; - - initializeMenusAndListeners(); - } - - public IRODSTree() { - super(); - } - - public IRODSTree(final iDrop idropParentGui) { - super(); - this.idropParentGui = idropParentGui; - initializeMenusAndListeners(); - } - - private void initializeMenusAndListeners() { - tps = new TreePathSupport(getOutlineModel(), getLayoutCache()); - tps.addTreeExpansionListener(this); - tps.addTreeWillExpandListener(this); - setDragEnabled(true); - setTransferHandler(new IRODSTreeTransferHandler(idropParentGui, - "selectionModel")); - setDropMode(javax.swing.DropMode.USE_SELECTION); - setRenderDataProvider(new OutlineRenderProvider(this)); - setUpTreeMenu(); - IrodsSelectionListenerForBuildingInfoPanel treeListener; - try { - treeListener = new IrodsSelectionListenerForBuildingInfoPanel( - idropParentGui); - } catch (IdropException ex) { - Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, - ex); - throw new IdropRuntimeException( - "error initializing selection listener", ex); - } - - getSelectionModel().addListSelectionListener(treeListener); - - /* - * ActionMap map = this.getActionMap(); - * map.put(IRODSTreeTransferHandler. - * getCutAction().getValue(Action.NAME), - * IRODSTreeTransferHandler.getCutAction()); - * map.put(IRODSTreeTransferHandler - * .getCopyAction().getValue(Action.NAME), - * IRODSTreeTransferHandler.getCopyAction()); - * map.put(IRODSTreeTransferHandler - * .getPasteAction().getValue(Action.NAME), - * IRODSTreeTransferHandler.getPasteAction()); - * - * InputMap imap = this.getInputMap(); - * imap.put(KeyStroke.getKeyStroke("ctrl X"), - * TransferHandler.getCutAction().getValue(Action.NAME)); - * imap.put(KeyStroke.getKeyStroke("ctrl C"), - * TransferHandler.getCopyAction().getValue(Action.NAME)); - * imap.put(KeyStroke.getKeyStroke("ctrl V"), - * TransferHandler.getPasteAction().getValue(Action.NAME)); - */ - - } - - /** - * Set up context sensitive tree menu - */ - private void setUpTreeMenu() { - thisTree = this; - m_popup = new JPopupMenu(); - m_action = new AbstractAction() { - - @Override - public void actionPerformed(final ActionEvent e) { - if (m_clickedPath == null) { - return; - } - - if (thisTree.isExpanded(m_clickedPath)) { - thisTree.collapsePath(m_clickedPath); - } else { - thisTree.expandPath(m_clickedPath); - } - } - }; - - m_popup.add(m_action); - - Action newAction = new AbstractAction("New Folder") { - - @Override - public void actionPerformed(final ActionEvent e) { - - log.info("adding new node"); - - IRODSNode parent = (IRODSNode) m_clickedPath - .getLastPathComponent(); - log.info("parent of new node is: {}", parent); - CollectionAndDataObjectListingEntry dataEntry = (CollectionAndDataObjectListingEntry) parent - .getUserObject(); - if (dataEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.DATA_OBJECT) { - JOptionPane - .showMessageDialog( - thisTree, - "The selected item is not a folder, cannot create a new directory", - "Info", JOptionPane.INFORMATION_MESSAGE); - log.info("new folder not created, the selected parent is not a collection"); - return; - } - // show a dialog asking for the new directory name... - NewIRODSDirectoryDialog newDirectoryDialog = new NewIRODSDirectoryDialog( - idropParentGui, true, dataEntry.getPathOrName(), - thisTree, parent); - newDirectoryDialog - .setLocation( - (int) (idropParentGui.getLocation().getX() + idropParentGui - .getWidth() / 2), (int) (idropParentGui - .getLocation().getY() + idropParentGui - .getHeight() / 2)); - newDirectoryDialog.setVisible(true); - } - }; - m_popup.add(newAction); - - m_popup.addSeparator(); - - Action a1 = new AbstractAction("Delete") { - - @Override - public void actionPerformed(final ActionEvent e) { - log.info("deleting a node"); - int[] rows = thisTree.getSelectedRows(); - log.debug("selected rows for delete:{}", rows); - - DeleteIRODSDialog deleteDialog; - - if (rows.length == 1) { - - IRODSNode toDelete = (IRODSNode) thisTree.getValueAt( - rows[0], 0); - log.info("deleting a single node: {}", toDelete); - deleteDialog = new DeleteIRODSDialog(idropParentGui, true, - thisTree, toDelete); - } else { - List<IRODSNode> nodesToDelete = new ArrayList<IRODSNode>(); - for (int row : rows) { - nodesToDelete.add((IRODSNode) thisTree.getValueAt(row, - 0)); - - } - - deleteDialog = new DeleteIRODSDialog(idropParentGui, true, - thisTree, nodesToDelete); - } - - deleteDialog - .setLocation( - (int) (idropParentGui.getLocation().getX() + idropParentGui - .getWidth() / 2), (int) (idropParentGui - .getLocation().getY() + idropParentGui - .getHeight() / 2)); - deleteDialog.setVisible(true); - } - }; - - m_popup.add(a1); - Action a2 = new AbstractAction("Rename") { - - @Override - public void actionPerformed(final ActionEvent e) { - log.info("renaming node"); - - IRODSNode toRename = (IRODSNode) m_clickedPath - .getLastPathComponent(); - log.info("node to rename is: {}", toRename); - CollectionAndDataObjectListingEntry dataEntry = (CollectionAndDataObjectListingEntry) toRename - .getUserObject(); - - // dialog uses absolute path, so munge it for files - StringBuilder sb = new StringBuilder(); - if (dataEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.COLLECTION) { - sb.append(dataEntry.getPathOrName()); - } else { - sb.append(dataEntry.getParentPath()); - sb.append('/'); - sb.append(dataEntry.getPathOrName()); - } - - // show a dialog asking for the new directory name... - RenameIRODSDirectoryDialog renameDialog = new RenameIRODSDirectoryDialog( - idropParentGui, true, sb.toString(), thisTree, toRename); - renameDialog - .setLocation( - (int) (idropParentGui.getLocation().getX() + idropParentGui - .getWidth() / 2), (int) (idropParentGui - .getLocation().getY() + idropParentGui - .getHeight() / 2)); - renameDialog.setVisible(true); - } - }; - m_popup.add(a2); - thisTree.add(m_popup); - thisTree.addMouseListener(new PopupTrigger()); - - } - - @Override - public void treeExpanded(final TreeExpansionEvent event) { - } - - @Override - public void treeCollapsed(final TreeExpansionEvent event) { - } - - class PopupTrigger extends MouseAdapter { - - @Override - public void mouseReleased(final MouseEvent e) { - if (e.isPopupTrigger()) { - int x = e.getX(); - int y = e.getY(); - - TreePath path = thisTree.getClosestPathForLocation(x, y); - if (path != null) { - if (thisTree.isExpanded(path)) { - m_action.putValue(Action.NAME, "Collapse"); - } else { - m_action.putValue(Action.NAME, "Expand"); - } - m_popup.show(thisTree, x, y); - m_clickedPath = path; - } - } else if (e.getClickCount() == 2) { - int x = e.getX(); - int y = e.getY(); - TreePath path = thisTree.getClosestPathForLocation(x, y); - - IRODSNode inode = null; - String fullPath = null; - if (path != null) { - Object node = path.getLastPathComponent(); - if (node instanceof IRODSNode) { - inode = (IRODSNode) node; - CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) inode - .getUserObject(); - fullPath = entry.getPathOrName(); - } - - if (fullPath != null) { - idropParentGui.getiDropCore().setBasePath(fullPath); - idropParentGui.buildTargetTree(false); - } - } - } - } - - @Override - public void mousePressed(final MouseEvent e) { - if (e.isPopupTrigger()) { - int x = e.getX(); - int y = e.getY(); - TreePath path = thisTree.getClosestPathForLocation(x, y); - if (path != null) { - if (thisTree.isExpanded(path)) { - m_action.putValue(Action.NAME, "Collapse"); - } else { - m_action.putValue(Action.NAME, "Expand"); - } - m_popup.show(thisTree, x, y); - m_clickedPath = path; - } - } - } - } - - @Override - public void treeWillCollapse(final TreeExpansionEvent event) - throws ExpandVetoException { - } - - @Override - public void treeWillExpand(final TreeExpansionEvent event) - - // TODO: Need to make this a swing worker?? - throws ExpandVetoException { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - log.debug("tree expansion event:{}", event); - IRODSNode expandingNode = (IRODSNode) event.getPath() - .getLastPathComponent(); - // If I am refreshing the tree, then do not close the connection after - // each load. It will be closed in the thing - // doing the refreshing - try { - expandingNode.lazyLoadOfChildrenOfThisNode(!isRefreshingTree()); - } catch (IdropException ex) { - Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, - ex); - idropParentGui.showIdropException(ex); - throw new IdropRuntimeException("error expanding irodsNode"); - } finally { - setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - } - } - - public void highlightPath(final TreePath pathToHighlight) { - final IRODSTree highlightTree = this; - java.awt.EventQueue.invokeLater(new Runnable() { - - @Override - public void run() { - highlightTree.collapsePath(pathToHighlight); - highlightTree.expandPath(pathToHighlight); - // highlightTree.sc - // highlightTree.scrollPathToVisible(pathToHighlight); - } - }); - } - - // FIXME: move out? - /* - * public class TransferActionListener implements ActionListener, - * PropertyChangeListener { private JComponent focusOwner = null; - * - * public TransferActionListener() { KeyboardFocusManager manager = - * KeyboardFocusManager. getCurrentKeyboardFocusManager(); - * manager.addPropertyChangeListener("permanentFocusOwner", this); } - * - * public void propertyChange(PropertyChangeEvent e) { Object o = - * e.getNewValue(); if (o instanceof JComponent) { focusOwner = - * (JComponent)o; } else { focusOwner = null; } } - * - * public void actionPerformed(ActionEvent e) { if (focusOwner == null) - * return; String action = (String)e.getActionCommand(); Action a = - * focusOwner.getActionMap().get(action); if (a != null) { - * a.actionPerformed(new ActionEvent(focusOwner, - * ActionEvent.ACTION_PERFORMED, null)); } } } - */ + TreeExpansionListener, IRODSTreeContainingComponent { + + public static org.slf4j.Logger log = LoggerFactory.getLogger(IRODSTree.class); + protected iDrop idropParentGui = null; + protected JPopupMenu m_popup = null; + protected Action m_action; + protected Action public_link_action; + protected TreePath m_clickedPath; + protected IRODSTree thisTree; + private boolean refreshingTree = false; + TreePathSupport tps; + + @Override + public boolean isRefreshingTree() { + synchronized (this) { + return refreshingTree; + } + } + + public void setRefreshingTree(final boolean refreshingTree) { + synchronized (this) { + this.refreshingTree = refreshingTree; + } + } + + public IRODSTree(final TreeModel newModel, final iDrop idropParentGui) { + super(); + + OutlineModel mdl = DefaultOutlineModel.createOutlineModel(newModel, + new IRODSRowModel(), true, "File System"); + this.idropParentGui = idropParentGui; + + initializeMenusAndListeners(); + } + + public IRODSTree() { + super(); + } + + public IRODSTree(final iDrop idropParentGui) { + super(); + this.idropParentGui = idropParentGui; + initializeMenusAndListeners(); + } + + private void initializeMenusAndListeners() { + tps = new TreePathSupport(this.getOutlineModel(), this.getLayoutCache()); + tps.addTreeExpansionListener(this); + tps.addTreeWillExpandListener(this); + setDragEnabled(true); + setTransferHandler(new IRODSTreeTransferHandler(idropParentGui, + "selectionModel")); + setDropMode(javax.swing.DropMode.USE_SELECTION); + this.setRenderDataProvider(new OutlineRenderProvider(this)); + setUpTreeMenu(); + IrodsSelectionListenerForBuildingInfoPanel treeListener; + try { + treeListener = new IrodsSelectionListenerForBuildingInfoPanel( + idropParentGui); + } catch (IdropException ex) { + Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, + ex); + throw new IdropRuntimeException( + "error initializing selection listener", ex); + } + + this.getSelectionModel().addListSelectionListener(treeListener); + + /* + ActionMap map = this.getActionMap(); + map.put(IRODSTreeTransferHandler.getCutAction().getValue(Action.NAME), + IRODSTreeTransferHandler.getCutAction()); + map.put(IRODSTreeTransferHandler.getCopyAction().getValue(Action.NAME), + IRODSTreeTransferHandler.getCopyAction()); + map.put(IRODSTreeTransferHandler.getPasteAction().getValue(Action.NAME), + IRODSTreeTransferHandler.getPasteAction()); + + InputMap imap = this.getInputMap(); + imap.put(KeyStroke.getKeyStroke("ctrl X"), + TransferHandler.getCutAction().getValue(Action.NAME)); + imap.put(KeyStroke.getKeyStroke("ctrl C"), + TransferHandler.getCopyAction().getValue(Action.NAME)); + imap.put(KeyStroke.getKeyStroke("ctrl V"), + TransferHandler.getPasteAction().getValue(Action.NAME)); + * + */ + + + } + + /** + * Set up context sensitive tree menu + */ + private void setUpTreeMenu() { + thisTree = this; + m_popup = new JPopupMenu(); + m_action = new AbstractAction() { + + @Override + public void actionPerformed(final ActionEvent e) { + if (m_clickedPath == null) { + return; + } + + if (thisTree.isExpanded(m_clickedPath)) { + thisTree.collapsePath(m_clickedPath); + } else { + thisTree.expandPath(m_clickedPath); + } + } + }; + + m_popup.add(m_action); + + //public link action + public_link_action = new AbstractAction("Public Link") { + + @Override + public void actionPerformed(ActionEvent actionEvent) { + + IRODSNode theNode = (IRODSNode) m_clickedPath.getLastPathComponent(); + + IRODSFile file; + + setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + + String ticketStr = null; + try { + TicketServiceFactory tsf = new TicketServiceFactoryImpl(idropParentGui.getiDropCore().getIRODSAccessObjectFactory()); + TicketAdminService tas = tsf.instanceTicketAdminService(idropParentGui.getIrodsAccount()); + IRODSFileFactory ff = idropParentGui.getiDropCore().getIRODSFileFactory(idropParentGui.getIrodsAccount()); + file = ff.instanceIRODSFile(theNode.getFullPath()); + // generate ticket string + String ticketString = UUID.randomUUID().toString().replaceAll("-", ""); + ticketStr = tas.createTicket(TicketCreateModeEnum.READ,file,ticketString); + } catch (JargonException e) { + idropParentGui.showIdropException(e); + setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + throw new IdropRuntimeException("error creating ticket"); + } + + final GetPublicLink gpl = new GetPublicLink(ticketStr, file.toURI().toString()); + gpl.addPropertyChangeListener(new PropertyChangeListener() { + + @Override + public void propertyChange(PropertyChangeEvent propertyChangeEvent) { + if ("state".equals(propertyChangeEvent.getPropertyName())) { + if (propertyChangeEvent.getNewValue().equals(SwingWorker.StateValue.DONE)) { + try { + String result = gpl.get(); + Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + StringSelection selection = new StringSelection(result); + clipboard.setContents(selection, selection); + JOptionPane.showMessageDialog(null, "Public link has been copied to clipboard", "Info", JOptionPane.INFORMATION_MESSAGE); + } catch (InterruptedException e) { + JOptionPane.showMessageDialog(null, "error occurred while obtaining public link", "error", JOptionPane.ERROR_MESSAGE); + } catch (ExecutionException e) { + JOptionPane.showMessageDialog(null, "error occurred while obtaining public link", "error", JOptionPane.ERROR_MESSAGE); + } finally { + setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + } + } + } + } + + }); + + gpl.execute(); + + } + + }; + + m_popup.add(public_link_action); + + Action newAction = new AbstractAction("New Folder") { + + @Override + public void actionPerformed(final ActionEvent e) { + + log.info("adding new node"); + + IRODSNode parent = (IRODSNode) m_clickedPath.getLastPathComponent(); + log.info("parent of new node is: {}", parent); + CollectionAndDataObjectListingEntry dataEntry = (CollectionAndDataObjectListingEntry) parent.getUserObject(); + if (dataEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.DATA_OBJECT) { + JOptionPane.showMessageDialog( + thisTree, + "The selected item is not a folder, cannot create a new directory", + "Info", JOptionPane.INFORMATION_MESSAGE); + log.info("new folder not created, the selected parent is not a collection"); + return; + } + // show a dialog asking for the new directory name... + NewIRODSDirectoryDialog newDirectoryDialog = new NewIRODSDirectoryDialog( + idropParentGui, true, dataEntry.getPathOrName(), + thisTree, parent); + newDirectoryDialog.setLocation( + (int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2), (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2)); + newDirectoryDialog.setVisible(true); + } + }; + m_popup.add(newAction); + + m_popup.addSeparator(); + + Action a1 = new AbstractAction("Delete") { + + @Override + public void actionPerformed(final ActionEvent e) { + log.info("deleting a node"); + int[] rows = thisTree.getSelectedRows(); + log.debug("selected rows for delete:{}", rows); + + DeleteIRODSDialog deleteDialog; + + if (rows.length == 1) { + + IRODSNode toDelete = (IRODSNode) thisTree.getValueAt( + rows[0], 0); + log.info("deleting a single node: {}", toDelete); + deleteDialog = new DeleteIRODSDialog(idropParentGui, true, + thisTree, toDelete); + } else { + List<IRODSNode> nodesToDelete = new ArrayList<IRODSNode>(); + for (int row : rows) { + nodesToDelete.add((IRODSNode) thisTree.getValueAt(row, + 0)); + + } + + deleteDialog = new DeleteIRODSDialog(idropParentGui, true, + thisTree, nodesToDelete); + } + + deleteDialog.setLocation( + (int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2), (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2)); + deleteDialog.setVisible(true); + } + }; + + m_popup.add(a1); + Action a2 = new AbstractAction("Rename") { + + @Override + public void actionPerformed(final ActionEvent e) { + log.info("renaming node"); + + IRODSNode toRename = (IRODSNode) m_clickedPath.getLastPathComponent(); + log.info("node to rename is: {}", toRename); + CollectionAndDataObjectListingEntry dataEntry = (CollectionAndDataObjectListingEntry) toRename.getUserObject(); + + // dialog uses absolute path, so munge it for files + StringBuilder sb = new StringBuilder(); + if (dataEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.COLLECTION) { + sb.append(dataEntry.getPathOrName()); + } else { + sb.append(dataEntry.getParentPath()); + sb.append('/'); + sb.append(dataEntry.getPathOrName()); + } + + // show a dialog asking for the new directory name... + RenameIRODSDirectoryDialog renameDialog = new RenameIRODSDirectoryDialog( + idropParentGui, true, sb.toString(), thisTree, toRename); + renameDialog.setLocation( + (int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2), (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2)); + renameDialog.setVisible(true); + } + }; + m_popup.add(a2); + thisTree.add(m_popup); + thisTree.addMouseListener(new PopupTrigger()); + + } + + @Override + public void treeExpanded(final TreeExpansionEvent event) { + } + + @Override + public void treeCollapsed(final TreeExpansionEvent event) { + } + + class PopupTrigger extends MouseAdapter { + + @Override + public void mouseReleased(final MouseEvent e) { + if (e.isPopupTrigger()) { + int x = e.getX(); + int y = e.getY(); + + TreePath path = thisTree.getClosestPathForLocation(x, y); + if (path != null) { + if (thisTree.isExpanded(path)) { + m_action.putValue(Action.NAME, "Collapse"); + } else { + m_action.putValue(Action.NAME, "Expand"); + } + + //public link option only availabe for files + IRODSNode currNode = (IRODSNode) path.getLastPathComponent(); + CollectionAndDataObjectListingEntry entry = + (CollectionAndDataObjectListingEntry) currNode.getUserObject(); + // todo is public link service configured? + boolean configured = idropParentGui.getiDropCore().getIdropConfig().getPropertyForKey(IdropConfigurationService.IDROP_PUBLIC_LINK_SERVICE)!=null; + public_link_action.setEnabled(configured && entry.isDataObject() && idropParentGui.getIrodsAccount().getUserName().equals(entry.getOwnerName())); + + m_popup.show(thisTree, x, y); + m_clickedPath = path; + } + } else if (e.getClickCount() == 2) { + int x = e.getX(); + int y = e.getY(); + TreePath path = thisTree.getClosestPathForLocation(x, y); + + IRODSNode inode = null; + String fullPath = null; + if (path != null) { + Object node = path.getLastPathComponent(); + if (node instanceof IRODSNode) { + inode = (IRODSNode) node; + CollectionAndDataObjectListingEntry entry = + (CollectionAndDataObjectListingEntry) inode.getUserObject(); + fullPath = entry.getPathOrName(); + } + + if (fullPath != null) { + idropParentGui.getiDropCore().setBasePath(fullPath); + idropParentGui.buildTargetTree(false); + } + } + } + } + + @Override + public void mousePressed(final MouseEvent e) { + if (e.isPopupTrigger()) { + int x = e.getX(); + int y = e.getY(); + TreePath path = thisTree.getClosestPathForLocation(x, y); + if (path != null) { + if (thisTree.isExpanded(path)) { + m_action.putValue(Action.NAME, "Collapse"); + } else { + m_action.putValue(Action.NAME, "Expand"); + } + //public link option only availabe for files + IRODSNode currNode = (IRODSNode) path.getLastPathComponent(); + CollectionAndDataObjectListingEntry entry = + (CollectionAndDataObjectListingEntry) currNode.getUserObject(); + public_link_action.setEnabled(entry.isDataObject() && idropParentGui.getIrodsAccount().getUserName().equals(entry.getOwnerName())); + + m_popup.show(thisTree, x, y); + m_clickedPath = path; + } + } + } + } + + @Override + public void treeWillCollapse(final TreeExpansionEvent event) + throws ExpandVetoException { + } + + @Override + public void treeWillExpand(final TreeExpansionEvent event) + + //TODO: Need to make this a swing worker?? + throws ExpandVetoException { + setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + log.debug("tree expansion event:{}", event); + IRODSNode expandingNode = (IRODSNode) event.getPath().getLastPathComponent(); + // If I am refreshing the tree, then do not close the connection after + // each load. It will be closed in the thing + // doing the refreshing + try { + expandingNode.lazyLoadOfChildrenOfThisNode(!isRefreshingTree()); + } catch (IdropException ex) { + Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, + ex); + idropParentGui.showIdropException(ex); + throw new IdropRuntimeException("error expanding irodsNode"); + } finally { + setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + } + } + + public void highlightPath(final TreePath pathToHighlight) { + final IRODSTree highlightTree = this; + java.awt.EventQueue.invokeLater(new Runnable() { + + @Override + public void run() { + highlightTree.collapsePath(pathToHighlight); + highlightTree.expandPath(pathToHighlight); + // highlightTree.sc + // highlightTree.scrollPathToVisible(pathToHighlight); + } + }); + } + + // FIXME: move out? + /* +public class TransferActionListener implements ActionListener, + PropertyChangeListener { + private JComponent focusOwner = null; + + public TransferActionListener() { + KeyboardFocusManager manager = KeyboardFocusManager. + getCurrentKeyboardFocusManager(); + manager.addPropertyChangeListener("permanentFocusOwner", this); + } + + public void propertyChange(PropertyChangeEvent e) { + Object o = e.getNewValue(); + if (o instanceof JComponent) { + focusOwner = (JComponent)o; + } else { + focusOwner = null; + } + } + + public void actionPerformed(ActionEvent e) { + if (focusOwner == null) + return; + String action = (String)e.getActionCommand(); + Action a = focusOwner.getActionMap().get(action); + if (a != null) { + a.actionPerformed(new ActionEvent(focusOwner, + ActionEvent.ACTION_PERFORMED, + null)); + } + } +} +*/ + + class GetPublicLink extends SwingWorker<String, Void> { + + private final String theUri; + + private final String ticket; + + public GetPublicLink(String ticket, String theUri) { + this.theUri = theUri; + this.ticket = ticket; + } + + @Override + protected String doInBackground() throws Exception { + StringBuilder publinkServiceSb = new StringBuilder(idropParentGui.getiDropCore().getIdropConfig().getPropertyForKey(IdropConfigurationService.IDROP_PUBLIC_LINK_SERVICE)); + //escape ampersand in query parameter value + publinkServiceSb.append("?ticket=").append(ticket).append("&uri=").append(theUri.replaceAll("\\&","%26")); + URI u = URI.create(publinkServiceSb.toString()); + URL url = u.toURL(); + HttpURLConnection con = (HttpURLConnection) url.openConnection(); + if (con.getResponseCode() == 200) { + BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream())); + return br.readLine(); + + } else { + throw new Exception("error occurred while obtaining link"); + } + } + + } + + } |