mirror of
https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network.git
synced 2025-06-08 06:17:55 +08:00
[fix] 添加代理流量统计
This commit is contained in:
parent
556cb3fd1b
commit
0505d6d201
@ -2,22 +2,26 @@ package org.framework.lazy.cloud.network.heartbeat.server.netty.flow.proxy;
|
||||
|
||||
import io.netty.channel.Channel;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.proxy.AbstractHandleChannelProxyFlowAdvanced;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.ChannelFlow;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.advanced.flow.proxy.ChannelProxyFlow;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelFlowEnum;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProtocolType;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.enums.ChannelProxyType;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.properties.ServerNodeProperties;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.LazyProxyFlowApplication;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.LazyVisitorPortFlowApplication;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.visitor.flow.LazyVisitorPortFlowStoryCommand;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.standalone.application.command.lazy.proxy.flow.LazyProxyFlowStoryCommand;
|
||||
|
||||
/**
|
||||
* 进口流量处理
|
||||
*/
|
||||
public class ServerHandlerInProxyFlowHandler extends AbstractHandleChannelProxyFlowAdvanced {
|
||||
private final LazyVisitorPortFlowApplication lazyVisitorPortFlowApplication;
|
||||
private final LazyProxyFlowApplication lazyProxyFlowApplication;
|
||||
private final ServerNodeProperties serverNodeProperties;
|
||||
|
||||
public ServerHandlerInProxyFlowHandler(LazyVisitorPortFlowApplication lazyVisitorPortFlowApplication, ServerNodeProperties serverNodeProperties) {
|
||||
public ServerHandlerInProxyFlowHandler(LazyVisitorPortFlowApplication lazyVisitorPortFlowApplication, LazyProxyFlowApplication lazyProxyFlowApplication, ServerNodeProperties serverNodeProperties) {
|
||||
this.lazyVisitorPortFlowApplication = lazyVisitorPortFlowApplication;
|
||||
this.lazyProxyFlowApplication = lazyProxyFlowApplication;
|
||||
this.serverNodeProperties = serverNodeProperties;
|
||||
}
|
||||
|
||||
@ -45,15 +49,24 @@ public class ServerHandlerInProxyFlowHandler extends AbstractHandleChannelProxyF
|
||||
@Override
|
||||
protected void doHandler(Channel channel, ChannelProxyFlow channelProxyFlow) {
|
||||
String clientId = channelProxyFlow.clientId();
|
||||
String ip = channelProxyFlow.ip();
|
||||
Integer port = channelProxyFlow.port();
|
||||
Integer flow = channelProxyFlow.flow();
|
||||
ChannelProtocolType channelProtocolType = channelProxyFlow.channelProtocolType();
|
||||
ChannelProxyType channelProxyType = channelProxyFlow.channelProxyType();
|
||||
|
||||
// TODO
|
||||
// 进口流量处理
|
||||
LazyVisitorPortFlowStoryCommand visitorPortFlow = new LazyVisitorPortFlowStoryCommand();
|
||||
visitorPortFlow.setInFlow(flow);
|
||||
visitorPortFlow.setClientId(clientId);
|
||||
visitorPortFlow.setVisitorPort(port);
|
||||
visitorPortFlow.setIsDeleted(false);
|
||||
lazyVisitorPortFlowApplication.flowIncreaseStory(visitorPortFlow);
|
||||
LazyProxyFlowStoryCommand lazyProxyFlowStoryCommand = new LazyProxyFlowStoryCommand();
|
||||
lazyProxyFlowStoryCommand.setInFlow(flow);
|
||||
lazyProxyFlowStoryCommand.setClientId(clientId);
|
||||
lazyProxyFlowStoryCommand.setIp(ip);
|
||||
lazyProxyFlowStoryCommand.setPort(port);
|
||||
lazyProxyFlowStoryCommand.setProtocolType(channelProtocolType);
|
||||
lazyProxyFlowStoryCommand.setProxyType(channelProxyType);
|
||||
|
||||
lazyProxyFlowStoryCommand.setIsDeleted(false);
|
||||
lazyProxyFlowApplication.flowIncreaseStory(lazyProxyFlowStoryCommand);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,8 @@
|
||||
<!-- imageName用于设置生成的二进制文件名称 -->
|
||||
<imageName>${project.artifactId}</imageName>
|
||||
<!-- mainClass用于指定main方法类路径 -->
|
||||
<mainClass>org.framework.lazy.cloud.network.heartbeat.server.LazyCloudHeartbeatServerStart</mainClass>
|
||||
<mainClass>org.framework.lazy.cloud.network.heartbeat.server.LazyCloudHeartbeatServerStart
|
||||
</mainClass>
|
||||
<buildArgs>
|
||||
--no-fallback
|
||||
</buildArgs>
|
||||
|
Loading…
x
Reference in New Issue
Block a user