|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.etools.systems.subsystems.impl.AbstractSystem
This is a base class to make it easier to create system classes.
An ISystem
object is returned from a subsystem object via getSystem(), and
it is used to represent the live connection to a particular subsystem.
All this could have been done in the subsystem object, but that would clutter it up too much.
You must override/implement
AbstractSystemManager
Field Summary | |
---|---|
protected Object |
connectResult
The result of calling connect in the server launcher object, in the connect method |
static String |
copyright
|
protected Object |
launchResult
The result of calling launch in the server launcher object, in the connect method |
protected Shell |
shell
|
Fields inherited from interface com.ibm.etools.systems.core.ISystemUserIdConstants |
---|
USERID_LOCATION_CONNECTION, USERID_LOCATION_DEFAULT_OVERALL, USERID_LOCATION_DEFAULT_SYSTEMTYPE, USERID_LOCATION_NOTSET, USERID_LOCATION_SUBSYSTEM |
Constructor Summary | |
---|---|
AbstractSystem()
Constructor when we don't have the subsystem. |
|
AbstractSystem(SubSystem subsystem)
Constructor when we have the subsystem. |
Method Summary | |
---|---|
void |
addCommunicationsListener(ICommunicationsListener listener)
Fully implemented, no need to override. |
protected void |
clearCommunicationListeners()
Private - used internally. |
void |
clearPasswordCache()
Useful utility method. |
void |
clearPasswordCache(boolean onDisk)
Useful utility method. |
protected void |
clearPasswordForOtherSystemsInConnection(String uid,
boolean fromDisk)
|
void |
clearUserIdCache()
Useful utility method. |
void |
connect(IProgressMonitor monitor)
Abstract - you must override, unless subsystem.getParentSubSystemFactory().supportsServerLaunchProperties returns true Attempt to connect to the remote system. |
void |
disconnect()
Abstract - you must override, unless subsystem.getParentSubSystemFactory().supportsServerLaunchProperties returns true Disconnect from the remote system. |
protected void |
enableServerLaunchType(SubSystem subsystem,
ServerLaunchType serverLaunchType,
boolean enable)
Call this method to identify specific server launch types that are not to be permitted. |
protected void |
fireCommunicationsEvent(int eventType)
Private - used internally. |
protected boolean |
forcePasswordToUpperCase()
Useful utility method. |
protected int |
getCommunicationListenerCount()
Private - used internally. |
protected int |
getConnectPort()
Return the port to use for connecting to the remote server, once it is running. |
String |
getHomeDirectory()
Not implemented, you should override if possible. |
String |
getHostName()
Useful utility method. |
protected String |
getLocalUserId()
Useful utility method. |
protected SystemSignonInformation |
getPasswordInformation()
Useful utility method. |
protected ISystemPasswordPromptDialog |
getPasswordPromptDialog(Shell shell)
A default implementation is supplied, but can be overridden if desired. |
ISystemValidator |
getPasswordValidator()
Useful utility method. |
int |
getPort()
Useful utility method. |
SubSystem |
getPrimarySubSystem()
|
IServerLauncher |
getRemoteServerLauncher()
Return the remote server launcher, which implements IServerLauncher. |
ISignonValidator |
getSignonValidator()
Optionally overridable, not implemented by default. |
SubSystem |
getSubSystem()
Useful utility method. |
String |
getSystemType()
Useful utility method. |
String |
getTempDirectory()
Not implemented, you should override if possible. |
String |
getUserId()
Useful utility method. |
ISystemValidator |
getUserIdValidator()
Useful utility method. |
String |
getVersionReleaseModification()
Not implemented, you should override if possible. |
boolean |
inheritConnectionUserPassword()
Return true if this system can inherit the uid and password of other ISystems in this connection |
boolean |
isConnected()
Abstract - you must override unless subsystem.getParentSubSystemFactory().supportsServerLaunchProperties returns true Return true if currently connected. |
protected boolean |
isEnabledServerLaunchType(SubSystem subsystem,
ServerLaunchType serverLaunchType)
This methods returns the enablement state per server launch type. |
boolean |
isPasswordCached()
Useful utility method. |
boolean |
isPasswordCached(boolean onDisk)
Useful utility method. |
boolean |
isSuppressSignonPrompt()
Returns the suppressSignonPrompt flag. |
void |
notifyConnection()
Notifies all listeners of a connection through a communications event |
void |
notifyDisconnection()
Notifies all listeners of a disconnection through a communications event |
void |
notifyError()
Notifies all listeners of an error through a communications event |
void |
promptForPassword(Shell shell,
boolean forcePrompt)
Method used internally, and available externally. |
void |
removeCommunicationsListener(ICommunicationsListener listener)
Fully implemented, no need to override. |
void |
reset()
Optionally override if you add any instance variables. |
void |
setPassword(String matchingUserId,
String password)
Useful utility method. |
void |
setPassword(String matchingUserId,
String password,
boolean persist)
Useful utility method. |
protected void |
setPasswordInformation(SystemSignonInformation passwordInfo)
Useful utility method. |
void |
setSubSystem(SubSystem ss)
Set the subsystem, when its not known at constructor time |
void |
setSuppressSignonPrompt(boolean suppressSignonPrompt)
Sets the suppressSignonPrompt flag. |
boolean |
shareUserPasswordWithConnection()
|
protected void |
updatePasswordForOtherSystemsInConnection(String uid,
String password,
boolean persistPassword)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String copyright
protected Shell shell
protected Object launchResult
protected Object connectResult
Constructor Detail |
public AbstractSystem()
setSubSystem(SubSystem)
after instantiation.
public AbstractSystem(SubSystem subsystem)
Method Detail |
public String getVersionReleaseModification()
Up to each implementer to decide if this will be cached.
Returns an empty string by default, override if possible
getVersionReleaseModification
in interface ISystem
public String getHomeDirectory()
Up to each implementer to decide how to implement, and if this will be cached.
Returns an empty string by default, override if possible
getHomeDirectory
in interface ISystem
public String getTempDirectory()
Up to each implementer to decide how to implement, and if this will be cached.
Returns an empty string by default, override if possible
getTempDirectory
in interface ISystem
public void setSubSystem(SubSystem ss)
setSubSystem
in interface ISystem
public SubSystem getSubSystem()
getSubSystem
in interface ISystem
public SubSystem getPrimarySubSystem()
public String getSystemType()
getSubSystem().getSystemConnection().getSystemType()
getSystemType
in interface ISystem
public String getHostName()
getSubSystem().getSystemConnection().getHostName()
getHostName
in interface ISystem
public int getPort()
getSubSystem().getPort()
getPort
in interface ISystem
public String getUserId()
getLocalUserId()
, but first clears the local
user Id cache if we are not currently connected.
getUserId
in interface ISystem
protected String getLocalUserId()
public void clearUserIdCache()
clearPasswordCache()
.
clearUserIdCache
in interface ISystem
public void clearPasswordCache()
clearPasswordCache
in interface ISystem
clearUserIdCache()
public void clearPasswordCache(boolean onDisk)
clearPasswordCache
in interface ISystem
onDisk
- if this is true, clear the password from the disk cache as well#clearUserIdCache(boolean)
public boolean isPasswordCached(boolean onDisk)
isPasswordCached
in interface ISystem
public boolean isPasswordCached()
isPasswordCached
in interface ISystem
public boolean inheritConnectionUserPassword()
inheritConnectionUserPassword
in interface ISystem
public boolean shareUserPasswordWithConnection()
shareUserPasswordWithConnection
in interface ISystem
public final void promptForPassword(Shell shell, boolean forcePrompt) throws InterruptedException
The search order for the password is as follows:
promptForPassword
in interface ISystem
shell
- parent for the prompt dialog if needed. Can be null if know password exists.forcePrompt
- forces the prompt dialog to be displayed even if the password is currently
in memory.
InterruptedException
protected void clearPasswordForOtherSystemsInConnection(String uid, boolean fromDisk)
protected void updatePasswordForOtherSystemsInConnection(String uid, String password, boolean persistPassword)
protected final ISystemPasswordPromptDialog getPasswordPromptDialog(Shell shell)
By default returns an instance of SystemPasswordPromptDialog. Calls forcePasswordToUpperCase() to decide whether the user Id and password should be folded to uppercase.
Calls getUserIdValidator()
and getPasswordValidator()
to set the validators. These return null by default by you can override them.
Before calling open() on the dialog, the getPassword(Shell) method that calls this will call setSystemInput(this).
After return, it will call wasCancelled() and getUserId(), getIsUserIdChanged(), getIsUserIdChangePermanent() and getPassword().
protected SystemSignonInformation getPasswordInformation()
protected void setPasswordInformation(SystemSignonInformation passwordInfo)
public void setPassword(String matchingUserId, String password, boolean persist)
setPassword
in interface ISystem
public void setPassword(String matchingUserId, String password)
setPassword
in interface ISystem
protected boolean forcePasswordToUpperCase()
getSubSystem().forceUserIdToUpperCase()
public ISystemValidator getUserIdValidator()
By default, returns
getSubSystem().getParentSubSystemFactory().getUserIdValidator()
public ISystemValidator getPasswordValidator()
By default, returns:
getSubSystem().getParentSubSystemFactory().getPasswordValidator()
public ISignonValidator getSignonValidator()
public boolean isConnected()
Return true if currently connected.
If the subsystem supports server launch,
the default behaviour here is to see if there is a server launcher created
in a previous call to connect, and if so, to test it by calling
IServerLauncher.isConnected()
.
This is called, by default, from the isConnected method of the subsystem.
isConnected
in interface ISystem
public void connect(IProgressMonitor monitor) throws Exception
Attempt to connect to the remote system.
If the subsystem supports server launch,
the default behaviour here is to get the remote server launcher via
getRemoteServerLauncher()
, and if IServerLauncher.isLaunched()
returns false, to call IServerLauncher.launch(IProgressMonitor)
.
This is called, by default, from the connect(...) methods of the subsystem.
connect
in interface ISystem
Exception
protected int getConnectPort()
getPort()
.
Override if appropriate.
connect(IProgressMonitor)
, if
subsystem.getParentSubSystemFactory().supportsServerLaunchProperties() is true.
public void disconnect() throws Exception
Disconnect from the remote system.
If the subsystem supports server launch,
the default behaviour here is to use the same remote server launcher created in connect(),
and call IServerLauncher.disconnect()
.
This is called, by default, from the disConnect(..) method of the subsystem.
disconnect
in interface ISystem
Exception
public IServerLauncher getRemoteServerLauncher()
This returns null be default!
public void reset()
reset
in interface ISystem
public void addCommunicationsListener(ICommunicationsListener listener)
addCommunicationsListener
in interface ISystem
ISystem.addCommunicationsListener(ICommunicationsListener)
public void removeCommunicationsListener(ICommunicationsListener listener)
removeCommunicationsListener
in interface ISystem
ISystem.removeCommunicationsListener(ICommunicationsListener)
protected void fireCommunicationsEvent(int eventType)
protected int getCommunicationListenerCount()
protected void clearCommunicationListeners()
public boolean isSuppressSignonPrompt()
isSuppressSignonPrompt
in interface ISystem
public void setSuppressSignonPrompt(boolean suppressSignonPrompt)
setSuppressSignonPrompt
in interface ISystem
suppressSignonPrompt
- protected void enableServerLaunchType(SubSystem subsystem, ServerLaunchType serverLaunchType, boolean enable)
You normally do not call this! Rather, your subsystem factory class will override
SubSystemFactoryImpl.supportsServerLaunchType(ServerLaunchType)
.
However, this method is needed by ISVs that re-use IBM-supplied subsystem factories,
and merely supply their own ISystem object via the "systemClass" attribute of the
subsystemfactory extension point.
ServerLaunchType
protected boolean isEnabledServerLaunchType(SubSystem subsystem, ServerLaunchType serverLaunchType)
#enableServerLaunchType(ServerLaunchType,boolean)
has not been
called for this server launch type, then it is enabled by default.
ServerLaunchType
public void notifyDisconnection()
ISystem
notifyDisconnection
in interface ISystem
public void notifyConnection()
ISystem
notifyConnection
in interface ISystem
public void notifyError()
ISystem
notifyError
in interface ISystem
|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |