/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.service.MetricsBin
 *  com.l7tech.util.ResourceUtils
 *  org.hibernate.jdbc.Work
 */
package com.l7tech.server.service;

import com.l7tech.gateway.common.service.MetricsBin;
import com.l7tech.server.service.ServiceMetricsManagerImpl;
import com.l7tech.server.service.aa;
import com.l7tech.util.ResourceUtils;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import org.hibernate.jdbc.Work;

class ab
implements Work {
    final MetricsBin val$existing;
    final aa this$1;
    private static final String[] a;

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    ab(aa aa2, MetricsBin metricsBin) {
        this.this$1 = aa2;
        this.val$existing = metricsBin;
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    public void execute(Connection connection) throws SQLException {
        PreparedStatement preparedStatement = null;
        try {
            String[] stringArray = a;
            preparedStatement = connection.prepareStatement(stringArray[0]);
            preparedStatement.setBytes(1, this.val$existing.getGoid().getBytes());
            int n2 = preparedStatement.executeUpdate();
            try {
                if (ServiceMetricsManagerImpl.e.isLoggable(Level.FINE)) {
                    ServiceMetricsManagerImpl.e.log(Level.FINE, stringArray[1], new Object[]{this.this$1.val$bin.getClusterNodeId(), this.this$1.val$bin.getServiceGoid(), this.this$1.val$bin.getResolution(), this.this$1.val$bin.getPeriodStart(), n2});
                }
            }
            catch (SQLException sQLException) {
                throw ab.a(sQLException);
            }
        }
        catch (Throwable throwable) {
            ResourceUtils.closeQuietly(preparedStatement);
            throw throwable;
        }
        ResourceUtils.closeQuietly((Statement)preparedStatement);
    }

    private static SQLException a(SQLException sQLException) {
        return sQLException;
    }

    /*
     * Enabled aggressive block sorting
     */
    static {
        String[] stringArray = new String[2];
        int n2 = 0;
        String string = "IF]'W\bJKQ^/#>\u000f\u007fux\u0001f\u0012\u0007hwc\u000b`>5ife\u0003j!\u0019-TY'Q\bJ~fc\u0014j.\u000fRnt\u0016q$\t~\\v\rj)J0#.dIf}\u0007w(\u000e-x%\u001f#)\u000fybx\u000e# \u000fyqx\u0001pm\bdmbBX\u000e\u0006xpe\u0007q\u0003\u0005ifX\u0006>6Zp811f?\u001cd`t-j)Wv2lY#\u001f\u000f~l}\u0017w$\u0005c>jP~vJ]fc\u000bl)9ybc\u0016>6Yp^";
        int n3 = "IF]'W\bJKQ^/#>\u000f\u007fux\u0001f\u0012\u0007hwc\u000b`>5ife\u0003j!\u0019-TY'Q\bJ~fc\u0014j.\u000fRnt\u0016q$\t~\\v\rj)J0#.dIf}\u0007w(\u000e-x%\u001f#)\u000fybx\u000e# \u000fyqx\u0001pm\bdmbBX\u000e\u0006xpe\u0007q\u0003\u0005ifX\u0006>6Zp811f?\u001cd`t-j)Wv2lY#\u001f\u000f~l}\u0017w$\u0005c>jP~vJ]fc\u000bl)9ybc\u0016>6Yp^".length();
        int n4 = 66;
        int n5 = -1;
        while (true) {
            int n6 = ++n5;
            stringArray[n2++] = ab.a(33, ab.a(string.substring(n6, n6 + n4)));
            if ((n5 += n4) >= n3) {
                a = stringArray;
                return;
            }
            n4 = string.charAt(n5);
        }
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x4B);
        }
        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 -> 44;
                    case 1 -> 34;
                    case 2 -> 48;
                    case 3 -> 67;
                    case 4 -> 34;
                    case 5 -> 108;
                    default -> 75;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

