/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.service.PublishedService
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.util.ArrayUtils
 *  com.l7tech.util.Pair
 *  org.springframework.context.ApplicationEvent
 */
package com.l7tech.server.service;

import com.l7tech.gateway.common.service.PublishedService;
import com.l7tech.objectmodel.Goid;
import com.l7tech.server.event.EntityInvalidationEvent;
import com.l7tech.server.service.ServiceCache;
import com.l7tech.util.ArrayUtils;
import com.l7tech.util.Pair;
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Level;
import org.springframework.context.ApplicationEvent;

class x
implements Runnable {
    final List val$notificationList;
    final ServiceCache this$0;
    private static final String a = x.a(40, x.a("m\u001crF|{n\u0001;gCijoJASBd{~K\n-\u0007"));

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    x(ServiceCache serviceCache, List list) {
        this.this$0 = serviceCache;
        this.val$notificationList = list;
    }

    @Override
    public void run() {
        LinkedList<Goid> linkedList = new LinkedList<Goid>();
        LinkedList<Character> linkedList2 = new LinkedList<Character>();
        LinkedList<Goid> linkedList3 = new LinkedList<Goid>();
        LinkedList<Goid> linkedList4 = new LinkedList<Goid>();
        for (Pair pair : this.val$notificationList) {
            Goid goid = (Goid)pair.left;
            ServiceCache.CachedServiceNotificationType cachedServiceNotificationType = (ServiceCache.CachedServiceNotificationType)((Object)pair.right);
            switch (cachedServiceNotificationType.ordinal()) {
                case 0: {
                    linkedList.add(goid);
                    linkedList2.add(Character.valueOf('C'));
                    break;
                }
                case 3: {
                    linkedList.add(goid);
                    linkedList2.add(Character.valueOf('U'));
                    break;
                }
                case 2: {
                    linkedList4.add(goid);
                    break;
                }
                case 1: {
                    linkedList3.add(goid);
                    break;
                }
                case 4: {
                    linkedList.add(goid);
                    linkedList2.add(Character.valueOf('D'));
                }
            }
        }
        if (!linkedList.isEmpty()) {
            ServiceCache.a.log(Level.INFO, a + String.valueOf(linkedList));
            this.this$0.getApplicationContext().publishEvent((ApplicationEvent)new EntityInvalidationEvent(this.this$0, PublishedService.class, linkedList.toArray(new Goid[linkedList.size()]), ArrayUtils.unboxChars(linkedList2)));
        }
        if (!linkedList3.isEmpty()) {
            this.this$0.a(linkedList3, true);
        }
        if (!linkedList4.isEmpty()) {
            this.this$0.a(linkedList4, false);
        }
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x22);
        }
        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 -> 6;
                    case 1 -> 70;
                    case 2 -> 63;
                    case 3 -> 15;
                    case 4 -> 32;
                    case 5 -> 54;
                    default -> 34;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

