package com.l7tech.server.wsdm;

import com.l7tech.gateway.common.service.MetricsBin;
import com.l7tech.gateway.common.service.MetricsSummaryBin;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.PersistentEntity;
import com.l7tech.server.service.ServiceManager;
import com.l7tech.server.service.ServiceMetricsManager;
import com.l7tech.server.service.ServiceMetricsServices;
import com.l7tech.server.wsdm.subscription.ServiceStateMonitor;
import jakarta.annotation.PostConstruct;
import jakarta.inject.Inject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Aggregator implements ServiceStateMonitor {
   private final Logger a = Logger.getLogger(Aggregator.class.getName());
   private final ReadWriteLock b = new ReentrantReadWriteLock();
   private final Map<Goid, MetricsSummaryBin> c = new HashMap<>();
   private Map<Goid, MetricsSummaryBin> d;
   private long e;
   private long f = 0L;
   @Inject
   private ServiceManager serviceManager;
   @Inject
   private ServiceMetricsManager metricsManager;
   @Inject
   private ServiceMetricsServices metricsServices;
   private static final String[] g;

   @PostConstruct
   public void start() {
      this.a();
   }

   @Override
   public void onServiceDisabled(Goid var1) {
      this.a(var1);
   }

   @Override
   public void onServiceEnabled(Goid var1) {
      this.a(var1);
   }

   @Override
   public void onServiceCreated(Goid var1) {
      this.b.writeLock().lock();

      try {
         MetricsBin var2 = new MetricsBin();
         var2.setServiceGoid(var1);
         ArrayList var3 = new ArrayList(1);
         var3.add(var2);
         MetricsSummaryBin var4 = new MetricsSummaryBin(var3);
         this.c.put(var1, var4);
      } finally {
         this.b.writeLock().unlock();
      }
   }

   @Override
   public void onServiceDeleted(Goid var1) {
      this.b.writeLock().lock();

      try {
         this.c.remove(var1);
      } finally {
         this.b.writeLock().unlock();
      }
   }

   public Map<Goid, MetricsSummaryBin> getMetricsForServices() {
      this.b.writeLock().lock();

      try {
         return this.a(false);
      } finally {
         this.b.writeLock().unlock();
      }
   }

   private Map<Goid, MetricsSummaryBin> a(boolean param1) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 000: new java/util/HashMap
      // 003: dup
      // 004: invokespecial java/util/HashMap.<init> ()V
      // 007: astore 2
      // 008: bipush 0
      // 009: aload 0
      // 00a: getfield com/l7tech/server/wsdm/Aggregator.metricsServices Lcom/l7tech/server/service/ServiceMetricsServices;
      // 00d: invokeinterface com/l7tech/server/service/ServiceMetricsServices.getFineInterval ()I 1
      // 012: aload 0
      // 013: getfield com/l7tech/server/wsdm/Aggregator.f J
      // 016: invokestatic com/l7tech/gateway/common/service/MetricsBin.periodStartFor (IIJ)J
      // 019: lstore 3
      // 01a: aload 0
      // 01b: getfield com/l7tech/server/wsdm/Aggregator.c Ljava/util/Map;
      // 01e: invokeinterface java/util/Map.size ()I 1
      // 023: ifne 02f
      // 026: bipush 0
      // 027: anewarray 101
      // 02a: astore 5
      // 02c: goto 04e
      // 02f: aload 0
      // 030: getfield com/l7tech/server/wsdm/Aggregator.c Ljava/util/Map;
      // 033: invokeinterface java/util/Map.keySet ()Ljava/util/Set; 1
      // 038: aload 0
      // 039: getfield com/l7tech/server/wsdm/Aggregator.c Ljava/util/Map;
      // 03c: invokeinterface java/util/Map.size ()I 1
      // 041: anewarray 101
      // 044: invokeinterface java/util/Set.toArray ([Ljava/lang/Object;)[Ljava/lang/Object; 2
      // 049: checkcast [Lcom/l7tech/objectmodel/Goid;
      // 04c: astore 5
      // 04e: invokestatic java/lang/System.currentTimeMillis ()J
      // 051: lload 3
      // 052: lsub
      // 053: getstatic com/l7tech/util/TimeUnit.HOURS Lcom/l7tech/util/TimeUnit;
      // 056: lconst_1
      // 057: invokevirtual com/l7tech/util/TimeUnit.toMillis (J)J
      // 05a: lcmp
      // 05b: ifle 0d6
      // 05e: aload 0
      // 05f: invokevirtual com/l7tech/server/wsdm/Aggregator.a ()V
      // 062: aload 0
      // 063: getfield com/l7tech/server/wsdm/Aggregator.c Ljava/util/Map;
      // 066: invokeinterface java/util/Map.entrySet ()Ljava/util/Set; 1
      // 06b: invokeinterface java/util/Set.iterator ()Ljava/util/Iterator; 1
      // 070: astore 6
      // 072: aload 6
      // 074: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 079: ifeq 0d3
      // 07c: aload 6
      // 07e: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 083: checkcast java/util/Map$Entry
      // 086: astore 7
      // 088: aload 7
      // 08a: invokeinterface java/util/Map$Entry.getKey ()Ljava/lang/Object; 1
      // 08f: checkcast com/l7tech/objectmodel/Goid
      // 092: invokestatic com/l7tech/objectmodel/Goid.isDefault (Lcom/l7tech/objectmodel/Goid;)Z
      // 095: ifne 0b7
      // 098: aload 0
      // 099: aload 0
      // 09a: getfield com/l7tech/server/wsdm/Aggregator.f J
      // 09d: aload 7
      // 09f: invokeinterface java/util/Map$Entry.getValue ()Ljava/lang/Object; 1
      // 0a4: checkcast com/l7tech/gateway/common/service/MetricsSummaryBin
      // 0a7: invokevirtual com/l7tech/gateway/common/service/MetricsSummaryBin.getPeriodEnd ()J
      // 0aa: invokestatic java/lang/Math.max (JJ)J
      // 0ad: putfield com/l7tech/server/wsdm/Aggregator.f J
      // 0b0: goto 0b7
      // 0b3: invokestatic com/l7tech/server/wsdm/Aggregator.a (Lcom/l7tech/objectmodel/FindException;)Lcom/l7tech/objectmodel/FindException;
      // 0b6: athrow
      // 0b7: aload 2
      // 0b8: aload 7
      // 0ba: invokeinterface java/util/Map$Entry.getKey ()Ljava/lang/Object; 1
      // 0bf: checkcast com/l7tech/objectmodel/Goid
      // 0c2: aload 7
      // 0c4: invokeinterface java/util/Map$Entry.getValue ()Ljava/lang/Object; 1
      // 0c9: checkcast com/l7tech/gateway/common/service/MetricsSummaryBin
      // 0cc: invokevirtual java/util/HashMap.put (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      // 0cf: pop
      // 0d0: goto 072
      // 0d3: goto 226
      // 0d6: aload 0
      // 0d7: getfield com/l7tech/server/wsdm/Aggregator.metricsManager Lcom/l7tech/server/service/ServiceMetricsManager;
      // 0da: aconst_null
      // 0db: bipush 0
      // 0dc: invokestatic java/lang/Integer.valueOf (I)Ljava/lang/Integer;
      // 0df: lload 3
      // 0e0: invokestatic java/lang/Long.valueOf (J)Ljava/lang/Long;
      // 0e3: aconst_null
      // 0e4: aload 5
      // 0e6: iload 1
      // 0e7: invokeinterface com/l7tech/server/service/ServiceMetricsManager.summarizeByService (Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;[Lcom/l7tech/objectmodel/Goid;Z)Ljava/util/Map; 7
      // 0ec: astore 6
      // 0ee: aload 6
      // 0f0: invokeinterface java/util/Map.entrySet ()Ljava/util/Set; 1
      // 0f5: invokeinterface java/util/Set.iterator ()Ljava/util/Iterator; 1
      // 0fa: astore 7
      // 0fc: aload 7
      // 0fe: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 103: ifeq 226
      // 106: aload 7
      // 108: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 10d: checkcast java/util/Map$Entry
      // 110: astore 8
      // 112: aload 0
      // 113: getfield com/l7tech/server/wsdm/Aggregator.c Ljava/util/Map;
      // 116: aload 8
      // 118: invokeinterface java/util/Map$Entry.getKey ()Ljava/lang/Object; 1
      // 11d: invokeinterface java/util/Map.get (Ljava/lang/Object;)Ljava/lang/Object; 2
      // 122: checkcast com/l7tech/gateway/common/service/MetricsSummaryBin
      // 125: astore 9
      // 127: aload 9
      // 129: ifnonnull 19c
      // 12c: aload 8
      // 12e: invokeinterface java/util/Map$Entry.getKey ()Ljava/lang/Object; 1
      // 133: checkcast com/l7tech/objectmodel/Goid
      // 136: invokestatic com/l7tech/objectmodel/Goid.isDefault (Lcom/l7tech/objectmodel/Goid;)Z
      // 139: ifne 180
      // 13c: goto 143
      // 13f: invokestatic com/l7tech/server/wsdm/Aggregator.a (Lcom/l7tech/objectmodel/FindException;)Lcom/l7tech/objectmodel/FindException;
      // 142: athrow
      // 143: aload 0
      // 144: getfield com/l7tech/server/wsdm/Aggregator.c Ljava/util/Map;
      // 147: aload 8
      // 149: invokeinterface java/util/Map$Entry.getKey ()Ljava/lang/Object; 1
      // 14e: checkcast com/l7tech/objectmodel/Goid
      // 151: aload 8
      // 153: invokeinterface java/util/Map$Entry.getValue ()Ljava/lang/Object; 1
      // 158: checkcast com/l7tech/gateway/common/service/MetricsSummaryBin
      // 15b: invokeinterface java/util/Map.put (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; 3
      // 160: pop
      // 161: aload 0
      // 162: aload 0
      // 163: getfield com/l7tech/server/wsdm/Aggregator.f J
      // 166: aload 8
      // 168: invokeinterface java/util/Map$Entry.getValue ()Ljava/lang/Object; 1
      // 16d: checkcast com/l7tech/gateway/common/service/MetricsSummaryBin
      // 170: invokevirtual com/l7tech/gateway/common/service/MetricsSummaryBin.getPeriodEnd ()J
      // 173: invokestatic java/lang/Math.max (JJ)J
      // 176: putfield com/l7tech/server/wsdm/Aggregator.f J
      // 179: goto 180
      // 17c: invokestatic com/l7tech/server/wsdm/Aggregator.a (Lcom/l7tech/objectmodel/FindException;)Lcom/l7tech/objectmodel/FindException;
      // 17f: athrow
      // 180: aload 2
      // 181: aload 8
      // 183: invokeinterface java/util/Map$Entry.getKey ()Ljava/lang/Object; 1
      // 188: checkcast com/l7tech/objectmodel/Goid
      // 18b: aload 8
      // 18d: invokeinterface java/util/Map$Entry.getValue ()Ljava/lang/Object; 1
      // 192: checkcast com/l7tech/gateway/common/service/MetricsSummaryBin
      // 195: invokevirtual java/util/HashMap.put (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      // 198: pop
      // 199: goto 223
      // 19c: new java/util/ArrayList
      // 19f: dup
      // 1a0: bipush 2
      // 1a1: invokespecial java/util/ArrayList.<init> (I)V
      // 1a4: astore 10
      // 1a6: aload 10
      // 1a8: aload 9
      // 1aa: invokeinterface java/util/List.add (Ljava/lang/Object;)Z 2
      // 1af: pop
      // 1b0: aload 10
      // 1b2: aload 8
      // 1b4: invokeinterface java/util/Map$Entry.getValue ()Ljava/lang/Object; 1
      // 1b9: checkcast com/l7tech/gateway/common/service/MetricsBin
      // 1bc: invokeinterface java/util/List.add (Ljava/lang/Object;)Z 2
      // 1c1: pop
      // 1c2: new com/l7tech/gateway/common/service/MetricsSummaryBin
      // 1c5: dup
      // 1c6: aload 10
      // 1c8: invokespecial com/l7tech/gateway/common/service/MetricsSummaryBin.<init> (Ljava/util/Collection;)V
      // 1cb: astore 11
      // 1cd: aload 8
      // 1cf: invokeinterface java/util/Map$Entry.getKey ()Ljava/lang/Object; 1
      // 1d4: checkcast com/l7tech/objectmodel/Goid
      // 1d7: invokestatic com/l7tech/objectmodel/Goid.isDefault (Lcom/l7tech/objectmodel/Goid;)Z
      // 1da: ifne 212
      // 1dd: aload 0
      // 1de: getfield com/l7tech/server/wsdm/Aggregator.c Ljava/util/Map;
      // 1e1: aload 8
      // 1e3: invokeinterface java/util/Map$Entry.getKey ()Ljava/lang/Object; 1
      // 1e8: checkcast com/l7tech/objectmodel/Goid
      // 1eb: aload 11
      // 1ed: invokeinterface java/util/Map.put (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; 3
      // 1f2: pop
      // 1f3: aload 0
      // 1f4: aload 0
      // 1f5: getfield com/l7tech/server/wsdm/Aggregator.f J
      // 1f8: aload 8
      // 1fa: invokeinterface java/util/Map$Entry.getValue ()Ljava/lang/Object; 1
      // 1ff: checkcast com/l7tech/gateway/common/service/MetricsSummaryBin
      // 202: invokevirtual com/l7tech/gateway/common/service/MetricsSummaryBin.getPeriodEnd ()J
      // 205: invokestatic java/lang/Math.max (JJ)J
      // 208: putfield com/l7tech/server/wsdm/Aggregator.f J
      // 20b: goto 212
      // 20e: invokestatic com/l7tech/server/wsdm/Aggregator.a (Lcom/l7tech/objectmodel/FindException;)Lcom/l7tech/objectmodel/FindException;
      // 211: athrow
      // 212: aload 2
      // 213: aload 8
      // 215: invokeinterface java/util/Map$Entry.getKey ()Ljava/lang/Object; 1
      // 21a: checkcast com/l7tech/objectmodel/Goid
      // 21d: aload 11
      // 21f: invokevirtual java/util/HashMap.put (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      // 222: pop
      // 223: goto 0fc
      // 226: aload 2
      // 227: areturn
      // 228: astore 2
      // 229: aload 0
      // 22a: getfield com/l7tech/server/wsdm/Aggregator.a Ljava/util/logging/Logger;
      // 22d: getstatic java/util/logging/Level.WARNING Ljava/util/logging/Level;
      // 230: getstatic com/l7tech/server/wsdm/Aggregator.g [Ljava/lang/String;
      // 233: bipush 3
      // 234: aaload
      // 235: aload 2
      // 236: invokevirtual java/util/logging/Logger.log (Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
      // 239: new java/util/HashMap
      // 23c: dup
      // 23d: invokespecial java/util/HashMap.<init> ()V
      // 240: areturn
      // try (172 -> 194): 195 com/l7tech/objectmodel/FindException
      // try (112 -> 139): 140 com/l7tech/objectmodel/FindException
      // try (110 -> 117): 118 com/l7tech/objectmodel/FindException
      // try (52 -> 66): 67 com/l7tech/objectmodel/FindException
      // try (0 -> 206): 207 com/l7tech/objectmodel/FindException
   }

   private void a(Goid var1) {
      this.metricsServices.trackServiceMetrics(var1);
   }

   public MetricsSummaryBin getMetricsForService(Goid var1) {
      this.b.writeLock().lock();

      try {
         if (this.c.containsKey(var1)) {
            if (System.currentTimeMillis() - this.f <= this.metricsServices.getFineInterval()) {
               return this.c.get(var1);
            }

            this.a(true);
            return this.c.get(var1);
         } else if (this.serviceManager.findByPrimaryKey(var1) != null) {
            Map var2 = this.a(true);
            return var2.containsKey(var1) ? (MetricsSummaryBin)var2.get(var1) : (MetricsSummaryBin)var2.get(PersistentEntity.DEFAULT_GOID);
         } else {
            return null;
         }
      } catch (FindException var7) {
         this.a.log(Level.WARNING, g[1] + var1, var7);
         return null;
      } finally {
         this.b.writeLock().unlock();
      }
   }

   private void a() {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 000: aload 0
      // 001: getfield com/l7tech/server/wsdm/Aggregator.metricsManager Lcom/l7tech/server/service/ServiceMetricsManager;
      // 004: ifnonnull 01b
      // 007: aload 0
      // 008: getfield com/l7tech/server/wsdm/Aggregator.a Ljava/util/logging/Logger;
      // 00b: getstatic java/util/logging/Level.WARNING Ljava/util/logging/Level;
      // 00e: getstatic com/l7tech/server/wsdm/Aggregator.g [Ljava/lang/String;
      // 011: bipush 0
      // 012: aaload
      // 013: invokevirtual java/util/logging/Logger.log (Ljava/util/logging/Level;Ljava/lang/String;)V
      // 016: return
      // 017: invokestatic com/l7tech/server/wsdm/Aggregator.a (Lcom/l7tech/objectmodel/FindException;)Lcom/l7tech/objectmodel/FindException;
      // 01a: athrow
      // 01b: aload 0
      // 01c: getfield com/l7tech/server/wsdm/Aggregator.d Ljava/util/Map;
      // 01f: ifnull 03c
      // 022: invokestatic java/lang/System.currentTimeMillis ()J
      // 025: aload 0
      // 026: getfield com/l7tech/server/wsdm/Aggregator.e J
      // 029: lsub
      // 02a: getstatic com/l7tech/util/TimeUnit.DAYS Lcom/l7tech/util/TimeUnit;
      // 02d: lconst_1
      // 02e: invokevirtual com/l7tech/util/TimeUnit.toMillis (J)J
      // 031: lcmp
      // 032: iflt 059
      // 035: goto 03c
      // 038: invokestatic com/l7tech/server/wsdm/Aggregator.a (Lcom/l7tech/objectmodel/FindException;)Lcom/l7tech/objectmodel/FindException;
      // 03b: athrow
      // 03c: aload 0
      // 03d: aload 0
      // 03e: getfield com/l7tech/server/wsdm/Aggregator.metricsManager Lcom/l7tech/server/service/ServiceMetricsManager;
      // 041: aconst_null
      // 042: bipush 2
      // 043: invokestatic java/lang/Integer.valueOf (I)Ljava/lang/Integer;
      // 046: aconst_null
      // 047: aconst_null
      // 048: aconst_null
      // 049: bipush 0
      // 04a: invokeinterface com/l7tech/server/service/ServiceMetricsManager.summarizeByService (Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;[Lcom/l7tech/objectmodel/Goid;Z)Ljava/util/Map; 7
      // 04f: putfield com/l7tech/server/wsdm/Aggregator.d Ljava/util/Map;
      // 052: goto 059
      // 055: invokestatic com/l7tech/server/wsdm/Aggregator.a (Lcom/l7tech/objectmodel/FindException;)Lcom/l7tech/objectmodel/FindException;
      // 058: athrow
      // 059: aload 0
      // 05a: getfield com/l7tech/server/wsdm/Aggregator.serviceManager Lcom/l7tech/server/service/ServiceManager;
      // 05d: invokeinterface com/l7tech/server/service/ServiceManager.findAll ()Ljava/util/Collection; 1
      // 062: astore 1
      // 063: aload 1
      // 064: invokeinterface java/util/Collection.iterator ()Ljava/util/Iterator; 1
      // 069: astore 2
      // 06a: aload 2
      // 06b: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 070: ifeq 239
      // 073: aload 2
      // 074: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 079: checkcast com/l7tech/gateway/common/service/PublishedService
      // 07c: astore 3
      // 07d: aload 0
      // 07e: getfield com/l7tech/server/wsdm/Aggregator.d Ljava/util/Map;
      // 081: aload 3
      // 082: invokevirtual com/l7tech/gateway/common/service/PublishedService.getGoid ()Lcom/l7tech/objectmodel/Goid;
      // 085: invokeinterface java/util/Map.get (Ljava/lang/Object;)Ljava/lang/Object; 2
      // 08a: checkcast com/l7tech/gateway/common/service/MetricsSummaryBin
      // 08d: astore 4
      // 08f: aload 4
      // 091: ifnonnull 0c1
      // 094: aload 0
      // 095: getfield com/l7tech/server/wsdm/Aggregator.metricsManager Lcom/l7tech/server/service/ServiceMetricsManager;
      // 098: aconst_null
      // 099: bipush 1
      // 09a: invokestatic java/lang/Integer.valueOf (I)Ljava/lang/Integer;
      // 09d: aconst_null
      // 09e: aconst_null
      // 09f: bipush 1
      // 0a0: anewarray 101
      // 0a3: dup
      // 0a4: bipush 0
      // 0a5: aload 3
      // 0a6: invokevirtual com/l7tech/gateway/common/service/PublishedService.getGoid ()Lcom/l7tech/objectmodel/Goid;
      // 0a9: aastore
      // 0aa: bipush 0
      // 0ab: invokeinterface com/l7tech/server/service/ServiceMetricsManager.summarizeByService (Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;[Lcom/l7tech/objectmodel/Goid;Z)Ljava/util/Map; 7
      // 0b0: aload 3
      // 0b1: invokevirtual com/l7tech/gateway/common/service/PublishedService.getGoid ()Lcom/l7tech/objectmodel/Goid;
      // 0b4: invokeinterface java/util/Map.get (Ljava/lang/Object;)Ljava/lang/Object; 2
      // 0b9: checkcast com/l7tech/gateway/common/service/MetricsSummaryBin
      // 0bc: astore 5
      // 0be: goto 113
      // 0c1: aload 0
      // 0c2: getfield com/l7tech/server/wsdm/Aggregator.metricsManager Lcom/l7tech/server/service/ServiceMetricsManager;
      // 0c5: aconst_null
      // 0c6: bipush 1
      // 0c7: invokestatic java/lang/Integer.valueOf (I)Ljava/lang/Integer;
      // 0ca: aload 4
      // 0cc: invokevirtual com/l7tech/gateway/common/service/MetricsSummaryBin.getPeriodEnd ()J
      // 0cf: invokestatic java/lang/Long.valueOf (J)Ljava/lang/Long;
      // 0d2: aconst_null
      // 0d3: bipush 1
      // 0d4: anewarray 101
      // 0d7: dup
      // 0d8: bipush 0
      // 0d9: aload 3
      // 0da: invokevirtual com/l7tech/gateway/common/service/PublishedService.getGoid ()Lcom/l7tech/objectmodel/Goid;
      // 0dd: aastore
      // 0de: bipush 0
      // 0df: invokeinterface com/l7tech/server/service/ServiceMetricsManager.summarizeByService (Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;[Lcom/l7tech/objectmodel/Goid;Z)Ljava/util/Map; 7
      // 0e4: aload 3
      // 0e5: invokevirtual com/l7tech/gateway/common/service/PublishedService.getGoid ()Lcom/l7tech/objectmodel/Goid;
      // 0e8: invokeinterface java/util/Map.get (Ljava/lang/Object;)Ljava/lang/Object; 2
      // 0ed: checkcast com/l7tech/gateway/common/service/MetricsSummaryBin
      // 0f0: astore 5
      // 0f2: aload 0
      // 0f3: aload 0
      // 0f4: getfield com/l7tech/server/wsdm/Aggregator.e J
      // 0f7: aload 4
      // 0f9: invokevirtual com/l7tech/gateway/common/service/MetricsSummaryBin.getPeriodEnd ()J
      // 0fc: lcmp
      // 0fd: iflt 10b
      // 100: aload 0
      // 101: getfield com/l7tech/server/wsdm/Aggregator.e J
      // 104: goto 110
      // 107: invokestatic com/l7tech/server/wsdm/Aggregator.a (Lcom/l7tech/objectmodel/FindException;)Lcom/l7tech/objectmodel/FindException;
      // 10a: athrow
      // 10b: aload 4
      // 10d: invokevirtual com/l7tech/gateway/common/service/MetricsSummaryBin.getPeriodEnd ()J
      // 110: putfield com/l7tech/server/wsdm/Aggregator.e J
      // 113: aload 5
      // 115: ifnonnull 160
      // 118: aload 0
      // 119: getfield com/l7tech/server/wsdm/Aggregator.metricsManager Lcom/l7tech/server/service/ServiceMetricsManager;
      // 11c: aconst_null
      // 11d: bipush 0
      // 11e: invokestatic java/lang/Integer.valueOf (I)Ljava/lang/Integer;
      // 121: aload 4
      // 123: ifnonnull 135
      // 126: goto 12d
      // 129: invokestatic com/l7tech/server/wsdm/Aggregator.a (Lcom/l7tech/objectmodel/FindException;)Lcom/l7tech/objectmodel/FindException;
      // 12c: athrow
      // 12d: aconst_null
      // 12e: goto 13d
      // 131: invokestatic com/l7tech/server/wsdm/Aggregator.a (Lcom/l7tech/objectmodel/FindException;)Lcom/l7tech/objectmodel/FindException;
      // 134: athrow
      // 135: aload 4
      // 137: invokevirtual com/l7tech/gateway/common/service/MetricsSummaryBin.getPeriodEnd ()J
      // 13a: invokestatic java/lang/Long.valueOf (J)Ljava/lang/Long;
      // 13d: aconst_null
      // 13e: bipush 1
      // 13f: anewarray 101
      // 142: dup
      // 143: bipush 0
      // 144: aload 3
      // 145: invokevirtual com/l7tech/gateway/common/service/PublishedService.getGoid ()Lcom/l7tech/objectmodel/Goid;
      // 148: aastore
      // 149: bipush 0
      // 14a: invokeinterface com/l7tech/server/service/ServiceMetricsManager.summarizeByService (Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;[Lcom/l7tech/objectmodel/Goid;Z)Ljava/util/Map; 7
      // 14f: aload 3
      // 150: invokevirtual com/l7tech/gateway/common/service/PublishedService.getGoid ()Lcom/l7tech/objectmodel/Goid;
      // 153: invokeinterface java/util/Map.get (Ljava/lang/Object;)Ljava/lang/Object; 2
      // 158: checkcast com/l7tech/gateway/common/service/MetricsSummaryBin
      // 15b: astore 6
      // 15d: goto 191
      // 160: aload 0
      // 161: getfield com/l7tech/server/wsdm/Aggregator.metricsManager Lcom/l7tech/server/service/ServiceMetricsManager;
      // 164: aconst_null
      // 165: bipush 0
      // 166: invokestatic java/lang/Integer.valueOf (I)Ljava/lang/Integer;
      // 169: aload 5
      // 16b: invokevirtual com/l7tech/gateway/common/service/MetricsSummaryBin.getPeriodEnd ()J
      // 16e: invokestatic java/lang/Long.valueOf (J)Ljava/lang/Long;
      // 171: aconst_null
      // 172: bipush 1
      // 173: anewarray 101
      // 176: dup
      // 177: bipush 0
      // 178: aload 3
      // 179: invokevirtual com/l7tech/gateway/common/service/PublishedService.getGoid ()Lcom/l7tech/objectmodel/Goid;
      // 17c: aastore
      // 17d: bipush 0
      // 17e: invokeinterface com/l7tech/server/service/ServiceMetricsManager.summarizeByService (Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;[Lcom/l7tech/objectmodel/Goid;Z)Ljava/util/Map; 7
      // 183: aload 3
      // 184: invokevirtual com/l7tech/gateway/common/service/PublishedService.getGoid ()Lcom/l7tech/objectmodel/Goid;
      // 187: invokeinterface java/util/Map.get (Ljava/lang/Object;)Ljava/lang/Object; 2
      // 18c: checkcast com/l7tech/gateway/common/service/MetricsSummaryBin
      // 18f: astore 6
      // 191: new java/util/ArrayList
      // 194: dup
      // 195: bipush 3
      // 196: invokespecial java/util/ArrayList.<init> (I)V
      // 199: astore 7
      // 19b: aload 4
      // 19d: ifnull 1b1
      // 1a0: aload 7
      // 1a2: aload 4
      // 1a4: invokeinterface java/util/List.add (Ljava/lang/Object;)Z 2
      // 1a9: pop
      // 1aa: goto 1b1
      // 1ad: invokestatic com/l7tech/server/wsdm/Aggregator.a (Lcom/l7tech/objectmodel/FindException;)Lcom/l7tech/objectmodel/FindException;
      // 1b0: athrow
      // 1b1: aload 5
      // 1b3: ifnull 1c7
      // 1b6: aload 7
      // 1b8: aload 5
      // 1ba: invokeinterface java/util/List.add (Ljava/lang/Object;)Z 2
      // 1bf: pop
      // 1c0: goto 1c7
      // 1c3: invokestatic com/l7tech/server/wsdm/Aggregator.a (Lcom/l7tech/objectmodel/FindException;)Lcom/l7tech/objectmodel/FindException;
      // 1c6: athrow
      // 1c7: aload 6
      // 1c9: ifnull 1dd
      // 1cc: aload 7
      // 1ce: aload 6
      // 1d0: invokeinterface java/util/List.add (Ljava/lang/Object;)Z 2
      // 1d5: pop
      // 1d6: goto 1dd
      // 1d9: invokestatic com/l7tech/server/wsdm/Aggregator.a (Lcom/l7tech/objectmodel/FindException;)Lcom/l7tech/objectmodel/FindException;
      // 1dc: athrow
      // 1dd: aload 7
      // 1df: invokeinterface java/util/List.size ()I 1
      // 1e4: ifle 1f5
      // 1e7: new com/l7tech/gateway/common/service/MetricsSummaryBin
      // 1ea: dup
      // 1eb: aload 7
      // 1ed: invokespecial com/l7tech/gateway/common/service/MetricsSummaryBin.<init> (Ljava/util/Collection;)V
      // 1f0: astore 8
      // 1f2: goto 226
      // 1f5: new com/l7tech/gateway/common/service/MetricsBin
      // 1f8: dup
      // 1f9: invokespecial com/l7tech/gateway/common/service/MetricsBin.<init> ()V
      // 1fc: astore 9
      // 1fe: aload 9
      // 200: aload 3
      // 201: invokevirtual com/l7tech/gateway/common/service/PublishedService.getGoid ()Lcom/l7tech/objectmodel/Goid;
      // 204: invokevirtual com/l7tech/gateway/common/service/MetricsBin.setServiceGoid (Lcom/l7tech/objectmodel/Goid;)V
      // 207: new java/util/ArrayList
      // 20a: dup
      // 20b: bipush 1
      // 20c: invokespecial java/util/ArrayList.<init> (I)V
      // 20f: astore 10
      // 211: aload 10
      // 213: aload 9
      // 215: invokeinterface java/util/List.add (Ljava/lang/Object;)Z 2
      // 21a: pop
      // 21b: new com/l7tech/gateway/common/service/MetricsSummaryBin
      // 21e: dup
      // 21f: aload 10
      // 221: invokespecial com/l7tech/gateway/common/service/MetricsSummaryBin.<init> (Ljava/util/Collection;)V
      // 224: astore 8
      // 226: aload 0
      // 227: getfield com/l7tech/server/wsdm/Aggregator.c Ljava/util/Map;
      // 22a: aload 3
      // 22b: invokevirtual com/l7tech/gateway/common/service/PublishedService.getGoid ()Lcom/l7tech/objectmodel/Goid;
      // 22e: aload 8
      // 230: invokeinterface java/util/Map.put (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; 3
      // 235: pop
      // 236: goto 06a
      // 239: aload 0
      // 23a: invokestatic java/lang/System.currentTimeMillis ()J
      // 23d: putfield com/l7tech/server/wsdm/Aggregator.f J
      // 240: goto 254
      // 243: astore 1
      // 244: aload 0
      // 245: getfield com/l7tech/server/wsdm/Aggregator.a Ljava/util/logging/Logger;
      // 248: getstatic java/util/logging/Level.WARNING Ljava/util/logging/Level;
      // 24b: getstatic com/l7tech/server/wsdm/Aggregator.g [Ljava/lang/String;
      // 24e: bipush 2
      // 24f: aaload
      // 250: aload 1
      // 251: invokevirtual java/util/logging/Logger.log (Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
      // 254: return
      // try (207 -> 213): 214 com/l7tech/objectmodel/FindException
      // try (198 -> 204): 205 com/l7tech/objectmodel/FindException
      // try (189 -> 195): 196 com/l7tech/objectmodel/FindException
      // try (128 -> 140): 140 com/l7tech/objectmodel/FindException
      // try (126 -> 135): 136 com/l7tech/objectmodel/FindException
      // try (111 -> 121): 121 com/l7tech/objectmodel/FindException
      // try (16 -> 40): 41 com/l7tech/objectmodel/FindException
      // try (13 -> 25): 26 com/l7tech/objectmodel/FindException
      // try (0 -> 11): 11 com/l7tech/objectmodel/FindException
      // try (13 -> 258): 259 com/l7tech/objectmodel/FindException
   }

   private static FindException a(FindException var0) {
      return var0;
   }

   static {
      String[] var5 = new String[4];
      int var3 = 0;
      String var2 = "u\f\u001b7e@<T\rZ'lGiI\u000e\u001eud@hR\u000b\u0019&)\b1\u0000\f\u0015ud@hR\u000b\u0019&DDrA\u0005\u001f')FsN\u0004\u00132|WyD2c\u0003\u0014;fQ<R\u0007\u000e'`@jEB\u00170}WuC\u0011Vuz@nV\u000b\u00190)AsE\u0011Z;fQ<E\u001a\u0013&}\u001f<\u0003";
      int var4 = "u\f\u001b7e@<T\rZ'lGiI\u000e\u001eud@hR\u000b\u0019&)\b1\u0000\f\u0015ud@hR\u000b\u0019&DDrA\u0005\u001f')FsN\u0004\u00132|WyD2c\u0003\u0014;fQ<R\u0007\u000e'`@jEB\u00170}WuC\u0011Vuz@nV\u000b\u00190)AsE\u0011Z;fQ<E\u001a\u0013&}\u001f<\u0003"
         .length();
      char var1 = '9';
      int var7 = -1;

      label24:
      while (true) {
         byte var10000 = 70;
         String var10001 = var2.substring(++var7, var7 + var1);
         byte var10002 = -1;

         while (true) {
            String var8 = a(var10000, a(var10001));
            switch (var10002) {
               case 0:
                  var5[var3++] = var8;
                  if ((var7 += var1) >= var4) {
                     g = var5;
                     return;
                  }

                  var1 = var2.charAt(var7);
                  break;
               default:
                  var5[var3++] = var8;
                  if ((var7 += var1) < var4) {
                     var1 = var2.charAt(var7);
                     continue label24;
                  }

                  var2 = "v\u0003\u001b)h\u0016}V\u0010\r/tQ/@\u0014\u001b0sUj@\"v\u0003\u001b)h\u0016}V\u0010\r/tQ/^\u0014\u001d4sU|\u0013\u0017\u00064:EjA\u0007\u0000%\u007fE";
                  var4 = "v\u0003\u001b)h\u0016}V\u0010\r/tQ/@\u0014\u001b0sUj@\"v\u0003\u001b)h\u0016}V\u0010\r/tQ/^\u0014\u001d4sU|\u0013\u0017\u00064:EjA\u0007\u0000%\u007fE"
                     .length();
                  var1 = 22;
                  var7 = -1;
            }

            var10000 = 85;
            var10001 = var2.substring(++var7, var7 + var1);
            var10002 = 0;
         }
      }
   }

   private static char[] a(String var0) {
      char[] var10000 = var0.toCharArray();
      if (var10000.length < 2) {
         var10000[0] = (char)(var10000[0] ^ 90);
      }

      return var10000;
   }

   private static String a(int var0, char[] var1) {
      int var10003 = var1.length;
      int var10002 = var0;
      char[] var10001 = var1;
      int var10000 = var10003;

      for (int var2 = 0; var10000 > var2; var2++) {
         var10001[var2] = (char)(var10001[var2] ^ var10002 ^ switch (var2 % 7) {
            case 0 -> 102;
            case 1 -> 36;
            case 2 -> 60;
            case 3 -> 19;
            case 4 -> 79;
            case 5 -> 99;
            default -> 90;
         });
      }

      return new String(var10001).intern();
   }
}
