|
org.eclipse.rse.core.subsystems
Class AuthenticatingConnectorService
java.lang.Object
org.eclipse.rse.core.model.RSEPersistableObject
org.eclipse.rse.core.model.PropertySetContainer
org.eclipse.rse.core.model.RSEModelObject
org.eclipse.rse.core.subsystems.AbstractConnectorService
org.eclipse.rse.core.subsystems.AuthenticatingConnectorService
-
All Implemented Interfaces:
-
IPropertySetContainer,
IRSEModelObject,
IRSEPersistableContainer,
IConnectorService
-
Direct Known Subclasses:
-
StandardConnectorService
-
public abstract class AuthenticatingConnectorService
- extends
AbstractConnectorService
An authenticating connector service understands the concept of credentials
(see
ICredentials )
and possibly the concepts of user id and password. It contains a
credentials provider (
ICredentialsProvider ) and provides a
framework under which authentication can take place during connections.
Method Summary
|
void
|
acquireCredentials
(boolean reacquire)
Acquire the credentials for this connector service. |
void
|
clearCredentials
()
Clears the credentials held by this service. |
void
|
clearPassword
(boolean persist,
boolean propagate)
Clear password held by this service and optionally
clear its persistent form. |
protected
ICredentialsProvider
|
getCredentialsProvider
()
|
String
|
getUserId
()
Obtains the user id, if it understand the concept of user id, from
its credentials provider. |
boolean
|
hasPassword
(boolean onDisk)
|
boolean
|
inheritsCredentials
()
Returns true if this connector service can inherit the credentials of
other connector services in this host. |
boolean
|
isSuppressed
()
|
protected void
|
postDisconnect
()
Performs any cleanup required after disconnecting. |
void
|
removePassword
()
Causes the persisted password known to this connector service, if any, to
be forgotten. |
void
|
removeUserId
()
Causes the persisted (default) user id known to this
connector service, if any, to be forgotten. |
void
|
savePassword
()
Causes the password known to this connector service, if any, to be
persisted. |
void
|
saveUserId
()
Causes the user id known to the connector service, if any, to be
persisted. |
protected void
|
setCredentialsProvider
(
ICredentialsProvider credentialsProvider)
Sets the credentials provider used by this connector service. |
void
|
setPassword
(
String userId,
String password,
boolean persist,
boolean propagate)
Sets the password used by this connector service. |
void
|
setSuppressed
(boolean suppressed)
Suppresses the acquisition of a credentials by the connector service. |
void
|
setUserId
(
String newId)
Sets the default user id for use by the credentials provider. |
boolean
|
sharesCredentials
()
Returns true if this connector service can share it's credentials
with other connector services in this host. |
Methods inherited from class org.eclipse.rse.core.subsystems.
AbstractConnectorService
|
addCommunicationsListener,
commit,
connect,
deregisterSubSystem,
disconnect,
fireCommunicationsEvent,
getConnectPort,
getDenyPasswordSave,
getDescription,
getHomeDirectory,
getHost,
getHostName,
getName,
getPersistableChildren,
getPersistableParent,
getPort,
getPrimarySubSystem,
getRemoteServerLauncher,
getRemoteServerLauncherProperties,
getSubSystems,
getTempDirectory,
getVersionReleaseModification,
hasActiveCommunicationListeners,
hasRemoteServerLauncherProperties,
initializeSubSystems,
internalConnect,
internalDisconnect,
isServerLaunchTypeEnabled,
isUsingSSL,
notifyConnection,
notifyDisconnection,
notifyError,
postConnect,
preConnect,
preDisconnect,
registerSubSystem,
removeCommunicationsListener,
reset,
setDenyPasswordSave,
setHost,
setIsUsingSSL,
setPort,
setRemoteServerLauncherProperties,
supportsRemoteServerLaunching,
supportsServerLaunchProperties,
uninitializeSubSystems
|
Methods inherited from class java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
credentialsProvider
protected
ICredentialsProvider credentialsProvider
AuthenticatingConnectorService
public AuthenticatingConnectorService(
String name,
String description,
IHost host,
int port)
- Constructs an authenticating connector service.
-
Parameters:
-
name - The name of the connector service -
description - The description of the connector service -
host - The host associated with this connector service -
port - The port this connector service will use when connecting if it uses IP.
getUserId
public final
String getUserId()
- Obtains the user id, if it understand the concept of user id, from
its credentials provider.
-
-
Returns:
- the user id or null if not available or not supported.
-
See Also:
-
IConnectorService.getUserId()
setUserId
public final void setUserId(
String newId)
- Sets the default user id for use by the credentials provider.
-
-
Parameters:
-
newId - the id to be used by the credentials provider. -
See Also:
-
IConnectorService.setUserId(java.lang.String)
saveUserId
public final void saveUserId()
-
Description copied from interface:
IConnectorService
- Causes the user id known to the connector service, if any, to be
persisted.
-
removeUserId
public final void removeUserId()
-
Description copied from interface:
IConnectorService
- Causes the persisted (default) user id known to this
connector service, if any, to be forgotten.
-
clearPassword
public final void clearPassword(boolean persist,
boolean propagate)
-
Description copied from interface:
IConnectorService
- Clear password held by this service and optionally
clear its persistent form.
Called when user uses the property dialog to
change his userId.
-
-
Parameters:
-
persist - if true, clears the persistent form of the password -
propagate - true if this password should be cleared in related connector services.
hasPassword
public final boolean hasPassword(boolean onDisk)
-
-
Parameters:
-
onDisk - also check for the persistent form of the password.
-
Returns:
- true if a password is currently known to this connector service.
setPassword
public final void setPassword(
String userId,
String password,
boolean persist,
boolean propagate)
-
Description copied from interface:
IConnectorService
- Sets the password used by this connector service.
Can be used if the connector service acquires a password by some external
means.
-
-
Parameters:
-
userId - The user id to be associated with this password. -
password - the password -
persist - true if the password is to be persisted for later use. -
propagate - true if this password should be propagated to related connector services.
savePassword
public final void savePassword()
-
Description copied from interface:
IConnectorService
- Causes the password known to this connector service, if any, to be
persisted.
-
removePassword
public final void removePassword()
-
Description copied from interface:
IConnectorService
- Causes the persisted password known to this connector service, if any, to
be forgotten.
-
postDisconnect
protected final void postDisconnect()
-
Description copied from class:
AbstractConnectorService
- Performs any cleanup required after disconnecting.
This implementation does nothing.
May be overridden.
If overridden, invoke via super.
-
-
Overrides:
-
postDisconnect
in class
AbstractConnectorService
-
isSuppressed
public final boolean isSuppressed()
-
-
Returns:
- true if the acquisition of credentials is being suppressed.
setSuppressed
public final void setSuppressed(boolean suppressed)
-
Description copied from interface:
IConnectorService
- Suppresses the acquisition of a credentials by the connector service.
Causes
IConnectorService.acquireCredentials(boolean) to immediately
throw an InterruptedException.
The intent is to allow tool writers to prevent multiple
attempts to acquire credentials during a set period of time.
It is the responsibility of the caller to set this value
back to false when the tool no longer needs to suppress
acquisition credentials.
-
-
Parameters:
-
suppressed - true if acquisition is to be suppressed.
false if acquisition is to be allowed.
acquireCredentials
public final void acquireCredentials(boolean reacquire)
throws
OperationCanceledException
-
Description copied from interface:
IConnectorService
- Acquire the credentials for this connector service. Acquisition may be
temporarily suppressed by using the
IConnectorService.setSuppressed(boolean) .
Implementations may retain a remembered credentials or use this to
acquire the credentials using some implementation defined means.
-
-
Parameters:
-
reacquire - if true will force the connector service to discard any
remembered value and reacquire the credentials.
-
Throws:
-
OperationCanceledException
- if acquisition of the credentials is
cancelled or is being suppressed.
clearCredentials
public final void clearCredentials()
-
Description copied from interface:
IConnectorService
- Clears the credentials held by this service.
Should be called if there is a change to any part of the credentials
expected by any using subsystem.
-
sharesCredentials
public boolean sharesCredentials()
- Returns true if this connector service can share it's credentials
with other connector services in this host.
This implementation will always return true.
Override if necessary.
-
-
Returns:
- true
-
See Also:
-
IConnectorService.sharesCredentials()
inheritsCredentials
public boolean inheritsCredentials()
- Returns true if this connector service can inherit the credentials of
other connector services in this host.
This implementation always returns true.
Override if necessary.
-
-
Returns:
- true
-
See Also:
-
IConnectorService.inheritsCredentials()
setCredentialsProvider
protected final void setCredentialsProvider(
ICredentialsProvider credentialsProvider)
- Sets the credentials provider used by this connector service.
This should be invoked once immediately during the construction of the
connector service.
-
-
Parameters:
-
credentialsProvider - the credentials provider to be used
by this connector service.
getCredentialsProvider
protected final
ICredentialsProvider getCredentialsProvider()
-
-
Returns:
- the credentials provider that is being used by this connector service.
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.
|
|