Lines 22-27
Link Here
|
22 |
* David McKnight (IBM) - [186363] get rid of obsolete calls to SubSystem.connect() |
22 |
* David McKnight (IBM) - [186363] get rid of obsolete calls to SubSystem.connect() |
23 |
* David McKnight (IBM) - [196624] dstore miner IDs should be String constants rather than dynamic lookup |
23 |
* David McKnight (IBM) - [196624] dstore miner IDs should be String constants rather than dynamic lookup |
24 |
* David McKnight (IBM) - [216596] dstore preferences (timeout, and others) |
24 |
* David McKnight (IBM) - [216596] dstore preferences (timeout, and others) |
|
|
25 |
* David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible |
25 |
*******************************************************************************/ |
26 |
*******************************************************************************/ |
26 |
|
27 |
|
27 |
package org.eclipse.rse.connectorservice.dstore; |
28 |
package org.eclipse.rse.connectorservice.dstore; |
Lines 37-42
Link Here
|
37 |
|
38 |
|
38 |
import org.eclipse.core.runtime.FileLocator; |
39 |
import org.eclipse.core.runtime.FileLocator; |
39 |
import org.eclipse.core.runtime.IProgressMonitor; |
40 |
import org.eclipse.core.runtime.IProgressMonitor; |
|
|
41 |
import org.eclipse.core.runtime.IStatus; |
40 |
import org.eclipse.core.runtime.NullProgressMonitor; |
42 |
import org.eclipse.core.runtime.NullProgressMonitor; |
41 |
import org.eclipse.dstore.core.client.ClientConnection; |
43 |
import org.eclipse.dstore.core.client.ClientConnection; |
42 |
import org.eclipse.dstore.core.client.ConnectionStatus; |
44 |
import org.eclipse.dstore.core.client.ConnectionStatus; |
Lines 51-56
Link Here
|
51 |
import org.eclipse.dstore.internal.core.client.ClientSSLProperties; |
53 |
import org.eclipse.dstore.internal.core.client.ClientSSLProperties; |
52 |
import org.eclipse.jface.dialogs.IDialogConstants; |
54 |
import org.eclipse.jface.dialogs.IDialogConstants; |
53 |
import org.eclipse.jface.preference.IPreferenceStore; |
55 |
import org.eclipse.jface.preference.IPreferenceStore; |
|
|
56 |
import org.eclipse.osgi.util.NLS; |
54 |
import org.eclipse.rse.connectorservice.dstore.util.ConnectionStatusListener; |
57 |
import org.eclipse.rse.connectorservice.dstore.util.ConnectionStatusListener; |
55 |
import org.eclipse.rse.connectorservice.dstore.util.StatusMonitor; |
58 |
import org.eclipse.rse.connectorservice.dstore.util.StatusMonitor; |
56 |
import org.eclipse.rse.connectorservice.dstore.util.StatusMonitorFactory; |
59 |
import org.eclipse.rse.connectorservice.dstore.util.StatusMonitorFactory; |
Lines 67-77
Link Here
|
67 |
import org.eclipse.rse.core.subsystems.ServerLaunchType; |
70 |
import org.eclipse.rse.core.subsystems.ServerLaunchType; |
68 |
import org.eclipse.rse.core.subsystems.SubSystem; |
71 |
import org.eclipse.rse.core.subsystems.SubSystem; |
69 |
import org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants; |
72 |
import org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants; |
|
|
73 |
import org.eclipse.rse.internal.connectorservice.dstore.Activator; |
74 |
import org.eclipse.rse.internal.connectorservice.dstore.ConnectorServiceResources; |
70 |
import org.eclipse.rse.internal.connectorservice.dstore.RexecDstoreServer; |
75 |
import org.eclipse.rse.internal.connectorservice.dstore.RexecDstoreServer; |
71 |
import org.eclipse.rse.internal.ui.SystemPropertyResources; |
76 |
import org.eclipse.rse.internal.ui.SystemPropertyResources; |
|
|
77 |
import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; |
72 |
import org.eclipse.rse.services.clientserver.messages.SystemMessage; |
78 |
import org.eclipse.rse.services.clientserver.messages.SystemMessage; |
73 |
import org.eclipse.rse.services.clientserver.messages.SystemMessageException; |
79 |
import org.eclipse.rse.services.clientserver.messages.SystemMessageException; |
74 |
import org.eclipse.rse.ui.ISystemMessages; |
|
|
75 |
import org.eclipse.rse.ui.ISystemPreferencesConstants; |
80 |
import org.eclipse.rse.ui.ISystemPreferencesConstants; |
76 |
import org.eclipse.rse.ui.RSEUIPlugin; |
81 |
import org.eclipse.rse.ui.RSEUIPlugin; |
77 |
import org.eclipse.rse.ui.SystemBasePlugin; |
82 |
import org.eclipse.rse.ui.SystemBasePlugin; |
Lines 356-361
Link Here
|
356 |
|
361 |
|
357 |
// Fire comm event to signal state changed |
362 |
// Fire comm event to signal state changed |
358 |
notifyDisconnection(); |
363 |
notifyDisconnection(); |
|
|
364 |
|
359 |
clientConnection = null; |
365 |
clientConnection = null; |
360 |
// DKM - no need to clear uid cache |
366 |
// DKM - no need to clear uid cache |
361 |
clearPassword(false, true); // clear in-memory password |
367 |
clearPassword(false, true); // clear in-memory password |
Lines 503-509
Link Here
|
503 |
/** |
509 |
/** |
504 |
* @see org.eclipse.rse.core.subsystems.IConnectorService#connect(IProgressMonitor) |
510 |
* @see org.eclipse.rse.core.subsystems.IConnectorService#connect(IProgressMonitor) |
505 |
*/ |
511 |
*/ |
506 |
protected void internalConnect(IProgressMonitor monitor) throws Exception |
512 |
protected synchronized void internalConnect(IProgressMonitor monitor) throws Exception |
507 |
{ |
513 |
{ |
508 |
if (isConnected()) { |
514 |
if (isConnected()) { |
509 |
return; |
515 |
return; |
Lines 550-557
Link Here
|
550 |
{ |
556 |
{ |
551 |
if (monitor != null) |
557 |
if (monitor != null) |
552 |
{ |
558 |
{ |
553 |
SystemMessage cmsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_STARTING_SERVER_VIA_REXEC); |
559 |
String cmsg = ConnectorServiceResources.MSG_STARTING_SERVER_VIA_REXEC; |
554 |
monitor.subTask(cmsg.getLevelOneText()); |
560 |
monitor.subTask(cmsg); |
555 |
} |
561 |
} |
556 |
|
562 |
|
557 |
SystemSignonInformation info = getSignonInformation(); |
563 |
SystemSignonInformation info = getSignonInformation(); |
Lines 572-580
Link Here
|
572 |
|
578 |
|
573 |
if (monitor != null) |
579 |
if (monitor != null) |
574 |
{ |
580 |
{ |
575 |
SystemMessage cmsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECTING_TO_SERVER); |
581 |
String cmsg = NLS.bind(ConnectorServiceResources.MSG_CONNECTING_TO_SERVER, clientConnection.getPort()); |
576 |
cmsg.makeSubstitution(clientConnection.getPort()); |
582 |
monitor.subTask(cmsg); |
577 |
monitor.subTask(cmsg.getLevelOneText()); |
|
|
578 |
} |
583 |
} |
579 |
|
584 |
|
580 |
// connect to launched server |
585 |
// connect to launched server |
Lines 600-606
Link Here
|
600 |
String errorMsg = null; |
605 |
String errorMsg = null; |
601 |
if (msg == null) |
606 |
if (msg == null) |
602 |
{ |
607 |
{ |
603 |
errorMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_CONNECT_FAILED).getLevelOneText(); |
608 |
errorMsg = NLS.bind(ConnectorServiceResources.MSG_COMM_CONNECT_FAILED, getHostName()); |
604 |
} |
609 |
} |
605 |
else |
610 |
else |
606 |
{ |
611 |
{ |
Lines 614-621
Link Here
|
614 |
{ |
619 |
{ |
615 |
if (monitor != null) |
620 |
if (monitor != null) |
616 |
{ |
621 |
{ |
617 |
SystemMessage cmsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_STARTING_SERVER_VIA_DAEMON); |
622 |
String cmsg = ConnectorServiceResources.MSG_STARTING_SERVER_VIA_DAEMON; |
618 |
monitor.subTask(cmsg.getLevelOneText()); |
623 |
monitor.subTask(cmsg); |
619 |
} |
624 |
} |
620 |
|
625 |
|
621 |
// DY: getLocalUserId() may return null for Windows connections because |
626 |
// DY: getLocalUserId() may return null for Windows connections because |
Lines 686-693
Link Here
|
686 |
SystemSignonInformation newCredentials = null; |
691 |
SystemSignonInformation newCredentials = null; |
687 |
while (launchMsg != null && (isPasswordExpired(launchMsg) || isNewPasswordInvalid(launchMsg))) |
692 |
while (launchMsg != null && (isPasswordExpired(launchMsg) || isNewPasswordInvalid(launchMsg))) |
688 |
{ |
693 |
{ |
689 |
String messageId = isPasswordExpired(launchMsg) ? ISystemMessages.MSG_VALIDATE_PASSWORD_EXPIRED : ISystemMessages.MSG_VALIDATE_PASSWORD_INVALID; |
694 |
String pmsg = null; |
690 |
SystemMessage message = RSEUIPlugin.getPluginMessage(messageId); |
695 |
String pmsgDetails = null; |
|
|
696 |
boolean expired = isPasswordExpired(launchMsg); |
697 |
if (expired){ |
698 |
pmsg = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_EXPIRED; |
699 |
pmsgDetails = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_EXPIRED_DETAILS; |
700 |
} |
701 |
else { |
702 |
pmsg = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_INVALID; |
703 |
pmsgDetails = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_INVALID_DETAILS; |
704 |
} |
705 |
|
706 |
SystemMessage message = createSystemMessage(IStatus.ERROR, pmsg, pmsgDetails); |
691 |
getCredentialsProvider().repairCredentials(message); |
707 |
getCredentialsProvider().repairCredentials(message); |
692 |
newCredentials = (SystemSignonInformation) getCredentialsProvider().getCredentials(); |
708 |
newCredentials = (SystemSignonInformation) getCredentialsProvider().getCredentials(); |
693 |
launchStatus = changePassword(clientConnection, oldCredentials, serverLauncher, monitor, newCredentials.getPassword()); |
709 |
launchStatus = changePassword(clientConnection, oldCredentials, serverLauncher, monitor, newCredentials.getPassword()); |
Lines 707-718
Link Here
|
707 |
{ |
723 |
{ |
708 |
launchFailed = true; |
724 |
launchFailed = true; |
709 |
|
725 |
|
710 |
SystemMessage cmsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_PORT_OUT_RANGE); |
726 |
|
711 |
int colonIndex = launchMsg.indexOf(':'); |
727 |
int colonIndex = launchMsg.indexOf(':'); |
712 |
String portRange = launchMsg.substring(colonIndex + 1); |
728 |
String portRange = launchMsg.substring(colonIndex + 1); |
713 |
cmsg.makeSubstitution(portRange); |
|
|
714 |
|
729 |
|
715 |
ShowConnectMessage msgAction = new ShowConnectMessage(cmsg); |
730 |
String pmsg =NLS.bind(ConnectorServiceResources.MSG_PORT_OUT_RANGE, portRange); |
|
|
731 |
SystemMessage message = createSystemMessage(IStatus.ERROR, pmsg); |
732 |
|
733 |
ShowConnectMessage msgAction = new ShowConnectMessage(message); |
716 |
Display.getDefault().asyncExec(msgAction); |
734 |
Display.getDefault().asyncExec(msgAction); |
717 |
return; |
735 |
return; |
718 |
} |
736 |
} |
Lines 726-734
Link Here
|
726 |
{ |
744 |
{ |
727 |
if (monitor != null) |
745 |
if (monitor != null) |
728 |
{ |
746 |
{ |
729 |
SystemMessage cmsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECTING_TO_SERVER); |
747 |
if (clientConnection == null){ |
730 |
cmsg.makeSubstitution(clientConnection.getPort()); |
748 |
System.out.println("client connection is null!"); |
731 |
monitor.subTask(cmsg.getLevelOneText()); |
749 |
} |
|
|
750 |
String pmsg = NLS.bind(ConnectorServiceResources.MSG_CONNECTING_TO_SERVER, clientConnection.getPort()); |
751 |
monitor.subTask(pmsg); |
732 |
} |
752 |
} |
733 |
// connect to launched server |
753 |
// connect to launched server |
734 |
connectStatus = clientConnection.connect(launchStatus.getTicket(), timeout); |
754 |
connectStatus = clientConnection.connect(launchStatus.getTicket(), timeout); |
Lines 790-806
Link Here
|
790 |
else |
810 |
else |
791 |
{ |
811 |
{ |
792 |
connectStatus = new ConnectionStatus(false); |
812 |
connectStatus = new ConnectionStatus(false); |
793 |
connectStatus.setMessage( |
813 |
|
794 |
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_CONNECT_FAILED).getLevelOneText()); |
814 |
String cmsg = NLS.bind(ConnectorServiceResources.MSG_COMM_CONNECT_FAILED, getHostName()); |
|
|
815 |
connectStatus.setMessage(cmsg); |
795 |
} |
816 |
} |
796 |
} |
817 |
} |
797 |
else if (serverLauncherType == ServerLaunchType.RUNNING_LITERAL) |
818 |
else if (serverLauncherType == ServerLaunchType.RUNNING_LITERAL) |
798 |
{ |
819 |
{ |
799 |
if (monitor != null) |
820 |
if (monitor != null) |
800 |
{ |
821 |
{ |
801 |
SystemMessage cmsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECTING_TO_SERVER); |
822 |
String cmsg = NLS.bind(ConnectorServiceResources.MSG_CONNECTING_TO_SERVER, clientConnection.getPort()); |
802 |
cmsg.makeSubstitution(clientConnection.getPort()); |
823 |
monitor.subTask(cmsg); |
803 |
monitor.subTask(cmsg.getLevelOneText()); |
|
|
804 |
} |
824 |
} |
805 |
// connection directly |
825 |
// connection directly |
806 |
boolean useSSL = isUsingSSL(); |
826 |
boolean useSSL = isUsingSSL(); |
Lines 833-840
Link Here
|
833 |
IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore(); |
853 |
IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore(); |
834 |
if (clientConnection.getDataStore().usingSSL() && store.getBoolean(ISystemPreferencesConstants.ALERT_SSL)) |
854 |
if (clientConnection.getDataStore().usingSSL() && store.getBoolean(ISystemPreferencesConstants.ALERT_SSL)) |
835 |
{ |
855 |
{ |
836 |
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_USING_SSL); |
856 |
String cmsg = NLS.bind(ConnectorServiceResources.MSG_COMM_USING_SSL, getHostName()); |
837 |
msg.makeSubstitution(getHostName()); |
857 |
msg = createSystemMessage(IStatus.INFO, cmsg); |
|
|
858 |
|
838 |
DisplayHidableSystemMessageAction msgAction = new DisplayHidableSystemMessageAction(msg, store, ISystemPreferencesConstants.ALERT_SSL); |
859 |
DisplayHidableSystemMessageAction msgAction = new DisplayHidableSystemMessageAction(msg, store, ISystemPreferencesConstants.ALERT_SSL); |
839 |
Display.getDefault().syncExec(msgAction); |
860 |
Display.getDefault().syncExec(msgAction); |
840 |
if (msgAction.getReturnCode() != IDialogConstants.YES_ID) |
861 |
if (msgAction.getReturnCode() != IDialogConstants.YES_ID) |
Lines 845-852
Link Here
|
845 |
} |
866 |
} |
846 |
else if (!clientConnection.getDataStore().usingSSL() && store.getBoolean(ISystemPreferencesConstants.ALERT_NONSSL)) |
867 |
else if (!clientConnection.getDataStore().usingSSL() && store.getBoolean(ISystemPreferencesConstants.ALERT_NONSSL)) |
847 |
{ |
868 |
{ |
848 |
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_NOT_USING_SSL); |
869 |
String cmsg = NLS.bind(ConnectorServiceResources.MSG_COMM_NOT_USING_SSL, getHostName()); |
849 |
msg.makeSubstitution(getHostName()); |
870 |
msg = createSystemMessage(IStatus.INFO, cmsg); |
|
|
871 |
|
850 |
DisplayHidableSystemMessageAction msgAction = new DisplayHidableSystemMessageAction(msg, store, ISystemPreferencesConstants.ALERT_NONSSL); |
872 |
DisplayHidableSystemMessageAction msgAction = new DisplayHidableSystemMessageAction(msg, store, ISystemPreferencesConstants.ALERT_NONSSL); |
851 |
Display.getDefault().syncExec(msgAction); |
873 |
Display.getDefault().syncExec(msgAction); |
852 |
if (msgAction.getReturnCode() != IDialogConstants.YES_ID) |
874 |
if (msgAction.getReturnCode() != IDialogConstants.YES_ID) |
Lines 901-914
Link Here
|
901 |
{ |
923 |
{ |
902 |
if (message.startsWith(ClientConnection.CLIENT_OLDER)) |
924 |
if (message.startsWith(ClientConnection.CLIENT_OLDER)) |
903 |
{ |
925 |
{ |
|
|
926 |
String cmsg = NLS.bind(ConnectorServiceResources.MSG_COMM_CLIENT_OLDER_WARNING, getHostName()); |
927 |
String cmsgDetail = ConnectorServiceResources.MSG_COMM_CLIENT_OLDER_WARNING_DETAILS; |
904 |
|
928 |
|
905 |
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_CLIENT_OLDER_WARNING); |
929 |
msg = createSystemMessage(IStatus.WARNING, cmsg, cmsgDetail); |
906 |
msg.makeSubstitution(getHostName()); |
930 |
|
907 |
} |
931 |
} |
908 |
else if (message.startsWith(ClientConnection.SERVER_OLDER)) |
932 |
else if (message.startsWith(ClientConnection.SERVER_OLDER)) |
909 |
{ |
933 |
{ |
910 |
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_SERVER_OLDER_WARNING); |
934 |
String cmsg = NLS.bind(ConnectorServiceResources.MSG_COMM_SERVER_OLDER_WARNING, getHostName()); |
911 |
msg.makeSubstitution(getHostName()); |
935 |
String cmsgDetail = ConnectorServiceResources.MSG_COMM_SERVER_OLDER_WARNING_DETAILS; |
|
|
936 |
|
937 |
msg = createSystemMessage(IStatus.WARNING, cmsg, cmsgDetail); |
912 |
} |
938 |
} |
913 |
|
939 |
|
914 |
if (store.getBoolean(IUniversalDStoreConstants.ALERT_MISMATCHED_SERVER)){ |
940 |
if (store.getBoolean(IUniversalDStoreConstants.ALERT_MISMATCHED_SERVER)){ |
Lines 933-948
Link Here
|
933 |
{ |
959 |
{ |
934 |
dataStore.addMinersLocation("."); //$NON-NLS-1$ |
960 |
dataStore.addMinersLocation("."); //$NON-NLS-1$ |
935 |
// older servers initialized in one shot |
961 |
// older servers initialized in one shot |
936 |
DataElement schemaStatus = dataStore.getSchema(); |
962 |
dataStore.getSchema(); |
937 |
|
963 |
|
938 |
// Initialzie the miners |
964 |
// Initialzie the miners |
939 |
if (monitor != null) |
965 |
if (monitor != null) |
940 |
{ |
966 |
{ |
941 |
SystemMessage imsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_INITIALIZING_SERVER); |
967 |
String imsg = ConnectorServiceResources.MSG_INITIALIZING_SERVER; |
942 |
monitor.subTask(imsg.getLevelOneText()); |
968 |
monitor.subTask(imsg); |
943 |
} |
969 |
} |
944 |
DataElement initStatus = dataStore.initMiners(); |
970 |
DataElement initStatus = dataStore.initMiners(); |
945 |
//statusMonitor.waitForUpdate(schemaStatus); |
|
|
946 |
statusMonitor.waitForUpdate(initStatus); |
971 |
statusMonitor.waitForUpdate(initStatus); |
947 |
} |
972 |
} |
948 |
//long t2 = System.currentTimeMillis(); |
973 |
//long t2 = System.currentTimeMillis(); |
Lines 972-980
Link Here
|
972 |
} |
997 |
} |
973 |
else |
998 |
else |
974 |
{ |
999 |
{ |
975 |
|
1000 |
String cmsg = NLS.bind(ConnectorServiceResources.MSG_CONNECT_SSL_EXCEPTION, launchStatus.getMessage()); |
976 |
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_SSL_EXCEPTION); |
1001 |
msg = createSystemMessage(IStatus.ERROR, cmsg); |
977 |
msg.makeSubstitution(launchStatus.getMessage()); |
|
|
978 |
} |
1002 |
} |
979 |
} |
1003 |
} |
980 |
} |
1004 |
} |
Lines 986-993
Link Here
|
986 |
if (launchStatus.getException() != null && serverLauncher != null) |
1010 |
if (launchStatus.getException() != null && serverLauncher != null) |
987 |
{ |
1011 |
{ |
988 |
Throwable exception = launchStatus.getException(); |
1012 |
Throwable exception = launchStatus.getException(); |
989 |
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_DAEMON_FAILED_EXCEPTION); |
1013 |
String fmsg = NLS.bind(ConnectorServiceResources.MSG_CONNECT_DAEMON_FAILED_EXCEPTION, getHostName(), ""+serverLauncher.getDaemonPort()); //$NON-NLS-1$ |
990 |
msg.makeSubstitution(getHostName(), ""+serverLauncher.getDaemonPort(), exception); //$NON-NLS-1$ |
1014 |
|
|
|
1015 |
msg = createSystemMessage(IStatus.ERROR, fmsg, exception); |
991 |
} |
1016 |
} |
992 |
else if (launchMsg != null && launchMsg.indexOf(IDataStoreConstants.AUTHENTICATION_FAILED) != -1) |
1017 |
else if (launchMsg != null && launchMsg.indexOf(IDataStoreConstants.AUTHENTICATION_FAILED) != -1) |
993 |
{ |
1018 |
{ |
Lines 997-1004
Link Here
|
997 |
} |
1022 |
} |
998 |
|
1023 |
|
999 |
// Display error message |
1024 |
// Display error message |
1000 |
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_AUTH_FAILED); |
1025 |
String msgTxt = ConnectorServiceResources.MSG_COMM_AUTH_FAILED; |
1001 |
msg.makeSubstitution(getHostName()); |
1026 |
String msgDetails = NLS.bind(ConnectorServiceResources.MSG_COMM_AUTH_FAILED_DETAILS, getHostName()); |
|
|
1027 |
|
1028 |
msg = createSystemMessage(IStatus.ERROR, msgTxt, msgDetails); |
1029 |
|
1002 |
DisplaySystemMessageAction msgAction = new DisplaySystemMessageAction(msg); |
1030 |
DisplaySystemMessageAction msgAction = new DisplaySystemMessageAction(msg); |
1003 |
Display.getDefault().syncExec(msgAction); |
1031 |
Display.getDefault().syncExec(msgAction); |
1004 |
|
1032 |
|
Lines 1040-1047
Link Here
|
1040 |
SystemSignonInformation newCredentials = null; |
1068 |
SystemSignonInformation newCredentials = null; |
1041 |
while (launchMsg != null && (isPasswordExpired(launchMsg) || isNewPasswordInvalid(launchMsg))) |
1069 |
while (launchMsg != null && (isPasswordExpired(launchMsg) || isNewPasswordInvalid(launchMsg))) |
1042 |
{ |
1070 |
{ |
1043 |
String messageId = isPasswordExpired(launchMsg) ? ISystemMessages.MSG_VALIDATE_PASSWORD_EXPIRED : ISystemMessages.MSG_VALIDATE_PASSWORD_INVALID; |
1071 |
String msgTxt = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_INVALID; |
1044 |
SystemMessage message = RSEUIPlugin.getPluginMessage(messageId); |
1072 |
String msgDetails = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_INVALID_DETAILS; |
|
|
1073 |
if (isPasswordExpired(launchMsg)){ |
1074 |
msgTxt = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_EXPIRED; |
1075 |
msgDetails = ConnectorServiceResources.MSG_VALIDATE_PASSWORD_EXPIRED_DETAILS; |
1076 |
} |
1077 |
|
1078 |
SystemMessage message = createSystemMessage(IStatus.ERROR, msgTxt, msgDetails); |
1079 |
|
1045 |
getCredentialsProvider().repairCredentials(message); |
1080 |
getCredentialsProvider().repairCredentials(message); |
1046 |
newCredentials = (SystemSignonInformation) getCredentialsProvider().getCredentials(); |
1081 |
newCredentials = (SystemSignonInformation) getCredentialsProvider().getCredentials(); |
1047 |
launchStatus = changePassword(clientConnection, oldCredentials, serverLauncher, monitor, newCredentials.getPassword()); |
1082 |
launchStatus = changePassword(clientConnection, oldCredentials, serverLauncher, monitor, newCredentials.getPassword()); |
Lines 1071-1078
Link Here
|
1071 |
} |
1106 |
} |
1072 |
else if (launchMsg != null) |
1107 |
else if (launchMsg != null) |
1073 |
{ |
1108 |
{ |
1074 |
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_DAEMON_FAILED); |
1109 |
String msgTxt = NLS.bind(ConnectorServiceResources.MSG_CONNECT_DAEMON_FAILED, getHostName(), clientConnection.getPort()); |
1075 |
msg.makeSubstitution(getHostName(), clientConnection.getPort(), launchMsg); |
1110 |
msg = createSystemMessage(IStatus.ERROR, msgTxt, launchMsg); |
1076 |
} |
1111 |
} |
1077 |
} |
1112 |
} |
1078 |
|
1113 |
|
Lines 1081-1101
Link Here
|
1081 |
{ |
1116 |
{ |
1082 |
if (connectStatus.getMessage().startsWith(ClientConnection.INCOMPATIBLE_SERVER_UPDATE)) |
1117 |
if (connectStatus.getMessage().startsWith(ClientConnection.INCOMPATIBLE_SERVER_UPDATE)) |
1083 |
{ |
1118 |
{ |
1084 |
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_INCOMPATIBLE_UPDATE); |
1119 |
String msgTxt = NLS.bind(ConnectorServiceResources.MSG_COMM_INCOMPATIBLE_UPDATE, getHostName()); |
1085 |
msg.makeSubstitution(getHostName()); |
1120 |
String msgDetails = ConnectorServiceResources.MSG_COMM_INCOMPATIBLE_UPDATE_DETAILS; |
|
|
1121 |
|
1122 |
msg = createSystemMessage(IStatus.ERROR, msgTxt, msgDetails); |
1086 |
} |
1123 |
} |
1087 |
else if (connectStatus.getMessage().startsWith(ClientConnection.INCOMPATIBLE_PROTOCOL)) |
1124 |
else if (connectStatus.getMessage().startsWith(ClientConnection.INCOMPATIBLE_PROTOCOL)) |
1088 |
{ |
1125 |
{ |
1089 |
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_INCOMPATIBLE_PROTOCOL); |
1126 |
String msgTxt = NLS.bind(ConnectorServiceResources.MSG_COMM_INCOMPATIBLE_PROTOCOL, getHostName()); |
1090 |
msg.makeSubstitution(getHostName()); |
1127 |
String msgDetails = ConnectorServiceResources.MSG_COMM_INCOMPATIBLE_PROTOCOL_DETAILS; |
|
|
1128 |
|
1129 |
msg = createSystemMessage(IStatus.ERROR, msgTxt, msgDetails); |
1091 |
} |
1130 |
} |
1092 |
else |
1131 |
else |
1093 |
{ |
1132 |
{ |
1094 |
Throwable exception = connectStatus.getException(); |
1133 |
Throwable exception = connectStatus.getException(); |
1095 |
if (exception != null) |
1134 |
if (exception != null) |
1096 |
{ |
1135 |
{ |
1097 |
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_FAILED); |
1136 |
String msgTxt = NLS.bind(ConnectorServiceResources.MSG_CONNECT_FAILED, getHostName()); |
1098 |
msg.makeSubstitution(getHostName(), exception); |
1137 |
msg = createSystemMessage(IStatus.ERROR, msgTxt, exception); |
1099 |
} |
1138 |
} |
1100 |
} |
1139 |
} |
1101 |
} |
1140 |
} |
Lines 1104-1126
Link Here
|
1104 |
else if (connectStatus == null) |
1143 |
else if (connectStatus == null) |
1105 |
{ |
1144 |
{ |
1106 |
SystemBasePlugin.logError("Failed to connect to remote system", null); //$NON-NLS-1$ |
1145 |
SystemBasePlugin.logError("Failed to connect to remote system", null); //$NON-NLS-1$ |
1107 |
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_CONNECT_FAILED); |
1146 |
String msgTxt = NLS.bind(ConnectorServiceResources.MSG_COMM_CONNECT_FAILED, getHostName()); |
1108 |
msg.makeSubstitution(getHostName()); |
1147 |
String msgDetails = NLS.bind(ConnectorServiceResources.MSG_COMM_CONNECT_FAILED_DETAILS, getHostName()); |
|
|
1148 |
msg = createSystemMessage(IStatus.ERROR, msgTxt, msgDetails); |
1109 |
} |
1149 |
} |
1110 |
|
1150 |
|
1111 |
// if, for some reason, we don't have a message |
1151 |
// if, for some reason, we don't have a message |
1112 |
if (msg == null && connectStatus != null) |
1152 |
if (msg == null && connectStatus != null) |
1113 |
{ |
1153 |
{ |
1114 |
SystemBasePlugin.logError("Failed to connect to remote system" + connectStatus.getMessage(), null); //$NON-NLS-1$ |
1154 |
SystemBasePlugin.logError("Failed to connect to remote system" + connectStatus.getMessage(), null); //$NON-NLS-1$ |
1115 |
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_CONNECT_FAILED); |
1155 |
String msgTxt = NLS.bind(ConnectorServiceResources.MSG_COMM_CONNECT_FAILED, getHostName()); |
1116 |
msg.makeSubstitution(getHostName()); |
1156 |
String msgDetails = NLS.bind(ConnectorServiceResources.MSG_COMM_CONNECT_FAILED_DETAILS, getHostName()); |
|
|
1157 |
msg = createSystemMessage(IStatus.ERROR, msgTxt, msgDetails); |
1117 |
} |
1158 |
} |
1118 |
|
1159 |
|
1119 |
clientConnection.disconnect(); |
1160 |
clientConnection.disconnect(); |
1120 |
clientConnection = null; |
1161 |
clientConnection = null; |
1121 |
|
1162 |
|
1122 |
// yantzi: artemis 6.0, check for invalid login (user ID / pwd) and reprompt for signon information |
1163 |
// yantzi: artemis 6.0, check for invalid login (user ID / pwd) and reprompt for signon information |
1123 |
if (msg != null && msg.getFullMessageID().startsWith(ISystemMessages.MSG_COMM_INVALID_LOGIN)) |
1164 |
if (msg != null && msg.getLevelOneText().startsWith(NLS.bind(ConnectorServiceResources.MSG_COMM_INVALID_LOGIN, getHostName()))) |
1124 |
{ |
1165 |
{ |
1125 |
if (launchFailed) |
1166 |
if (launchFailed) |
1126 |
{ |
1167 |
{ |
Lines 1211-1217
Link Here
|
1211 |
String serverPort = (String)starter.launch(monitor); |
1252 |
String serverPort = (String)starter.launch(monitor); |
1212 |
if (monitor.isCanceled()) |
1253 |
if (monitor.isCanceled()) |
1213 |
{ |
1254 |
{ |
1214 |
SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_OPERATION_CANCELLED); |
1255 |
SystemMessage msg = createSystemMessage(IStatus.CANCEL, ConnectorServiceResources.MSG_OPERATION_CANCELLED); |
1215 |
throw new SystemMessageException(msg); |
1256 |
throw new SystemMessageException(msg); |
1216 |
} |
1257 |
} |
1217 |
|
1258 |
|
Lines 1329-1336
Link Here
|
1329 |
{ |
1370 |
{ |
1330 |
for (int idx = 0; idx < warnings.size(); idx++) |
1371 |
for (int idx = 0; idx < warnings.size(); idx++) |
1331 |
{ |
1372 |
{ |
1332 |
SystemMessage msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_GENERIC_W); |
1373 |
SystemMessage msg = createSystemMessage(IStatus.WARNING, warnings.elementAt(idx).toString()); |
1333 |
msg.makeSubstitution((warnings.elementAt(idx)).toString()); |
|
|
1334 |
SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg); |
1374 |
SystemMessageDialog msgDlg = new SystemMessageDialog(shell, msg); |
1335 |
msgDlg.open(); |
1375 |
msgDlg.open(); |
1336 |
} |
1376 |
} |
Lines 1384-1387
Link Here
|
1384 |
return result; |
1424 |
return result; |
1385 |
} |
1425 |
} |
1386 |
|
1426 |
|
|
|
1427 |
|
1428 |
protected SystemMessage createSystemMessage(int severity, String msg) { |
1429 |
return createSystemMessage(severity, msg, (String)null); |
1430 |
} |
1431 |
|
1432 |
protected SystemMessage createSystemMessage(int severity, String msg, Throwable e) { |
1433 |
return new SimpleSystemMessage(Activator.PLUGIN_ID, severity, msg, e); |
1434 |
} |
1435 |
|
1436 |
protected SystemMessage createSystemMessage(int severity, String msg, String msgDetails) { |
1437 |
return new SimpleSystemMessage(Activator.PLUGIN_ID, severity, msg, msgDetails); |
1438 |
} |
1387 |
} |
1439 |
} |
|
|
1440 |
|