refactor: require identity resolver for jt1078 malformed rtp
This commit is contained in:
@@ -5,7 +5,6 @@ import com.lingniu.ingest.api.annotation.EventEmit;
|
||||
import com.lingniu.ingest.api.annotation.MessageMapping;
|
||||
import com.lingniu.ingest.api.annotation.ProtocolHandler;
|
||||
import com.lingniu.ingest.api.event.VehicleEvent;
|
||||
import com.lingniu.ingest.identity.StatelessVehicleIdentityResolver;
|
||||
import com.lingniu.ingest.identity.VehicleIdentity;
|
||||
import com.lingniu.ingest.identity.VehicleIdentityLookup;
|
||||
import com.lingniu.ingest.identity.VehicleIdentityResolver;
|
||||
@@ -17,6 +16,7 @@ import java.time.Instant;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
@ProtocolHandler(protocol = ProtocolId.JT1078)
|
||||
@@ -24,12 +24,8 @@ public final class Jt1078MalformedRtpHandler {
|
||||
|
||||
private final VehicleIdentityResolver identityResolver;
|
||||
|
||||
public Jt1078MalformedRtpHandler() {
|
||||
this(new StatelessVehicleIdentityResolver());
|
||||
}
|
||||
|
||||
public Jt1078MalformedRtpHandler(VehicleIdentityResolver identityResolver) {
|
||||
this.identityResolver = identityResolver == null ? new StatelessVehicleIdentityResolver() : identityResolver;
|
||||
this.identityResolver = Objects.requireNonNull(identityResolver, "identityResolver must not be null");
|
||||
}
|
||||
|
||||
@MessageMapping(command = Jt1078MediaMessageId.MALFORMED_RTP, desc = "JT1078 RTP 入口坏包兜底")
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.lingniu.ingest.protocol.jt1078.media;
|
||||
|
||||
import com.lingniu.ingest.api.ProtocolId;
|
||||
import com.lingniu.ingest.api.pipeline.RawFrame;
|
||||
import com.lingniu.ingest.identity.StatelessVehicleIdentityResolver;
|
||||
import com.lingniu.ingest.identity.VehicleIdentity;
|
||||
import com.lingniu.ingest.identity.VehicleIdentityLookup;
|
||||
import com.lingniu.ingest.identity.VehicleIdentityResolver;
|
||||
@@ -11,6 +10,7 @@ import com.lingniu.ingest.identity.VehicleIdentitySource;
|
||||
import java.time.Instant;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public final class Jt1078MalformedRtpEventPublisher {
|
||||
@@ -18,14 +18,10 @@ public final class Jt1078MalformedRtpEventPublisher {
|
||||
private final VehicleIdentityResolver identityResolver;
|
||||
private final Consumer<RawFrame> dispatcher;
|
||||
|
||||
public Jt1078MalformedRtpEventPublisher(Consumer<RawFrame> dispatcher) {
|
||||
this(new StatelessVehicleIdentityResolver(), dispatcher);
|
||||
}
|
||||
|
||||
public Jt1078MalformedRtpEventPublisher(VehicleIdentityResolver identityResolver,
|
||||
Consumer<RawFrame> dispatcher) {
|
||||
this.identityResolver = identityResolver == null ? new StatelessVehicleIdentityResolver() : identityResolver;
|
||||
this.dispatcher = dispatcher;
|
||||
this.identityResolver = Objects.requireNonNull(identityResolver, "identityResolver must not be null");
|
||||
this.dispatcher = Objects.requireNonNull(dispatcher, "dispatcher must not be null");
|
||||
}
|
||||
|
||||
public void publish(Jt1078MalformedRtpPacket malformed) {
|
||||
|
||||
Reference in New Issue
Block a user