summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Conway <mikeconway@Mike-Conways-MacBook-Pro.local>2011-08-22 01:47:48 (GMT)
committer Mike Conway <mikeconway@Mike-Conways-MacBook-Pro.local>2011-08-22 01:47:48 (GMT)
commit8f5c3a524d4418c940f79c0d9f484c948d485439 (patch)
treecad95946bdefa5a3f01f6507c599641caab19c5f
parent13e6cfd0b760ca033fccda3bb662f264feedd155 (diff)
downloadQCG-Data-8f5c3a524d4418c940f79c0d9f484c948d485439.zip
QCG-Data-8f5c3a524d4418c940f79c0d9f484c948d485439.tar.gz
QCG-Data-8f5c3a524d4418c940f79c0d9f484c948d485439.tar.bz2
[#389] password change update synchs and transfers with new
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/ChangePasswordDialog.java45
1 files changed, 15 insertions, 30 deletions
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/ChangePasswordDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/ChangePasswordDialog.java
index e702bb2..51e79b4 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/ChangePasswordDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/ChangePasswordDialog.java
@@ -16,6 +16,7 @@ import org.irods.jargon.core.connection.IRODSAccount;
import org.irods.jargon.core.exception.JargonException;
import org.irods.jargon.core.pub.UserAO;
import org.irods.jargon.transfer.dao.domain.LocalIRODSTransfer;
+import org.irods.jargon.transfer.exception.CannotUpdateTransferInProgressException;
import org.slf4j.LoggerFactory;
/**
@@ -218,7 +219,7 @@ public class ChangePasswordDialog extends javax.swing.JDialog {
}// </editor-fold>//GEN-END:initComponents
private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed
- this.dispose();
+ this.dispose();
}//GEN-LAST:event_btnCancelActionPerformed
private void btnUpdatePasswordActionPerformed(
@@ -259,28 +260,8 @@ public class ChangePasswordDialog extends javax.swing.JDialog {
try {
log.info("check queue for any jobs for the account, these have the old password.");
IRODSAccount irodsAccount = idrop.getIrodsAccount();
- List<LocalIRODSTransfer> recentQueue = idrop.getiDropCore().getTransferManager().getRecentQueue();
- for (LocalIRODSTransfer localIRODSTransfer : recentQueue) {
- if (localIRODSTransfer.getTransferHost().equals(
- irodsAccount.getHost())
- && localIRODSTransfer.getTransferZone().equals(
- irodsAccount.getZone())
- && localIRODSTransfer.getTransferUserName().equals(
- irodsAccount.getUserName())) {
- // FIXME: right now, do not differentiate transfers that are
- // comlete, this is a hack right now
- // if
- // (localIRODSTransfer.getTransferState().equals(localIRODSTransfer.TRANSFER_STATE_COMPLETE))
- // {
- // log.info("matched transfer was complete, ignored");
- // } else {
- JOptionPane.showMessageDialog(
- this,
- "Transfers for this account are pending, this account can not be changed until completed and purged");
- return;
- // }
- }
- }
+
+ idrop.getiDropCore().getTransferManager().updatePassword(irodsAccount, newPassword);
UserAO userAO = idrop.getiDropCore().getIrodsFileSystem().getIRODSAccessObjectFactory().getUserAO(idrop.getIrodsAccount());
userAO.changeAUserPasswordByThatUser(irodsAccount.getUserName(),
irodsAccount.getPassword(), newPassword);
@@ -293,8 +274,12 @@ public class ChangePasswordDialog extends javax.swing.JDialog {
idrop.setIrodsAccount(newAccount);
idrop.reinitializeForChangedIRODSAccount();
JOptionPane.showMessageDialog(this, "Password was changed");
-
+ } catch (CannotUpdateTransferInProgressException ex) {
+ JOptionPane.showMessageDialog(
+ this,
+ "Transfers for this account are pending, this account can not be changed until completed and purged");
+ return;
} catch (JargonException ex) {
Logger.getLogger(ChangePasswordDialog.class.getName()).log(
Level.SEVERE, null, ex);
@@ -306,12 +291,12 @@ public class ChangePasswordDialog extends javax.swing.JDialog {
}// GEN-LAST:event_btnUpdatePasswordActionPerformed
private void setUpPasswordPanel() {
- IRODSAccount account = idrop.getIrodsAccount();
- lblHost.setText(account.getHost());
- lblPort.setText(String.valueOf(account.getPort()));
- lblZone.setText(account.getZone());
- lblResource.setText(account.getZone());
- lblUserName.setText(account.getUserName());
+ IRODSAccount account = idrop.getIrodsAccount();
+ lblHost.setText(account.getHost());
+ lblPort.setText(String.valueOf(account.getPort()));
+ lblZone.setText(account.getZone());
+ lblResource.setText(account.getZone());
+ lblUserName.setText(account.getUserName());
initializePasswordColors();
}