/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.admin.PolicyBundleInstallerAdmin$PolicyBundleInstallerException
 *  com.l7tech.objectmodel.Goid
 *  org.springframework.context.ApplicationEvent
 */
package com.l7tech.server.policy.bundle;

import com.l7tech.gateway.common.admin.PolicyBundleInstallerAdmin;
import com.l7tech.objectmodel.Goid;
import com.l7tech.server.event.admin.DetailedAdminEvent;
import com.l7tech.server.policy.bundle.PolicyBundleInstallerAdminAbstractImpl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.logging.Level;
import org.springframework.context.ApplicationEvent;

class f
implements Callable<ArrayList> {
    final String val$taskIdentifier;
    final Collection val$componentIds;
    final Goid val$folderGoid;
    final Map val$bundleMappings;
    final String val$installationPrefix;
    final Map val$migrationBundlesOverrides;
    final PolicyBundleInstallerAdminAbstractImpl this$0;
    private static final String a = f.a(90, f.a("\r|zcTJ\u0005}j`sQA\u000f}g{rLN\u00041oahWAH2h5uPJH"));

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    f(PolicyBundleInstallerAdminAbstractImpl policyBundleInstallerAdminAbstractImpl, String string, Collection collection, Goid goid, Map map, String string2, Map map2) {
        this.this$0 = policyBundleInstallerAdminAbstractImpl;
        this.val$taskIdentifier = string;
        this.val$componentIds = collection;
        this.val$folderGoid = goid;
        this.val$bundleMappings = map;
        this.val$installationPrefix = string2;
        this.val$migrationBundlesOverrides = map2;
    }

    @Override
    public ArrayList call() throws Exception {
        try {
            ArrayList<String> arrayList = new ArrayList<String>(this.this$0.doInstall(this.val$taskIdentifier, this.val$componentIds, this.val$folderGoid, this.val$bundleMappings, this.val$installationPrefix, this.val$migrationBundlesOverrides));
            return arrayList;
        }
        catch (PolicyBundleInstallerAdmin.PolicyBundleInstallerException policyBundleInstallerException) {
            DetailedAdminEvent detailedAdminEvent = new DetailedAdminEvent(this, a + this.this$0.getInstallerName(), Level.WARNING);
            detailedAdminEvent.setAuditDetails(Arrays.asList(this.this$0.newAuditDetailInstallError(policyBundleInstallerException)));
            this.this$0.k.publishEvent((ApplicationEvent)detailedAdminEvent);
            throw policyBundleInstallerException;
        }
        finally {
            this.this$0.l.remove(this.val$taskIdentifier);
        }
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x32);
        }
        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 -> 7;
                    case 1 -> 84;
                    case 2 -> 79;
                    case 3 -> 91;
                    case 4 -> 98;
                    case 5 -> 117;
                    default -> 50;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

