mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-03 07:05:24 +02:00
[225089][ssh][shells][api] Canceling connection leads to exception
https://bugs.eclipse.org/bugs/show_bug.cgi?id=225089
This commit is contained in:
parent
c91dfb4717
commit
c13dc278b9
5 changed files with 12 additions and 14 deletions
|
@ -404,11 +404,8 @@ public abstract class AbstractConnectorService extends RSEModelObject implements
|
|||
return getPort();
|
||||
}
|
||||
|
||||
/**
|
||||
* Connects to the target system.
|
||||
* Calls {@link #internalConnect(IProgressMonitor)}
|
||||
* @param monitor a monitor for progress monitoring and cancelation.
|
||||
* @throws Exception if the connect fails
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.rse.core.subsystems.IConnectorService#connect(org.eclipse.core.runtime.IProgressMonitor)
|
||||
*/
|
||||
public final void connect(IProgressMonitor monitor) throws Exception {
|
||||
preConnect();
|
||||
|
|
|
@ -181,10 +181,7 @@ public abstract class AuthenticatingConnectorService extends AbstractConnectorSe
|
|||
credentialsProvider.setSuppressed(suppressed);
|
||||
}
|
||||
|
||||
/**
|
||||
* Acquires the credentials by delegating the request to the
|
||||
* credentials provider.
|
||||
* @param reacquire if true will cause the credentials to be reobtained if necessary.
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.rse.core.subsystems.IConnectorService#acquireCredentials(boolean)
|
||||
*/
|
||||
public final void acquireCredentials(boolean reacquire) throws OperationCanceledException {
|
||||
|
|
|
@ -90,7 +90,7 @@ public interface IConnectorService extends IRSEModelObject {
|
|||
* operation.
|
||||
* @throws Exception an exception of there is a failure to connect.
|
||||
* Typically, this will be a {@link SystemMessageException}.
|
||||
* If the connect was canceled by the user this will be an {@link OperationCanceledException}
|
||||
* @since 3.0 throws an {@link OperationCanceledException} if the connect was canceled by the user
|
||||
*/
|
||||
public void connect(IProgressMonitor monitor) throws Exception;
|
||||
|
||||
|
@ -275,12 +275,13 @@ public interface IConnectorService extends IRSEModelObject {
|
|||
* by using the {@link #setSuppressed(boolean)}.
|
||||
* <p>
|
||||
* Implementations may retain a remembered credentials or
|
||||
* use this acquire the credentials using some implementation defined means.
|
||||
* use this to acquire the credentials using some implementation defined means.
|
||||
* <p>
|
||||
* Throws {@link OperationCanceledException} if acquisition of the
|
||||
* credentials is canceled or is being suppressed.
|
||||
* @param refresh if true will force the connector service to discard
|
||||
* any remembered value and reacquire the credentials.
|
||||
* @since 3.0 throws OperationCanceledException instead of InterruptedException
|
||||
*/
|
||||
public void acquireCredentials(boolean refresh) throws OperationCanceledException;
|
||||
|
||||
|
@ -398,7 +399,7 @@ public interface IConnectorService extends IRSEModelObject {
|
|||
* If false, allow passwords to be saved in the keychain.
|
||||
* @return the number of saved passwords removed by this operation.
|
||||
* This will always be zero if "deny" is false.
|
||||
* @since org.eclipse.rse.core 3.0
|
||||
* @since 3.0 org.eclipse.rse.core
|
||||
*/
|
||||
public int setDenyPasswordSave(boolean deny);
|
||||
|
||||
|
@ -406,7 +407,7 @@ public interface IConnectorService extends IRSEModelObject {
|
|||
* Retrieves the value of the "DENY_PASSWORD_SAVE" property of this connector service.
|
||||
* If the value has never been set, this will return false.
|
||||
* @return true if password saving is denied.
|
||||
* @since org.eclipse.rse.core 3.0
|
||||
* @since 3.0 org.eclipse.rse.core
|
||||
*/
|
||||
public boolean getDenyPasswordSave();
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ public interface ICredentialsProvider {
|
|||
* canceled by the user, if the provider is in suppressed state,
|
||||
* a resource (such as the workbench) not being available,
|
||||
* or interrupted by some other means.
|
||||
* @since 3.0 throws OperationCanceledException instead of InterruptedException
|
||||
*/
|
||||
void acquireCredentials(boolean reacquire) throws OperationCanceledException;
|
||||
|
||||
|
@ -56,6 +57,7 @@ public interface ICredentialsProvider {
|
|||
* @throws OperationCanceledException if the repair is canceled for some reason. This could
|
||||
* include the inability of a credentials provider to open a dialog or a dialog being
|
||||
* canceled.
|
||||
* @since 3.0 throws OperationCanceledException instead of InterruptedException
|
||||
*/
|
||||
void repairCredentials(SystemMessage message)throws OperationCanceledException;
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ public class StandardCredentialsProvider extends AbstractCredentialsProvider {
|
|||
}
|
||||
|
||||
/**
|
||||
* <i>Do not override.</i>
|
||||
* @noimplement
|
||||
* Acquires the credentials (userid and password) for this connector service.
|
||||
* The search order for the password is as follows:</p>
|
||||
* <ol>
|
||||
|
@ -172,6 +172,7 @@ public class StandardCredentialsProvider extends AbstractCredentialsProvider {
|
|||
* if the password was found and is valid.
|
||||
* @throws OperationCanceledException if user is prompted and user
|
||||
* cancels that prompt or if {@link #isSuppressed()} is true.
|
||||
* @since 3.0 throws {@link OperationCanceledException} rather than {@link InterruptedException}
|
||||
*/
|
||||
public final void acquireCredentials(boolean reacquire) throws OperationCanceledException {
|
||||
if (isSuppressed()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue