Browse Source

Pull request #12910: REPORT-106402 websocket cbb ---报表适配

Merge in DESIGN/design from ~LEO.QIN/design:feature/x to feature/x

* commit '457e9a0a2c928d50598c81549f846c8b117e45ec':
  REPORT-106402 websocket cbb ---报表适配 【问题原因】rt 【改动思路】websocket cbb 包名、方法适配 https://kms.fineres.com/pages/viewpage.action?pageId=905125265
feature/x
Leo.Qin-覃宇攀 1 year ago
parent
commit
4cad0edfce
  1. 24
      designer-base/src/main/java/com/fr/design/login/socketio/LoginAuthServer.java
  2. 2
      designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java

24
designer-base/src/main/java/com/fr/design/login/socketio/LoginAuthServer.java

@ -1,5 +1,12 @@
package com.fr.design.login.socketio;
import com.fr.cbb.websocket.core.WebSocketAckRequest;
import com.fr.cbb.websocket.core.WebSocketClientProvider;
import com.fr.cbb.websocket.core.WebSocketConfiguration;
import com.fr.cbb.websocket.core.WebSocketServerProvider;
import com.fr.cbb.websocket.holder.EventHolder;
import com.fr.cbb.websocket.listener.AbstractDataListener;
import com.fr.cbb.websocket.core.WebSocketServerFactory;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.DesignerEnvManager;
import com.fr.design.login.DesignerLoginType;
@ -7,11 +14,6 @@ import com.fr.design.login.bean.BBSAccountLogin;
import com.fr.design.upm.event.CertificateEvent;
import com.fr.event.EventDispatcher;
import com.fr.log.FineLoggerFactory;
import com.fr.third.socketio.AckRequest;
import com.fr.third.socketio.Configuration;
import com.fr.third.socketio.SocketIOClient;
import com.fr.third.socketio.SocketIOServer;
import com.fr.third.socketio.listener.DataListener;
import java.net.URLDecoder;
import java.util.concurrent.ExecutorService;
@ -27,7 +29,7 @@ public class LoginAuthServer {
private AtomicBoolean started = new AtomicBoolean(false);
private SocketIOServer server;
private WebSocketServerProvider server;
private static final String HOSTNAME = "localhost";
private static final int PORT = 41925;
@ -46,10 +48,10 @@ public class LoginAuthServer {
}
private LoginAuthServer() {
Configuration config = new Configuration();
WebSocketConfiguration config = new WebSocketConfiguration();
config.setHostname(HOSTNAME);
config.setPort(PORT);
server = new SocketIOServer(config);
server = WebSocketServerFactory.registerWebSocketServer(config);
initEventListener();
}
@ -87,9 +89,9 @@ public class LoginAuthServer {
}
private void initEventListener() {
server.addEventListener("bbsAccountLogin", BBSAccountLogin.class, new DataListener<BBSAccountLogin>() {
server.addEventListener(EventHolder.build("bbsAccountLogin", BBSAccountLogin.class, new AbstractDataListener<BBSAccountLogin>() {
@Override
public void onData(SocketIOClient client, BBSAccountLogin data, AckRequest ackRequest) throws Exception {
public void onData(WebSocketClientProvider client, BBSAccountLogin data, WebSocketAckRequest ackRequest) throws Exception {
// 保存登录信息到.FineReport100配置中
int uid = data.getUid();
if (uid > 0) {
@ -106,6 +108,6 @@ public class LoginAuthServer {
EventDispatcher.fire(CertificateEvent.LOGIN, username);
}
}
});
}));
}
}

2
designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java

@ -1,5 +1,6 @@
package com.fr.start.server;
import com.fr.cbb.websocket.core.WebSocketEndpoint;
import com.fr.design.DesignerEnvManager;
import com.fr.log.FineLoggerFactory;
import com.fr.module.Activator;
@ -11,7 +12,6 @@ import com.fr.startup.FineWebApplicationInitializer;
import com.fr.third.guava.collect.Sets;
import com.fr.third.springframework.web.SpringServletContainerInitializer;
import com.fr.third.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import com.fr.web.socketio.WebSocketEndpoint;
import com.fr.workspace.WorkContext;
import org.apache.catalina.Context;
import org.apache.catalina.LifecycleException;

Loading…
Cancel
Save