Browse Source

REPORT-11204 同一账户多处登录,区分连接的ID

research/10.0
ju 6 years ago
parent
commit
39127c9789
  1. 4
      designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfo.java
  2. 7
      designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java
  3. 12
      designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java
  4. 6
      designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java
  5. 4
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  6. 8
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java
  7. 2
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

4
designer-base/src/main/java/com/fr/design/env/DesignerWorkspaceInfo.java vendored

@ -1,7 +1,7 @@
package com.fr.design.env; package com.fr.design.env;
import com.fr.stable.xml.XMLable; import com.fr.stable.xml.XMLable;
import com.fr.workspace.connect.WorkspaceConnection; import com.fr.workspace.connect.WorkspaceConnectionInfo;
public interface DesignerWorkspaceInfo extends XMLable { public interface DesignerWorkspaceInfo extends XMLable {
DesignerWorkspaceType getType(); DesignerWorkspaceType getType();
@ -10,7 +10,7 @@ public interface DesignerWorkspaceInfo extends XMLable {
String getPath(); String getPath();
WorkspaceConnection getConnection(); WorkspaceConnectionInfo getConnection();
boolean checkValid(); boolean checkValid();
} }

7
designer-base/src/main/java/com/fr/design/env/LocalDesignerWorkspaceInfo.java vendored

@ -1,13 +1,10 @@
package com.fr.design.env; package com.fr.design.env;
import com.fr.base.EnvException;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.NameObject;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
import com.fr.workspace.connect.WorkspaceConnection; import com.fr.workspace.connect.WorkspaceConnectionInfo;
import java.io.File; import java.io.File;
@ -47,7 +44,7 @@ public class LocalDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
} }
@Override @Override
public WorkspaceConnection getConnection() { public WorkspaceConnectionInfo getConnection() {
return null; return null;
} }

12
designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java vendored

@ -5,15 +5,15 @@ import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
import com.fr.workspace.connect.WorkspaceConnection; import com.fr.workspace.connect.WorkspaceConnectionInfo;
public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
private String name; 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(); RemoteDesignerWorkspaceInfo info = new RemoteDesignerWorkspaceInfo();
info.connection = connection; info.connection = connection;
return info; return info;
@ -38,7 +38,7 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
} }
@Override @Override
public WorkspaceConnection getConnection() { public WorkspaceConnectionInfo getConnection() {
return connection; return connection;
} }
@ -58,7 +58,7 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
String password = SecurityToolbox.defaultDecrypt(reader.getAttrAsString("password", StringUtils.EMPTY).replaceAll(" ", "\r\n")); String password = SecurityToolbox.defaultDecrypt(reader.getAttrAsString("password", StringUtils.EMPTY).replaceAll(" ", "\r\n"));
String certPath = reader.getAttrAsString("certPath", StringUtils.EMPTY); String certPath = reader.getAttrAsString("certPath", StringUtils.EMPTY);
String certSecretKey = reader.getAttrAsString("certSecretKey", 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(); RemoteDesignerWorkspaceInfo object = (RemoteDesignerWorkspaceInfo) super.clone();
object.connection = (WorkspaceConnection) StableUtils.cloneObject(this.connection); object.connection = (WorkspaceConnectionInfo) StableUtils.cloneObject(this.connection);
return object; return object;
} }

6
designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java vendored

@ -5,7 +5,7 @@ import com.fr.stable.AssistUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace; import com.fr.workspace.Workspace;
import com.fr.workspace.connect.WorkspaceClient; 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; import com.fr.workspace.server.authority.decision.DecisionOperator;
/** /**
@ -18,9 +18,9 @@ public class RemoteWorkspace implements Workspace {
private final String address; 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.client = client;
this.address = connection.getUrl(); this.address = connection.getUrl();

4
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.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace; import com.fr.workspace.Workspace;
import com.fr.workspace.connect.WorkspaceConnection; import com.fr.workspace.connect.WorkspaceConnectionInfo;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JComponent; import javax.swing.JComponent;
@ -747,7 +747,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
String username = null; String username = null;
if (info != null) { if (info != null) {
WorkspaceConnection connection = info.getConnection(); WorkspaceConnectionInfo connection = info.getConnection();
username = connection == null ? StringUtils.EMPTY : connection.getUserName(); username = connection == null ? StringUtils.EMPTY : connection.getUserName();
} }
defaultTitleSB.append(username).append("@").append(envName).append("[").append(workspace.getDescription()).append("]"); defaultTitleSB.append(username).append("@").append(envName).append("[").append(workspace.getDescription()).append("]");

8
designer-base/src/main/java/com/fr/env/RemoteEnvPane.java vendored

@ -20,7 +20,7 @@ import com.fr.stable.StringUtils;
import com.fr.third.guava.base.Strings; import com.fr.third.guava.base.Strings;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.connect.AuthException; 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.BorderFactory;
import javax.swing.BoxLayout; import javax.swing.BoxLayout;
@ -270,7 +270,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
@Override @Override
public void populateBean(RemoteDesignerWorkspaceInfo ob) { public void populateBean(RemoteDesignerWorkspaceInfo ob) {
WorkspaceConnection connection = ob.getConnection(); WorkspaceConnectionInfo connection = ob.getConnection();
if (connection != null) { if (connection != null) {
this.remoteWorkspaceURL = Strings.isNullOrEmpty(connection.getUrl()) this.remoteWorkspaceURL = Strings.isNullOrEmpty(connection.getUrl())
? RemoteWorkspaceURL.createDefaultURL() ? RemoteWorkspaceURL.createDefaultURL()
@ -303,7 +303,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
@Override @Override
public RemoteDesignerWorkspaceInfo updateBean() { public RemoteDesignerWorkspaceInfo updateBean() {
WorkspaceConnection connection = new WorkspaceConnection( WorkspaceConnectionInfo connection = new WorkspaceConnectionInfo(
this.remoteWorkspaceURL.getURL(), this.remoteWorkspaceURL.getURL(),
this.usernameInput.getText(), this.usernameInput.getText(),
new String(this.passwordInput.getPassword()), new String(this.passwordInput.getPassword()),
@ -518,7 +518,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
final RemoteDesignerWorkspaceInfo remoteEnv = updateBean(); final RemoteDesignerWorkspaceInfo remoteEnv = updateBean();
WorkspaceConnection connection = remoteEnv.getConnection(); WorkspaceConnectionInfo connection = remoteEnv.getConnection();
DesignerEnvManager.getEnvManager().setCertificatePath(connection.getCertPath()); DesignerEnvManager.getEnvManager().setCertificatePath(connection.getCertPath());
DesignerEnvManager.getEnvManager().setCertificatePass(connection.getCertSecretKey()); DesignerEnvManager.getEnvManager().setCertificatePass(connection.getCertSecretKey());
try { try {

2
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -112,6 +112,6 @@ public class DesignerSocketIO {
port, port,
WorkspaceConstants.WS_NAMESPACE, WorkspaceConstants.WS_NAMESPACE,
DecisionServiceConstants.WEB_SOCKET_TOKEN_NAME, DecisionServiceConstants.WEB_SOCKET_TOKEN_NAME,
RemoteCallClient.getInstance().getToken()); RemoteCallClient.getInstance().getConnection());
} }
} }

Loading…
Cancel
Save