/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.mapping.MessageContextMapping
 *  com.l7tech.gateway.common.service.MetricsBin
 *  com.l7tech.gateway.common.service.ServiceHeader
 *  com.l7tech.gateway.common.service.ServiceState
 *  com.l7tech.identity.User
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.util.Config
 *  com.l7tech.util.ConfigFactory
 *  com.l7tech.util.ExceptionUtils
 *  com.l7tech.util.TimeUnit
 *  jakarta.annotation.PostConstruct
 *  jakarta.annotation.PreDestroy
 *  jakarta.inject.Inject
 *  jakarta.inject.Named
 *  org.springframework.context.ApplicationEvent
 */
package com.l7tech.server.service;

import com.l7tech.gateway.common.mapping.MessageContextMapping;
import com.l7tech.gateway.common.service.MetricsBin;
import com.l7tech.gateway.common.service.ServiceHeader;
import com.l7tech.gateway.common.service.ServiceState;
import com.l7tech.identity.User;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.server.service.ServiceMetrics;
import com.l7tech.server.service.ServiceMetricsManager;
import com.l7tech.server.service.ServiceMetricsServices;
import com.l7tech.server.service.ae;
import com.l7tech.server.service.as;
import com.l7tech.server.service.at;
import com.l7tech.server.service.au;
import com.l7tech.server.service.av;
import com.l7tech.server.util.ManagedTimer;
import com.l7tech.server.util.PostStartupApplicationListener;
import com.l7tech.util.Config;
import com.l7tech.util.ConfigFactory;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.TimeUnit;
import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import jakarta.inject.Inject;
import jakarta.inject.Named;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.TimerTask;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.springframework.context.ApplicationEvent;

public class ServiceMetricsServicesImpl
implements ServiceMetricsServices,
PostStartupApplicationListener,
PropertyChangeListener {
    private static final Logger a;
    private static final Random b;
    private static final long c;
    @Inject
    private ServiceMetricsManager serviceMetricsManager;
    private final String d;
    @Inject
    @Named(value="managedBackgroundTimer")
    private ManagedTimer timer;
    @Inject
    private Config config;
    private int e;
    private Map<Goid, ServiceState> f = new ConcurrentHashMap<Goid, ServiceState>();
    private final AtomicBoolean g = new AtomicBoolean(false);
    private final Object h = new Object();
    private au i;
    private av j;
    private as k;
    private at l;
    private at m;
    private at n;
    private ae o;
    private Thread p;
    private static final BlockingQueue<ServiceMetrics.MetricsCollectorSet> q;
    private final Map<Goid, ServiceMetrics> r = new HashMap<Goid, ServiceMetrics>();
    private final Object s = new Object();
    private AtomicBoolean t = new AtomicBoolean(false);
    private static final String[] u;

    public ServiceMetricsServicesImpl(String string) {
        this.d = string;
    }

    @PostConstruct
    void a() throws Exception {
        block10: {
            block9: {
                block8: {
                    String[] stringArray;
                    block7: {
                        int n2;
                        block6: {
                            stringArray = u;
                            n2 = this.e().getIntProperty(stringArray[19], 5000);
                            try {
                                if (n2 <= 300000 && n2 >= 1000) break block6;
                            }
                            catch (Exception exception) {
                                throw ServiceMetricsServicesImpl.a(exception);
                            }
                            stringArray = u;
                            a.warning(String.format(stringArray[11], n2, 1000, 300000, 5000));
                            n2 = 5000;
                        }
                        try {
                            this.e = n2;
                            if (!this.e().getBooleanProperty(u[12], false)) break block7;
                            this.c();
                            break block8;
                        }
                        catch (Exception exception) {
                            throw ServiceMetricsServicesImpl.a(exception);
                        }
                    }
                    stringArray = u;
                    a.info(stringArray[27]);
                }
                try {
                    if (!this.e().getBooleanProperty(u[35], false)) break block9;
                    this.t.set(true);
                    break block10;
                }
                catch (Exception exception) {
                    throw ServiceMetricsServicesImpl.a(exception);
                }
            }
            this.t.set(false);
            a.info(u[2]);
        }
    }

    @PreDestroy
    void b() throws Exception {
        this.d();
    }

    @Override
    public boolean isEnabled() {
        return this.g.get();
    }

    @Override
    public int getFineInterval() {
        return this.e;
    }

    @Override
    public void trackServiceMetrics(Goid goid) {
        this.a(goid);
    }

    @Override
    public void addRequest(Goid goid, String string, User user, List<MessageContextMapping> list, boolean bl2, boolean bl3, int n2, int n3) {
        block4: {
            ServiceMetrics serviceMetrics;
            block5: {
                serviceMetrics = this.a(goid);
                try {
                    try {
                        if (serviceMetrics == null) break block4;
                        if (!this.t.get()) break block5;
                    }
                    catch (NumberFormatException numberFormatException) {
                        throw ServiceMetricsServicesImpl.a(numberFormatException);
                    }
                    serviceMetrics.addRequest(string, user, list, bl2, bl3, n2, n3);
                    break block4;
                }
                catch (NumberFormatException numberFormatException) {
                    throw ServiceMetricsServicesImpl.a(numberFormatException);
                }
            }
            serviceMetrics.addRequest(null, null, null, bl2, bl3, n2, n3);
        }
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    ServiceMetrics a(Goid goid) {
        if (this.isEnabled()) {
            ServiceMetrics serviceMetrics;
            Object object = this.s;
            synchronized (object) {
                if (!this.r.containsKey(goid)) {
                    serviceMetrics = new ServiceMetrics(goid);
                    this.r.put(goid, serviceMetrics);
                } else {
                    serviceMetrics = this.r.get(goid);
                }
            }
            return serviceMetrics;
        }
        return null;
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    private void c() {
        Object object = this.h;
        synchronized (object) {
            if (this.g.get()) {
                return;
            }
            if (this.timer == null) {
                String[] stringArray = u;
                a.log(Level.WARNING, stringArray[0]);
                return;
            }
            String[] stringArray = u;
            a.info(stringArray[24]);
            long l2 = System.currentTimeMillis();
            a.config(stringArray[21] + this.e + stringArray[28]);
            Date date = new Date(MetricsBin.periodEndFor((int)0, (int)this.e, (long)l2));
            this.i = new au(this);
            this.timer.scheduleAtFixedRate((TimerTask)this.i, date, (long)this.e);
            a.config(stringArray[32] + String.valueOf(date));
            long l3 = 15000L * (long)b.nextInt(10);
            Date date2 = new Date(MetricsBin.periodEndFor((int)1, (int)0, (long)l2) + l3);
            this.j = new av(this);
            this.timer.scheduleAtFixedRate((TimerTask)this.j, date2, 3600000L);
            a.config(stringArray[3] + String.valueOf(date2));
            Date date3 = new Date(MetricsBin.periodEndFor((int)2, (int)0, (long)l2) + c);
            this.k = new as(this);
            this.timer.schedule((TimerTask)this.k, date3);
            a.config(stringArray[33] + String.valueOf(date3));
            try {
                Object object2 = this.s;
                synchronized (object2) {
                    Collection<ServiceHeader> collection = this.serviceMetricsManager.findAllServiceHeaders();
                    for (ServiceHeader serviceHeader : collection) {
                        ServiceState serviceState;
                        Goid goid;
                        Map<Goid, ServiceState> map;
                        Goid goid2 = serviceHeader.getGoid();
                        ServiceMetrics serviceMetrics = new ServiceMetrics(serviceHeader.getGoid());
                        try {
                            this.r.put(goid2, serviceMetrics);
                            map = this.f;
                            goid = goid2;
                            serviceState = serviceHeader.isDisabled() ? ServiceState.DISABLED : ServiceState.ENABLED;
                        }
                        catch (FindException findException) {
                            throw ServiceMetricsServicesImpl.a((Exception)((Object)findException));
                        }
                        map.put(goid, serviceState);
                    }
                }
            }
            catch (FindException findException) {
                stringArray = u;
                a.log(Level.WARNING, stringArray[6] + findException.getMessage(), ExceptionUtils.getDebugException((Throwable)findException));
            }
            this.o = new ae(this);
            this.p = new Thread((Runnable)this.o, this.o.getClass().getName());
            this.p.start();
            stringArray = u;
            long l4 = ServiceMetricsServicesImpl.a(stringArray[25], 3900000L, 3900000L, 3900000L);
            long l5 = ServiceMetricsServicesImpl.a(stringArray[13], 86700000L, 2678400000L, 604800000L);
            long l6 = ServiceMetricsServicesImpl.a(stringArray[15], 2678400000L, 315360000000L, 31536000000L);
            this.l = new at(this, l4, 0);
            this.timer.schedule((TimerTask)this.l, 60000L, 300000L);
            a.config(stringArray[20] + String.valueOf(new Date(System.currentTimeMillis() + 60000L)));
            this.m = new at(this, l5, 1);
            this.timer.schedule((TimerTask)this.m, 900000L, 43200000L);
            a.config(stringArray[1] + String.valueOf(new Date(System.currentTimeMillis() + 900000L)));
            this.n = new at(this, l6, 2);
            this.timer.schedule((TimerTask)this.n, 3600000L, 86400000L);
            a.config(stringArray[29] + String.valueOf(new Date(System.currentTimeMillis() + 3600000L)));
            this.g.set(true);
        }
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    private void d() {
        Object object = this.h;
        synchronized (object) {
            block36: {
                if (!this.g.get()) {
                    return;
                }
                String[] stringArray = u;
                a.info(stringArray[14]);
                try {
                    if (this.i != null) {
                        this.i.cancel();
                        this.i = null;
                    }
                    try {
                        if (this.j != null) {
                            this.j.cancel();
                            this.j.doRun();
                            this.j = null;
                        }
                    }
                    catch (InterruptedException interruptedException) {
                        throw ServiceMetricsServicesImpl.a(interruptedException);
                    }
                    try {
                        if (this.k != null) {
                            this.k.cancel();
                            this.k.a(false);
                            this.k = null;
                        }
                    }
                    catch (InterruptedException interruptedException) {
                        throw ServiceMetricsServicesImpl.a(interruptedException);
                    }
                    try {
                        if (this.l != null) {
                            this.l.cancel();
                            this.l = null;
                        }
                    }
                    catch (InterruptedException interruptedException) {
                        throw ServiceMetricsServicesImpl.a(interruptedException);
                    }
                    try {
                        if (this.m != null) {
                            this.m.cancel();
                            this.m = null;
                        }
                    }
                    catch (InterruptedException interruptedException) {
                        throw ServiceMetricsServicesImpl.a(interruptedException);
                    }
                    try {
                        if (this.n != null) {
                            this.n.cancel();
                            this.n = null;
                        }
                    }
                    catch (InterruptedException interruptedException) {
                        throw ServiceMetricsServicesImpl.a(interruptedException);
                    }
                    try {
                        if (this.o != null) {
                            this.o.quit();
                        }
                    }
                    catch (InterruptedException interruptedException) {
                        throw ServiceMetricsServicesImpl.a(interruptedException);
                    }
                    try {
                        if (this.p != null) {
                            this.p.interrupt();
                            this.p = null;
                        }
                    }
                    catch (InterruptedException interruptedException) {
                        throw ServiceMetricsServicesImpl.a(interruptedException);
                    }
                    if (this.o == null) break block36;
                    try {
                        try {
                            while (q.size() != 0) {
                                this.o.a();
                            }
                        }
                        catch (NumberFormatException numberFormatException) {
                            throw ServiceMetricsServicesImpl.a(numberFormatException);
                        }
                    }
                    catch (InterruptedException interruptedException) {
                        stringArray = u;
                        a.info(stringArray[4]);
                    }
                    this.o = null;
                }
                catch (Exception exception) {
                    a.log(Level.WARNING, u[31], exception);
                }
            }
            Object object2 = this.s;
            synchronized (object2) {
                this.r.clear();
            }
            this.g.set(false);
        }
    }

    private static long a(String string, long l2, long l3, long l4) {
        String string2 = ConfigFactory.getProperty((String)string);
        if (string2 == null) {
            String string3 = string;
            long l5 = l4;
            String[] stringArray = u;
            a.info(stringArray[18] + l5 + stringArray[9] + string3);
            return l4;
        }
        try {
            long l6 = Long.parseLong(string2);
            if (l6 < l2) {
                String string4 = string;
                long l7 = l6;
                long l8 = l2;
                String[] stringArray = u;
                a.warning(stringArray[23] + l8 + stringArray[16] + l7 + stringArray[34] + string4);
                return l2;
            }
            if (l6 > l3) {
                String string5 = string;
                long l9 = l6;
                long l10 = l3;
                String[] stringArray = u;
                a.warning(stringArray[36] + l10 + stringArray[17] + l9 + stringArray[22] + string5);
                return l3;
            }
            return l6;
        }
        catch (NumberFormatException numberFormatException) {
            String string6 = string;
            long l11 = l4;
            String[] stringArray = u;
            a.info(stringArray[7] + l11 + stringArray[26] + string6);
            return l4;
        }
    }

    /*
     * Exception decompiling
     */
    public void onApplicationEvent(ApplicationEvent var1_1) {
        /*
         * This method has failed to decompile.  When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file.
         * 
         * org.benf.cfr.reader.util.ConfusedCFRException: Tried to end blocks [2[TRYBLOCK]], but top level block is 5[SWITCH]
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.processEndingBlocks(Op04StructuredStatement.java:435)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:484)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:736)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:850)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201)
         *     at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94)
         *     at org.benf.cfr.reader.entities.Method.analyse(Method.java:531)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942)
         *     at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257)
         *     at org.benf.cfr.reader.Driver.doJar(Driver.java:139)
         *     at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76)
         *     at org.benf.cfr.reader.Main.main(Main.java:54)
         */
        throw new IllegalStateException("Decompilation failed");
    }

    @Override
    public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
        block10: {
            block11: {
                block8: {
                    block9: {
                        try {
                            try {
                                if (!u[10].equals(propertyChangeEvent.getPropertyName())) break block8;
                                if (!Boolean.valueOf((String)propertyChangeEvent.getNewValue()).booleanValue()) break block9;
                            }
                            catch (NumberFormatException numberFormatException) {
                                throw ServiceMetricsServicesImpl.a(numberFormatException);
                            }
                            this.c();
                            break block8;
                        }
                        catch (NumberFormatException numberFormatException) {
                            throw ServiceMetricsServicesImpl.a(numberFormatException);
                        }
                    }
                    this.d();
                }
                try {
                    try {
                        if (!u[5].equals(propertyChangeEvent.getPropertyName())) break block10;
                        if (!Boolean.valueOf((String)propertyChangeEvent.getNewValue()).booleanValue()) break block11;
                    }
                    catch (NumberFormatException numberFormatException) {
                        throw ServiceMetricsServicesImpl.a(numberFormatException);
                    }
                    this.t.set(true);
                    break block10;
                }
                catch (NumberFormatException numberFormatException) {
                    throw ServiceMetricsServicesImpl.a(numberFormatException);
                }
            }
            this.t.set(false);
            a.info(u[8]);
        }
    }

    private Config e() {
        Config config;
        try {
            config = this.config != null ? this.config : ConfigFactory.getCachedConfig();
        }
        catch (NumberFormatException numberFormatException) {
            throw ServiceMetricsServicesImpl.a(numberFormatException);
        }
        return config;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[37];
                var3_1 = 0;
                var2_2 = "E}_-W\u0010Md|\u001e*U\u0014\u000f|v\u001e<^\u0007\u001byp[oV\u0010\u0019bz]<\u001bX@0gW\"^\u0007M~|JoB\u0010\u00190`[;8CpV*_\u0000\u0001uw\u001e)R\u0007\u001ed3Z*W\u0010\u0019y|PoO\u0014\u001e{3X IU\u0005\u007ffL#BU\u0000ugL&XU\u000fy}MoZ\u0001MIQwZ&U\u0012M}vM<Z\u0012\b0pQ!O\u0010\u0015d3S.K\u0005\u0004~tMoO\u001aMCvL9R\u0016\b0^[;I\u001c\u000ec3W<\u001b\u0016\u0018ba[!O\u0019\u00140wW<Z\u0017\u0001uw\u0010(CpV*_\u0000\u0001uw\u001e)R\u0007\u001ed3V N\u0007\u0001i3_=X\u001d\u0004fv\u001e;Z\u0006\u00060uQ=\u001b!VzP.WU\u001fe}\u001e ]U\u000b|fM'^\u0007My}J*I\u0007\u0018`g[+\u0015#sfM;T\u0018\bb^_?K\u001c\u0003w=_+_!\u0002CvL9R\u0016\b]vJ=R\u0016\u001eoVrW#^\u0011Md|\u001e)^\u0001\u000ex3R&H\u0001M\u007fu\u001e?N\u0017\u0001y`V*_U\u001euaH&X\u0010C0^[;I\u001c\u000e0qW!HU\nu}[=Z\u0001\u0004\u007f}\u001e8R\u0019\u00010}Q;\u001b\u0006\u0019qaJoN\u001b\u0019y\u007f\u001e=^\u0004\u0018u`J<\u001b\u0014\u001fbzH*\u0015U.qfM*\u0001U\u0015E`W!\\U\tuu_:W\u0001MfrR:^UEIQwZ&U\u0012M}vM<Z\u0012\b0pQ!O\u0010\u0015d3S.K\u0005\u0004~tMoO\u001aMCvL9R\u0016\b0^[;I\u001c\u000ec3W<\u001b\u0016\u0018ba[!O\u0019\u00140wW<Z\u0017\u0001uw\u0010\u001f93X IU\u0000y`M&U\u0012McjM;^\u0018M`aQ?^\u0007\u0019i)\u001e\u0015cvL9R\u0016\b]vJ=R\u0016\u001eU}_-W\u0010\tUS|P)R\u0012\u0018bvZoV\u0010\u0019bz]<}\u001c\u0003uZP;^\u0007\u001bq\u007f\u001ej_U\u0004c3Q:OU\u0002v3J'^U\u001bq\u007fW+\u001b\u0007\f~t[o\u0013P\t=6Zf\u0000U\u0018czP(\u001b\u0011\bvrK#OUHt\u0015cvL9R\u0016\b]vJ=R\u0016\u001eU}_-W\u0010\t's|SaWB\u0019upVaH\u0010\u001ffz]*\u0015\u0018\bdaW,H[\u0000qkv N\u0007\u0001iRY*%TzM.Y\u0019\u0004~t\u001e<^\u0007\u001byp[oV\u0010\u0019bz]<\u001b\u0016\u0002|\u007f[,O\u001c\u0002~=&s|SaWB\u0019upVaH\u0010\u001ffz]*\u0015\u0018\bdaW,H[\u0000qkz.R\u0019\u0014Qt[\u001c93Q!\u001b\u0006\u0014cg[\"\u001b\u0005\u001f\u007fc[=O\fMfrR:^UE\u001c93Q!\u001b\u0006\u0014cg[\"\u001b\u0005\u001f\u007fc[=O\fMfrR:^UE\u0015E`W!\\U\tuu_:W\u0001MfrR:^UE\u0013}vJ=R\u0016\u001eVzP*r\u001b\u0019uaH.WACpV*_\u0000\u0001uw\u001e)R\u0007\u001ed3Z*W\u0010\u0019y|PoO\u0014\u001e{3X IU\u000by}[oI\u0010\u001e\u007f\u007fK;R\u001a\u00030~[;I\u001c\u000e0qW!HU\fd3 VzP*\u001b\u0007\bc|R:O\u001c\u0002~3\\&UU\u0004~g[=M\u0014\u00010zMo\u00039)\u001e\u001bY~N H\u001c\u0003w3R L\u0010\u001f0pQ!H\u0001\u001fqzP;\u001b]$U}_-W\u001c\u0003w3M*I\u0003\u0004sv\u001e\"^\u0001\u001fypMoX\u001a\u0001|v];R\u001a\u0003>%s|SaWB\u0019upVaH\u0010\u001ffz]*\u0015\u0018\bdaW,H[\u0000qkx&U\u0010,wv#93X IU\u0003\u007f}\u0013!N\u0018\bbz]oH\f\u001edvSoK\u0007\u0002`vL;BOM1CvL9R\u0016\b0~[;I\u001c\u000ec3] W\u0019\bsgW UU\u0004c3]:I\u0007\b~gR6\u001b\u0011\u0004cr\\#^\u0011C\u00030~M7CpV*_\u0000\u0001uw\u001e)R\u0007\u001ed3Z*W\u0010\u0019y|PoO\u0014\u001e{3X IU\tqzR6\u001b\u0018\bdaW,\u001b\u0017\u0004~`\u001e.OU+E}_-W\u0010Md|\u001e)R\u001b\t0pL*Z\u0001\bt<K?_\u0014\u0019uw\u001e<^\u0007\u001byp[o\u0018\u000e]m:SrK(S\u0001Muk]*K\u0001\u0004\u007f}\u001e8S\u001c\u0001u3Z&H\u0014\u000f|zP(\u001b&\bbeW,^8\bdaW,HU\u000e\u007f\u007fR*X\u0001\u0004\u007f}&CpV*_\u0000\u0001uw\u001e)R\u0007\u001ed3X&U\u0010Mqa]'R\u0003\b0g_<PU\u000b\u007fa\u001e'CpV*_\u0000\u0001uw\u001e)R\u0007\u001ed3Z.R\u0019\u00140rL,S\u001c\u001bu3J.H\u001eMv|Lo\u00039)\u001e";
                var4_3 = "E}_-W\u0010Md|\u001e*U\u0014\u000f|v\u001e<^\u0007\u001byp[oV\u0010\u0019bz]<\u001bX@0gW\"^\u0007M~|JoB\u0010\u00190`[;8CpV*_\u0000\u0001uw\u001e)R\u0007\u001ed3Z*W\u0010\u0019y|PoO\u0014\u001e{3X IU\u0005\u007ffL#BU\u0000ugL&XU\u000fy}MoZ\u0001MIQwZ&U\u0012M}vM<Z\u0012\b0pQ!O\u0010\u0015d3S.K\u0005\u0004~tMoO\u001aMCvL9R\u0016\b0^[;I\u001c\u000ec3W<\u001b\u0016\u0018ba[!O\u0019\u00140wW<Z\u0017\u0001uw\u0010(CpV*_\u0000\u0001uw\u001e)R\u0007\u001ed3V N\u0007\u0001i3_=X\u001d\u0004fv\u001e;Z\u0006\u00060uQ=\u001b!VzP.WU\u001fe}\u001e ]U\u000b|fM'^\u0007My}J*I\u0007\u0018`g[+\u0015#sfM;T\u0018\bb^_?K\u001c\u0003w=_+_!\u0002CvL9R\u0016\b]vJ=R\u0016\u001eoVrW#^\u0011Md|\u001e)^\u0001\u000ex3R&H\u0001M\u007fu\u001e?N\u0017\u0001y`V*_U\u001euaH&X\u0010C0^[;I\u001c\u000e0qW!HU\nu}[=Z\u0001\u0004\u007f}\u001e8R\u0019\u00010}Q;\u001b\u0006\u0019qaJoN\u001b\u0019y\u007f\u001e=^\u0004\u0018u`J<\u001b\u0014\u001fbzH*\u0015U.qfM*\u0001U\u0015E`W!\\U\tuu_:W\u0001MfrR:^UEIQwZ&U\u0012M}vM<Z\u0012\b0pQ!O\u0010\u0015d3S.K\u0005\u0004~tMoO\u001aMCvL9R\u0016\b0^[;I\u001c\u000ec3W<\u001b\u0016\u0018ba[!O\u0019\u00140wW<Z\u0017\u0001uw\u0010\u001f93X IU\u0000y`M&U\u0012McjM;^\u0018M`aQ?^\u0007\u0019i)\u001e\u0015cvL9R\u0016\b]vJ=R\u0016\u001eU}_-W\u0010\tUS|P)R\u0012\u0018bvZoV\u0010\u0019bz]<}\u001c\u0003uZP;^\u0007\u001bq\u007f\u001ej_U\u0004c3Q:OU\u0002v3J'^U\u001bq\u007fW+\u001b\u0007\f~t[o\u0013P\t=6Zf\u0000U\u0018czP(\u001b\u0011\bvrK#OUHt\u0015cvL9R\u0016\b]vJ=R\u0016\u001eU}_-W\u0010\t's|SaWB\u0019upVaH\u0010\u001ffz]*\u0015\u0018\bdaW,H[\u0000qkv N\u0007\u0001iRY*%TzM.Y\u0019\u0004~t\u001e<^\u0007\u001byp[oV\u0010\u0019bz]<\u001b\u0016\u0002|\u007f[,O\u001c\u0002~=&s|SaWB\u0019upVaH\u0010\u001ffz]*\u0015\u0018\bdaW,H[\u0000qkz.R\u0019\u0014Qt[\u001c93Q!\u001b\u0006\u0014cg[\"\u001b\u0005\u001f\u007fc[=O\fMfrR:^UE\u001c93Q!\u001b\u0006\u0014cg[\"\u001b\u0005\u001f\u007fc[=O\fMfrR:^UE\u0015E`W!\\U\tuu_:W\u0001MfrR:^UE\u0013}vJ=R\u0016\u001eVzP*r\u001b\u0019uaH.WACpV*_\u0000\u0001uw\u001e)R\u0007\u001ed3Z*W\u0010\u0019y|PoO\u0014\u001e{3X IU\u000by}[oI\u0010\u001e\u007f\u007fK;R\u001a\u00030~[;I\u001c\u000e0qW!HU\fd3 VzP*\u001b\u0007\bc|R:O\u001c\u0002~3\\&UU\u0004~g[=M\u0014\u00010zMo\u00039)\u001e\u001bY~N H\u001c\u0003w3R L\u0010\u001f0pQ!H\u0001\u001fqzP;\u001b]$U}_-W\u001c\u0003w3M*I\u0003\u0004sv\u001e\"^\u0001\u001fypMoX\u001a\u0001|v];R\u001a\u0003>%s|SaWB\u0019upVaH\u0010\u001ffz]*\u0015\u0018\bdaW,H[\u0000qkx&U\u0010,wv#93X IU\u0003\u007f}\u0013!N\u0018\bbz]oH\f\u001edvSoK\u0007\u0002`vL;BOM1CvL9R\u0016\b0~[;I\u001c\u000ec3] W\u0019\bsgW UU\u0004c3]:I\u0007\b~gR6\u001b\u0011\u0004cr\\#^\u0011C\u00030~M7CpV*_\u0000\u0001uw\u001e)R\u0007\u001ed3Z*W\u0010\u0019y|PoO\u0014\u001e{3X IU\tqzR6\u001b\u0018\bdaW,\u001b\u0017\u0004~`\u001e.OU+E}_-W\u0010Md|\u001e)R\u001b\t0pL*Z\u0001\bt<K?_\u0014\u0019uw\u001e<^\u0007\u001byp[o\u0018\u000e]m:SrK(S\u0001Muk]*K\u0001\u0004\u007f}\u001e8S\u001c\u0001u3Z&H\u0014\u000f|zP(\u001b&\bbeW,^8\bdaW,HU\u000e\u007f\u007fR*X\u0001\u0004\u007f}&CpV*_\u0000\u0001uw\u001e)R\u0007\u001ed3X&U\u0010Mqa]'R\u0003\b0g_<PU\u000b\u007fa\u001e'CpV*_\u0000\u0001uw\u001e)R\u0007\u001ed3Z.R\u0019\u00140rL,S\u001c\u001bu3J.H\u001eMv|Lo\u00039)\u001e".length();
                var1_4 = 53;
                var0_5 = -1;
lbl7:
                // 2 sources

                while (true) {
                    v0 = 65;
                    v1 = ++var0_5;
                    v2 = var2_2.substring(v1, v1 + var1_4);
                    v3 = -1;
                    break block9;
                    break;
                }
lbl13:
                // 1 sources

                while (true) {
                    var5[var3_1++] = ServiceMetricsServicesImpl.a(v0, ServiceMetricsServicesImpl.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "|iB4[\u0017\u0007mQP0D\u0013\fx2P$P.\rLyC6]\u0019\u0007RyE2]\u0019\u0011\u001bVqA/G\u0013\fx<D0D\u001f\u0010?\u007f^.G\u000e\u0010~u_4\u0014R";
                    var4_3 = "|iB4[\u0017\u0007mQP0D\u0013\fx2P$P.\rLyC6]\u0019\u0007RyE2]\u0019\u0011\u001bVqA/G\u0013\fx<D0D\u001f\u0010?\u007f^.G\u000e\u0010~u_4\u0014R".length();
                    var1_4 = 35;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 78;
                        v4 = ++var0_5;
                        v2 = var2_2.substring(v4, v4 + var1_4);
                        v3 = 0;
                        break block9;
                        break;
                    }
                    break;
                }
lbl28:
                // 1 sources

                while (true) {
                    var5[var3_1++] = ServiceMetricsServicesImpl.a(v0, ServiceMetricsServicesImpl.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    break block10;
                    break;
                }
            }
            switch (v3) {
                default: {
                    ** continue;
                }
                ** case 0:
lbl39:
                // 1 sources

                ** continue;
            }
        }
        ServiceMetricsServicesImpl.u = var5;
        ServiceMetricsServicesImpl.a = Logger.getLogger(ServiceMetricsServicesImpl.class.getName());
        ServiceMetricsServicesImpl.b = new Random();
        ServiceMetricsServicesImpl.c = TimeUnit.MINUTES.toMillis(1L) * 5L;
        ServiceMetricsServicesImpl.q = new ArrayBlockingQueue<ServiceMetrics.MetricsCollectorSet>(500);
    }

    private static Exception a(Exception exception) {
        return exception;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x2C);
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String a(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 81;
                    case 1 -> 82;
                    case 2 -> 127;
                    case 3 -> 14;
                    case 4 -> 122;
                    case 5 -> 52;
                    default -> 44;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

