Рефакторинг

This commit is contained in:
serega6531
2020-04-14 22:35:33 +03:00
parent 01a3c0e512
commit d975f425f8
13 changed files with 29 additions and 33 deletions

View File

@@ -17,8 +17,8 @@ public class CountingService {
private final SubscriptionService subscriptionService;
private Map<Integer, Counter> servicesPackets = new HashMap<>();
private Map<Integer, Counter> servicesStreams = new HashMap<>();
private final Map<Integer, Counter> servicesPackets = new HashMap<>();
private final Map<Integer, Counter> servicesStreams = new HashMap<>();
private Counter totalPackets = new Counter();
private Counter totalStreams = new Counter();

View File

@@ -32,15 +32,9 @@ class PatternMatcher {
private void match(Pattern pattern) {
switch (pattern.getSearchType()) {
case REGEX:
matchRegex(pattern);
break;
case SUBSTRING:
matchSubstring(pattern);
break;
case SUBBYTES:
matchSubbytes(pattern);
break;
case REGEX -> matchRegex(pattern);
case SUBSTRING -> matchSubstring(pattern);
case SUBBYTES -> matchSubbytes(pattern);
}
}

View File

@@ -15,7 +15,7 @@ import java.util.List;
@AllArgsConstructor
public class HttpChunksProcessor {
private List<Packet> packets;
private final List<Packet> packets;
public void processChunkedEncoding() {
boolean chunkStarted = false;

View File

@@ -22,7 +22,7 @@ public class HttpGzipProcessor {
private static final byte[] GZIP_HEADER = {0x1f, (byte) 0x8b, 0x08};
private List<Packet> packets;
private final List<Packet> packets;
/**
* Попытаться распаковать GZIP из исходящих http пакетов. <br>

View File

@@ -13,7 +13,7 @@ import java.util.List;
@Slf4j
public class HttpUrldecodeProcessor {
private List<Packet> packets;
private final List<Packet> packets;
/**
* Декодирование urlencode с http пакета до смены стороны или окончания стрима

View File

@@ -9,7 +9,7 @@ import java.util.List;
@AllArgsConstructor
public class PacketsMerger {
private List<Packet> packets;
private final List<Packet> packets;
/**
* Сжать соседние пакеты в одном направлении в один.