package com.l7tech.gateway.common.cluster;

import com.l7tech.gateway.common.audit.AuditType;
import com.l7tech.objectmodel.Goid;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;

public final class LogRequest {
   private final String a;
   private long b;
   private long c;
   private final Date d;
   private Date e;
   private final Level f;
   private final String g;
   private final String h;
   private final String i;
   private final AuditType j;
   private final String k;
   private final String l;
   private final Integer m;
   private final String n;
   private final String o;
   private final Goid p;
   private int q;
   private final boolean r;
   private final String s;
   private final Map<String, Long> t = new HashMap<>();
   private final Map<String, Long> u = new HashMap<>();

   private LogRequest(LogRequest.Builder var1) {
      this.a = var1.a;
      this.c = var1.c;
      this.b = var1.b;
      this.d = var1.d;
      this.e = var1.e;
      this.f = var1.f;
      this.g = var1.g;
      this.h = var1.h;
      this.i = var1.i;
      this.j = var1.j;
      this.k = var1.k;
      this.l = var1.l;
      this.m = var1.n;
      this.n = var1.o;
      this.o = var1.p;
      this.p = var1.q;
      this.r = var1.m;
      this.s = var1.r;
      this.q = 0;
   }

   public int getRetrievedLogCount() {
      return this.q;
   }

   public void setRetrievedLogCount(int var1) {
      this.q = var1;
   }

   public void addRetrievedLogCount(int var1) {
      this.q += var1;
   }

   public long getEndMsgNumber() {
      return this.c;
   }

   public void setEndMsgNumberForNode(String var1, long var2) {
      this.u.put(var1, var2);
   }

   public Map<String, Long> getNodeIdToEndMsg() {
      return Collections.unmodifiableMap(this.u);
   }

   public long getStartMsgNumber() {
      return this.b;
   }

   public void setStartMsgNumber(long var1) {
      this.b = var1;
   }

   public void setStartTimestampForNode(String var1, long var2) {
      this.t.put(var1, var2);
   }

   public Map<String, Long> getNodeIdToStartTimestamp() {
      return Collections.unmodifiableMap(this.t);
   }

   public Date getStartMsgDate() {
      return this.d;
   }

   public Date getEndMsgDate() {
      return this.e;
   }

   public void setEndMsgDate(Date var1) {
      this.e = var1;
   }

   public String getNodeName() {
      return this.a;
   }

   public Level getLogLevel() {
      return this.f;
   }

   public String getServiceName() {
      return this.g;
   }

   public String getMessage() {
      return this.h;
   }

   public String getRequestId() {
      return this.i;
   }

   public AuditType getAuditType() {
      return this.j;
   }

   public Goid getEntityId() {
      return this.p;
   }

   public String getEntityClassName() {
      return this.o;
   }

   public Integer getMessageId() {
      return this.m;
   }

   public String getParamValue() {
      return this.n;
   }

   public String getUserIdOrDn() {
      return this.l;
   }

   public String getUserName() {
      return this.k;
   }

   public boolean isGetFromPolicy() {
      return this.r;
   }

   public String getOperation() {
      return this.s;
   }

   public static class Builder {
      private String a = null;
      private long b = -1L;
      private long c = -1L;
      private Date d = null;
      private Date e = null;
      private Level f = Level.WARNING;
      private String g = null;
      private String h = null;
      private String i = null;
      private AuditType j = AuditType.ALL;
      private String k;
      private String l;
      private boolean m;
      private Integer n;
      private String o;
      private String p;
      private Goid q;
      private String r = null;

      public LogRequest.Builder nodeName(String var1) {
         this.a = var1;
         return this;
      }

      public LogRequest.Builder startMsgNumber(long var1) {
         this.b = var1;
         return this;
      }

      public LogRequest.Builder endMsgNumber(long var1) {
         this.c = var1;
         return this;
      }

      public LogRequest.Builder startMsgDate(Date var1) {
         this.d = var1;
         return this;
      }

      public LogRequest.Builder endMsgDate(Date var1) {
         this.e = var1;
         return this;
      }

      public LogRequest.Builder logLevel(Level var1) {
         this.f = var1;
         return this;
      }

      public LogRequest.Builder serviceName(String var1) {
         this.g = var1;
         return this;
      }

      public LogRequest.Builder message(String var1) {
         this.h = var1;
         return this;
      }

      public LogRequest.Builder requestId(String var1) {
         this.i = var1;
         return this;
      }

      public LogRequest.Builder auditType(AuditType var1) {
         this.j = var1;
         return this;
      }

      public LogRequest.Builder userName(String var1) {
         this.k = var1;
         return this;
      }

      public LogRequest.Builder userIdOrDn(String var1) {
         this.l = var1;
         return this;
      }

      public LogRequest.Builder messageId(Integer var1) {
         this.n = var1;
         return this;
      }

      public LogRequest.Builder paramValue(String var1) {
         this.o = var1;
         return this;
      }

      public LogRequest.Builder entityClassName(String var1) {
         this.p = var1;
         return this;
      }

      public LogRequest.Builder entityId(Goid var1) {
         this.q = var1;
         return this;
      }

      public LogRequest.Builder operation(String var1) {
         this.r = var1;
         return this;
      }

      public LogRequest.Builder getFromPolicy(boolean var1) {
         this.m = var1;
         return this;
      }

      public LogRequest build() {
         return new LogRequest(this);
      }
   }
}
