|
RSE Release 3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.rse.core.model.RSEPersistableObject
org.eclipse.rse.core.model.PropertySetContainer
org.eclipse.rse.core.model.RSEModelObject
org.eclipse.rse.core.subsystems.AbstractConnectorService
public abstract class AbstractConnectorService
This is a base class to make it easier to create connector services.
An IConnectorService
object
is returned from a subsystem object via getConnectorService(), and
it is used to maintain the connection to a particular set of subsystems.
This class implements the protocol for much of the standard bookkeeping for connector services including server launchers (if none are required), event handling, hosts, ports, addresses, descriptions, and registered subsystems. Subclasses must concern themselves with actually authenticating and connecting.
Field Summary |
---|
Fields inherited from interface org.eclipse.rse.core.model.IRSEPersistableContainer |
---|
NO_CHILDREN |
Constructor Summary | |
---|---|
AbstractConnectorService(String name,
String description,
IHost host,
int port)
Construct a new connector service. |
Method Summary | |
---|---|
void |
addCommunicationsListener(ICommunicationsListener listener)
Register a communications listener. |
boolean |
commit()
Request a persistence manager to persist this object. |
void |
connect(IProgressMonitor monitor)
Connect to the remote system. |
void |
deregisterSubSystem(ISubSystem ss)
Deregister the subsystem. |
void |
disconnect(IProgressMonitor monitor)
Disconnects from the target system. |
protected void |
fireCommunicationsEvent(int eventType)
Fires the communication event mentioned in the eventType. |
protected int |
getConnectPort()
This implementation returns the connector service's port property. |
boolean |
getDenyPasswordSave()
Retrieves the value of the "DENY_PASSWORD_SAVE" property of this connector service. |
String |
getDescription()
|
String |
getHomeDirectory()
Returns the home directory of the remote system for the current user, if available. |
IHost |
getHost()
|
String |
getHostName()
|
String |
getName()
|
IRSEPersistableContainer[] |
getPersistableChildren()
Retrieves the children of this object in the persistence containment hierarchy. |
IRSEPersistableContainer |
getPersistableParent()
Retrieve the parent of this object in the persistence containment hierarchy. |
int |
getPort()
|
ISubSystem |
getPrimarySubSystem()
|
IServerLauncher |
getRemoteServerLauncher()
|
IServerLauncherProperties |
getRemoteServerLauncherProperties()
Gets the properties associated with a remote server launcher. |
ISubSystem[] |
getSubSystems()
Return all the subsystems that use this connector service |
String |
getTempDirectory()
Returns the temp directory of the remote system for the current user, if available. |
String |
getVersionReleaseModification()
|
boolean |
hasActiveCommunicationListeners()
Check if there are any active communication listeners listening to this connector service. |
boolean |
hasRemoteServerLauncherProperties()
|
protected void |
initializeSubSystems(IProgressMonitor monitor)
Initialize any subsystems just after connecting to the host. |
protected abstract void |
internalConnect(IProgressMonitor monitor)
Performs the actual connection to the target system. |
protected abstract void |
internalDisconnect(IProgressMonitor monitor)
Performs the actual disconnection from the target system. |
boolean |
isServerLaunchTypeEnabled(ISubSystem subsystem,
ServerLaunchType serverLaunchType)
This methods returns the enablement state of a server launch type. |
boolean |
isUsingSSL()
|
protected void |
notifyConnection()
Send the event to notify listeners of a connection. |
protected void |
notifyDisconnection()
Send the event to notify listeners of a disconnection. |
protected void |
notifyError()
Send the event to notify listeners of a connection establishment error. |
protected void |
postConnect()
Performs any tasks required immediately after connecting. |
protected void |
postDisconnect()
Performs any cleanup required after disconnecting. |
protected void |
preConnect()
Performs any tasks required immediately prior to connecting. |
protected void |
preDisconnect()
Performs any tasks required immediately prior to disconnecting. |
void |
registerSubSystem(ISubSystem ss)
Adds a subsystem to this connector service. |
void |
removeCommunicationsListener(ICommunicationsListener listener)
Remove a communications listener. |
void |
reset()
Reset the connector service state if a connector service is redefined or disconnected. |
int |
setDenyPasswordSave(boolean deny)
Sets the attribute for this connector service instance that denies a password to be saved. |
void |
setHost(IHost host)
Sets the host used by this connector service. |
void |
setIsUsingSSL(boolean flag)
|
void |
setPort(int port)
Set the port for this connector. |
void |
setRemoteServerLauncherProperties(IServerLauncherProperties newRemoteServerLauncher)
Do nothing, may be overridden |
boolean |
supportsRemoteServerLaunching()
|
boolean |
supportsServerLaunchProperties()
|
protected void |
uninitializeSubSystems(IProgressMonitor monitor)
Uninitialize any subsystem just after disconnecting from the host. |
Methods inherited from class org.eclipse.rse.core.model.PropertySetContainer |
---|
addPropertySet, addPropertySets, clonePropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet |
Methods inherited from class org.eclipse.rse.core.model.RSEPersistableObject |
---|
compareStrings, isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.rse.core.subsystems.IConnectorService |
---|
acquireCredentials, clearCredentials, clearPassword, getUserId, hasPassword, inheritsCredentials, isConnected, isSuppressed, removePassword, removeUserId, requiresPassword, requiresUserId, savePassword, saveUserId, setPassword, setSuppressed, setUserId, sharesCredentials, supportsPassword, supportsUserId |
Methods inherited from interface org.eclipse.rse.core.model.IPropertySetContainer |
---|
addPropertySet, addPropertySets, clonePropertySets, createPropertySet, createPropertySet, getPropertySet, getPropertySets, removePropertySet |
Methods inherited from interface org.eclipse.rse.core.model.IRSEPersistableContainer |
---|
isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored |
Constructor Detail |
---|
public AbstractConnectorService(String name, String description, IHost host, int port)
name
- The name of the connector service.description
- A description of the connector service.host
- The host associated with this connector service. A host may have multiple
connector services.port
- The port associated with this connector service if this connector service
is IP based. If not IP based this can be used for some other purpose.Method Detail |
---|
public final boolean isServerLaunchTypeEnabled(ISubSystem subsystem, ServerLaunchType serverLaunchType)
IConnectorService
RemoteServerLauncher.enableServerLaunchType(ServerLaunchType, boolean)
has not been
called for this server launch type, then it is enabled by default.
isServerLaunchTypeEnabled
in interface IConnectorService
subsystem
- the subystem for which this may be enabled.serverLaunchType
- the type to check for enabledment.
ServerLaunchType
public IServerLauncher getRemoteServerLauncher()
getRemoteServerLauncher
in interface IConnectorService
IConnectorService.getRemoteServerLauncher()
public boolean supportsRemoteServerLaunching()
supportsRemoteServerLaunching
in interface IConnectorService
IConnectorService.supportsRemoteServerLaunching()
public boolean supportsServerLaunchProperties()
supportsServerLaunchProperties
in interface IConnectorService
IConnectorService.supportsServerLaunchProperties()
public IServerLauncherProperties getRemoteServerLauncherProperties()
IConnectorService
getRemoteServerLauncherProperties
in interface IConnectorService
IConnectorService.getRemoteServerLauncherProperties()
public void setRemoteServerLauncherProperties(IServerLauncherProperties newRemoteServerLauncher)
setRemoteServerLauncherProperties
in interface IConnectorService
newRemoteServerLauncher
- the server launcher propertiesIConnectorService.setRemoteServerLauncherProperties(IServerLauncherProperties)
public final boolean hasRemoteServerLauncherProperties()
hasRemoteServerLauncherProperties
in interface IConnectorService
public final void addCommunicationsListener(ICommunicationsListener listener)
IConnectorService
addCommunicationsListener
in interface IConnectorService
listener
- a listener for the communications event.public final void removeCommunicationsListener(ICommunicationsListener listener)
IConnectorService
removeCommunicationsListener
in interface IConnectorService
listener
- a listener for the communications event.protected final void fireCommunicationsEvent(int eventType)
eventType
- the communications event to fire.public final IHost getHost()
getHost
in interface IConnectorService
public final void setHost(IHost host)
IConnectorService
setHost
in interface IConnectorService
host
- the host to be used for this connector servicepublic final String getDescription()
getDescription
in interface IRSEModelObject
getDescription
in class RSEModelObject
public final String getName()
getName
in interface IRSEModelObject
public final void setPort(int port)
IConnectorService
setPort
in interface IConnectorService
port
- the IP port used by this connector service.public final int getPort()
getPort
in interface IConnectorService
public final ISubSystem getPrimarySubSystem()
getPrimarySubSystem
in interface IConnectorService
public final void registerSubSystem(ISubSystem ss)
IConnectorService
registerSubSystem
in interface IConnectorService
ss
- a subsystem that is using this connector service.public final void deregisterSubSystem(ISubSystem ss)
IConnectorService
deregisterSubSystem
in interface IConnectorService
ss
- the subsystem to remove from this connector service.public final boolean commit()
IRSEPersistableContainer
commit
in interface IRSEPersistableContainer
public final IRSEPersistableContainer getPersistableParent()
IRSEPersistableContainer
getPersistableParent
in interface IRSEPersistableContainer
public IRSEPersistableContainer[] getPersistableChildren()
IRSEPersistableContainer
getPersistableChildren
in interface IRSEPersistableContainer
IRSEPersistableContainer.NO_CHILDREN
.public final String getHostName()
getHostName
in interface IConnectorService
public String getVersionReleaseModification()
getVersionReleaseModification
in interface IConnectorService
public final ISubSystem[] getSubSystems()
IConnectorService
getSubSystems
in interface IConnectorService
protected final void initializeSubSystems(IProgressMonitor monitor) throws SystemMessageException
monitor
- a progress monitor to report progress of initialization.
SystemMessageException
protected final void uninitializeSubSystems(IProgressMonitor monitor)
monitor
- a progress monitor used to track uninitialization progress.protected final void notifyDisconnection()
protected final void notifyConnection()
protected final void notifyError()
public final boolean isUsingSSL()
isUsingSSL
in interface IConnectorService
public final void setIsUsingSSL(boolean flag)
setIsUsingSSL
in interface IConnectorService
flag
- true if the connector service should attempt to use SSL when
establishing the connection.public String getTempDirectory()
getTempDirectory
in interface IConnectorService
IConnectorService.getTempDirectory()
public String getHomeDirectory()
getHomeDirectory
in interface IConnectorService
IConnectorService.getHomeDirectory()
public void reset()
reset()
if there is internal state to reset.
reset
in interface IConnectorService
IConnectorService.reset()
protected int getConnectPort()
connect(IProgressMonitor)
,
if #supportsServerLaunchProperties() is true.
public final void connect(IProgressMonitor monitor) throws Exception
IConnectorService
connect
in interface IConnectorService
monitor
- a monitor for tracking the progress and canceling a
connect operation.
OperationCanceledException
- if the connect was cancelled by the
user
Exception
- if there is a failure connecting. Typically, this will
be a SystemMessageException
.public final void disconnect(IProgressMonitor monitor) throws Exception
internalDisconnect(IProgressMonitor)
and postDisconnect()
disconnect
in interface IConnectorService
monitor
- a monitor for tracking the progress and canceling a
disconnect operation.
Exception
- if the disconnect failsprotected abstract void internalConnect(IProgressMonitor monitor) throws Exception
monitor
- for cancellation and progress reporting
Exception
- if connection does not succeedprotected abstract void internalDisconnect(IProgressMonitor monitor) throws Exception
monitor
- for cancellation and progress reporting
Exception
- if disconnection does not succeedprotected void postDisconnect()
protected void preDisconnect()
protected void preConnect()
protected void postConnect()
public final int setDenyPasswordSave(boolean deny)
setDenyPasswordSave
in interface IConnectorService
deny
- If true, forget any saved passwords and do not allow any
others to be saved. If false, allow passwords to be saved in
the keyring.
IConnectorService.setDenyPasswordSave(boolean)
public final boolean getDenyPasswordSave()
getDenyPasswordSave
in interface IConnectorService
IConnectorService.getDenyPasswordSave()
public boolean hasActiveCommunicationListeners()
|
RSE Release 3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |