diff options
Diffstat (limited to 'platform/platform-impl/src/com/intellij/remote/RemoteConnectionCredentialsWrapper.java')
-rw-r--r-- | platform/platform-impl/src/com/intellij/remote/RemoteConnectionCredentialsWrapper.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/platform/platform-impl/src/com/intellij/remote/RemoteConnectionCredentialsWrapper.java b/platform/platform-impl/src/com/intellij/remote/RemoteConnectionCredentialsWrapper.java index f711f4e51e21..e31b067e5d79 100644 --- a/platform/platform-impl/src/com/intellij/remote/RemoteConnectionCredentialsWrapper.java +++ b/platform/platform-impl/src/com/intellij/remote/RemoteConnectionCredentialsWrapper.java @@ -27,14 +27,17 @@ public class RemoteConnectionCredentialsWrapper { public static final String VAGRANT_PREFIX = "vagrant://"; public static final String SFTP_DEPLOYMENT_PREFIX = "sftp://"; + /** + * Connection types + */ public final Key<VagrantBasedCredentialsHolder> VAGRANT_BASED_CREDENTIALS = Key.create("VAGRANT_BASED_CREDENTIALS"); public final Key<WebDeploymentCredentialsHolder> WEB_DEPLOYMENT_BASED_CREDENTIALS = Key.create("WEB_DEPLOYMENT_BASED_CREDENTIALS"); - public final Key<RemoteCredentialsHolder> PLAIN_SSH_CREDENTIALS = Key.create("PLAIN_SSH_CREDENTIALS"); private UserDataHolderBase myCredentialsTypeHolder = new UserDataHolderBase(); public void setVagrantConnectionType(VagrantBasedCredentialsHolder vagrantBasedCredentials) { + myCredentialsTypeHolder = new UserDataHolderBase(); myCredentialsTypeHolder.putUserData(VAGRANT_BASED_CREDENTIALS, vagrantBasedCredentials); } @@ -44,6 +47,7 @@ public class RemoteConnectionCredentialsWrapper { } public void setPlainSshCredentials(RemoteCredentialsHolder credentials) { + myCredentialsTypeHolder = new UserDataHolderBase(); myCredentialsTypeHolder.putUserData(PLAIN_SSH_CREDENTIALS, credentials); } @@ -53,6 +57,7 @@ public class RemoteConnectionCredentialsWrapper { public void setWebDeploymentCredentials(WebDeploymentCredentialsHolder webDeploymentCredentials) { + myCredentialsTypeHolder = new UserDataHolderBase(); myCredentialsTypeHolder.putUserData(WEB_DEPLOYMENT_BASED_CREDENTIALS, webDeploymentCredentials); } @@ -91,17 +96,17 @@ public class RemoteConnectionCredentialsWrapper { public void save(final Element rootElement) { switchType(new RemoteSdkConnectionAcceptor() { @Override - public void ssh(RemoteCredentialsHolder cred) { + public void ssh(@NotNull RemoteCredentialsHolder cred) { cred.save(rootElement); } @Override - public void vagrant(VagrantBasedCredentialsHolder cred) { + public void vagrant(@NotNull VagrantBasedCredentialsHolder cred) { cred.save(rootElement); } @Override - public void deployment(WebDeploymentCredentialsHolder cred) { + public void deployment(@NotNull WebDeploymentCredentialsHolder cred) { cred.save(rootElement); } }); @@ -147,7 +152,7 @@ public class RemoteConnectionCredentialsWrapper { return RemoteCredentialsHolder.SSH_PREFIX + cred.getUserName() + "@" + cred.getHost() + ":" + cred.getPort(); } - public void switchType(RemoteSdkConnectionAcceptor acceptor) { + public void switchType(@NotNull final RemoteSdkConnectionAcceptor acceptor) { if (isVagrantConnection()) { acceptor.vagrant(getVagrantCredentials()); } |