
org.bdware.doip.audit.writer.ServerContext Maven / Gradle / Ivy
package org.bdware.doip.audit.writer;
import io.netty.channel.ChannelHandlerContext;
public class ServerContext extends EndpointContext {
private final ChannelHandlerContext ctx;
private final String serviceDoid;
public ServerContext(ChannelHandlerContext ctx, String serviceDoid) {
this.ctx = ctx;
this.serviceDoid = serviceDoid;
}
public String getClientIP() {
try {
return extractIP(ctx.channel().remoteAddress());
} catch (Exception e) {
return null;
}
}
public String getClientDoId() {
return "unknown";
}
public String getServerIP() {
try {
return extractIP(ctx.channel().localAddress());
} catch (Exception e) {
return null;
}
}
public String getServerDoId() {
try {
return serviceDoid;
} catch (Exception e) {
return null;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy