/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.admin.PolicyBundleInstallerAdmin$PolicyBundleInstallerException
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.policy.bundle.PolicyBundleDryRunResult
 *  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.policy.bundle.PolicyBundleDryRunResult;
import com.l7tech.server.event.admin.DetailedAdminEvent;
import com.l7tech.server.policy.bundle.PolicyBundleInstallerAdminAbstractImpl;
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 e
implements Callable<PolicyBundleDryRunResult> {
    final String val$taskIdentifier;
    final Collection val$componentIds;
    final Map val$bundleMappings;
    final Goid val$folderGoid;
    final String val$installationPrefix;
    final PolicyBundleInstallerAdminAbstractImpl this$0;
    private static final String a = e.a(14, e.a("\u001e\u0011N\u0006B\bTn\u0007T\u0016G\u0003^n\u0013S\u0001\u000e\u0004W=\u0017@\bB\fM'\fODM\u0005\\-\b\u0001\u000bHMM&\u0006\u0001"));

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

    @Override
    public PolicyBundleDryRunResult call() throws Exception {
        try {
            PolicyBundleDryRunResult policyBundleDryRunResult = this.this$0.doDryRunInstall(this.val$taskIdentifier, this.val$componentIds, this.val$bundleMappings, this.val$folderGoid, this.val$installationPrefix);
            return policyBundleDryRunResult;
        }
        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] ^ 0x37);
        }
        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 -> 64;
                    case 1 -> 109;
                    case 2 -> 47;
                    case 3 -> 106;
                    case 4 -> 32;
                    case 5 -> 99;
                    default -> 55;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

