From 39127c9789abcd88155a6b96b993406607a75f3c Mon Sep 17 00:00:00 2001 From: ju Date: Tue, 11 Sep 2018 10:01:06 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-11204=20=E5=90=8C=E4=B8=80=E8=B4=A6?= =?UTF-8?q?=E6=88=B7=E5=A4=9A=E5=A4=84=E7=99=BB=E5=BD=95=EF=BC=8C=E5=8C=BA?= =?UTF-8?q?=E5=88=86=E8=BF=9E=E6=8E=A5=E7=9A=84ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/env/DesignerWorkspaceInfo.java | 4 ++-- .../fr/design/env/LocalDesignerWorkspaceInfo.java | 7 ++----- .../fr/design/env/RemoteDesignerWorkspaceInfo.java | 12 ++++++------ .../main/java/com/fr/design/env/RemoteWorkspace.java | 6 +++--- .../java/com/fr/design/mainframe/DesignerFrame.java | 4 ++-- .../src/main/java/com/fr/env/RemoteEnvPane.java | 8 ++++---- .../design/mainframe/socketio/DesignerSocketIO.java | 2 +- 7 files changed, 20 insertions(+), 23 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfo.java index 09cfff5cf..2e5cc9f8c 100644 --- a/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfo.java @@ -1,7 +1,7 @@ package com.fr.design.env; import com.fr.stable.xml.XMLable; -import com.fr.workspace.connect.WorkspaceConnection; +import com.fr.workspace.connect.WorkspaceConnectionInfo; public interface DesignerWorkspaceInfo extends XMLable { DesignerWorkspaceType getType(); @@ -10,7 +10,7 @@ public interface DesignerWorkspaceInfo extends XMLable { String getPath(); - WorkspaceConnection getConnection(); + WorkspaceConnectionInfo getConnection(); boolean checkValid(); } diff --git a/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java index 7da0d9fe0..efba8a2df 100644 --- a/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java @@ -1,13 +1,10 @@ package com.fr.design.env; -import com.fr.base.EnvException; import com.fr.general.ComparatorUtils; -import com.fr.general.NameObject; -import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; -import com.fr.workspace.connect.WorkspaceConnection; +import com.fr.workspace.connect.WorkspaceConnectionInfo; import java.io.File; @@ -47,7 +44,7 @@ public class LocalDesignerWorkspaceInfo implements DesignerWorkspaceInfo { } @Override - public WorkspaceConnection getConnection() { + public WorkspaceConnectionInfo getConnection() { return null; } diff --git a/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java index fd8aa77dc..ffc80cb08 100644 --- a/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java @@ -5,15 +5,15 @@ import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; -import com.fr.workspace.connect.WorkspaceConnection; +import com.fr.workspace.connect.WorkspaceConnectionInfo; public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { private String name; - private WorkspaceConnection connection; + private WorkspaceConnectionInfo connection; - public static RemoteDesignerWorkspaceInfo create(WorkspaceConnection connection) { + public static RemoteDesignerWorkspaceInfo create(WorkspaceConnectionInfo connection) { RemoteDesignerWorkspaceInfo info = new RemoteDesignerWorkspaceInfo(); info.connection = connection; return info; @@ -38,7 +38,7 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { } @Override - public WorkspaceConnection getConnection() { + public WorkspaceConnectionInfo getConnection() { return connection; } @@ -58,7 +58,7 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { String password = SecurityToolbox.defaultDecrypt(reader.getAttrAsString("password", StringUtils.EMPTY).replaceAll(" ", "\r\n")); String certPath = reader.getAttrAsString("certPath", StringUtils.EMPTY); String certSecretKey = reader.getAttrAsString("certSecretKey", StringUtils.EMPTY); - this.connection = new WorkspaceConnection(url, username, password, certPath, certSecretKey); + this.connection = new WorkspaceConnectionInfo(url, username, password, certPath, certSecretKey); } } } @@ -83,7 +83,7 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { RemoteDesignerWorkspaceInfo object = (RemoteDesignerWorkspaceInfo) super.clone(); - object.connection = (WorkspaceConnection) StableUtils.cloneObject(this.connection); + object.connection = (WorkspaceConnectionInfo) StableUtils.cloneObject(this.connection); return object; } diff --git a/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java b/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java index 35bc5d82f..88b8fc572 100644 --- a/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java +++ b/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java @@ -5,7 +5,7 @@ import com.fr.stable.AssistUtils; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; import com.fr.workspace.connect.WorkspaceClient; -import com.fr.workspace.connect.WorkspaceConnection; +import com.fr.workspace.connect.WorkspaceConnectionInfo; import com.fr.workspace.server.authority.decision.DecisionOperator; /** @@ -18,9 +18,9 @@ public class RemoteWorkspace implements Workspace { private final String address; - private final WorkspaceConnection connection; + private final WorkspaceConnectionInfo connection; - RemoteWorkspace(WorkspaceClient client, WorkspaceConnection connection) { + RemoteWorkspace(WorkspaceClient client, WorkspaceConnectionInfo connection) { this.client = client; this.address = connection.getUrl(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 971834e89..ba41d2e9f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -57,7 +57,7 @@ import com.fr.stable.image4j.codec.ico.ICODecoder; import com.fr.stable.project.ProjectConstants; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; -import com.fr.workspace.connect.WorkspaceConnection; +import com.fr.workspace.connect.WorkspaceConnectionInfo; import javax.swing.Icon; import javax.swing.JComponent; @@ -747,7 +747,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta String username = null; if (info != null) { - WorkspaceConnection connection = info.getConnection(); + WorkspaceConnectionInfo connection = info.getConnection(); username = connection == null ? StringUtils.EMPTY : connection.getUserName(); } defaultTitleSB.append(username).append("@").append(envName).append("[").append(workspace.getDescription()).append("]"); diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index 9cdc2ae83..769c843cc 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -20,7 +20,7 @@ import com.fr.stable.StringUtils; import com.fr.third.guava.base.Strings; import com.fr.workspace.WorkContext; import com.fr.workspace.connect.AuthException; -import com.fr.workspace.connect.WorkspaceConnection; +import com.fr.workspace.connect.WorkspaceConnectionInfo; import javax.swing.BorderFactory; import javax.swing.BoxLayout; @@ -270,7 +270,7 @@ public class RemoteEnvPane extends BasicBeanPane { @Override public void populateBean(RemoteDesignerWorkspaceInfo ob) { - WorkspaceConnection connection = ob.getConnection(); + WorkspaceConnectionInfo connection = ob.getConnection(); if (connection != null) { this.remoteWorkspaceURL = Strings.isNullOrEmpty(connection.getUrl()) ? RemoteWorkspaceURL.createDefaultURL() @@ -303,7 +303,7 @@ public class RemoteEnvPane extends BasicBeanPane { @Override public RemoteDesignerWorkspaceInfo updateBean() { - WorkspaceConnection connection = new WorkspaceConnection( + WorkspaceConnectionInfo connection = new WorkspaceConnectionInfo( this.remoteWorkspaceURL.getURL(), this.usernameInput.getText(), new String(this.passwordInput.getPassword()), @@ -518,7 +518,7 @@ public class RemoteEnvPane extends BasicBeanPane { final RemoteDesignerWorkspaceInfo remoteEnv = updateBean(); - WorkspaceConnection connection = remoteEnv.getConnection(); + WorkspaceConnectionInfo connection = remoteEnv.getConnection(); DesignerEnvManager.getEnvManager().setCertificatePath(connection.getCertPath()); DesignerEnvManager.getEnvManager().setCertificatePass(connection.getCertSecretKey()); try { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index e9b12e7b1..7ce17da8f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -112,6 +112,6 @@ public class DesignerSocketIO { port, WorkspaceConstants.WS_NAMESPACE, DecisionServiceConstants.WEB_SOCKET_TOKEN_NAME, - RemoteCallClient.getInstance().getToken()); + RemoteCallClient.getInstance().getConnection()); } }