/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.audit.AssertionMessages
 *  com.l7tech.gateway.common.audit.AuditDetailMessage
 *  com.l7tech.policy.assertion.WsiBspAssertion
 */
package com.l7tech.server.policy.assertion;

import com.l7tech.gateway.common.audit.AssertionMessages;
import com.l7tech.gateway.common.audit.AuditDetailMessage;
import com.l7tech.policy.assertion.WsiBspAssertion;
import com.l7tech.server.policy.assertion.ServerXpathValidationAssertion;
import java.io.InputStream;
import javax.xml.xpath.XPathException;

public class ServerWsiBspAssertion
extends ServerXpathValidationAssertion<WsiBspAssertion> {
    private static final String i;
    private static final String[] k;

    public ServerWsiBspAssertion(WsiBspAssertion wsiBspAssertion) {
        super(wsiBspAssertion);
    }

    @Override
    protected boolean isCheckRequestMessages() {
        return ((WsiBspAssertion)this.assertion).isCheckRequestMessages();
    }

    @Override
    protected boolean isCheckResponseMessages() {
        return ((WsiBspAssertion)this.assertion).isCheckResponseMessages();
    }

    @Override
    protected boolean isFailOnNonCompliantRequest() {
        return ((WsiBspAssertion)this.assertion).isFailOnNonCompliantRequest();
    }

    @Override
    protected boolean isFailOnNonCompliantResponse() {
        return ((WsiBspAssertion)this.assertion).isFailOnNonCompliantResponse();
    }

    @Override
    protected void onRequestFailure() {
        this.logAndAudit((AuditDetailMessage)AssertionMessages.WSI_BSP_REQUEST_FAIL);
    }

    @Override
    protected void onRequestNonCompliance(String string, String string2) {
        if (((WsiBspAssertion)this.assertion).isAuditRequestNonCompliance()) {
            this.logAndAudit((AuditDetailMessage)AssertionMessages.WSI_BSP_REQUEST_NON_COMPLIANT, string, string2);
        }
    }

    @Override
    protected void onRequestNonSoap() {
        this.logAndAudit((AuditDetailMessage)AssertionMessages.WSI_BSP_REQUEST_NON_SOAP);
    }

    @Override
    protected void onResponseFailure() {
        this.logAndAudit((AuditDetailMessage)AssertionMessages.WSI_BSP_RESPONSE_FAIL);
    }

    @Override
    protected void onResponseNonCompliance(String string, String string2) {
        if (((WsiBspAssertion)this.assertion).isAuditResponseNonCompliance()) {
            this.logAndAudit((AuditDetailMessage)AssertionMessages.WSI_BSP_RESPONSE_NON_COMPLIANT, string, string2);
        }
    }

    @Override
    protected void onResponseNonSoap() {
        this.logAndAudit((AuditDetailMessage)AssertionMessages.WSI_BSP_RESPONSE_NON_SOAP);
    }

    @Override
    protected void onXPathError(XPathException xPathException) {
        this.logAndAudit((AuditDetailMessage)AssertionMessages.WSI_BSP_XPATH_ERROR, null, xPathException);
    }

    @Override
    protected InputStream getRulesResource() {
        ClassLoader classLoader = ServerWsiBspAssertion.class.getClassLoader();
        return classLoader.getResourceAsStream(k[0]);
    }

    /*
     * Enabled aggressive block sorting
     */
    static {
        String[] stringArray = new String[2];
        int n2 = 0;
        String string = "a\u001dP'F+_g\u0011U'YyYt\u0017O'ZsGk\u0011D'KoXg\u0000IaEr\u0004Q\u0017O~On|q\u001b\u007f{Z]Xq\u0017O|CsE,\u0000HdOo\u0005r\u0000RxOn_k\u0017NIa\u001dP'F+_g\u0011U'YyYt\u0017O'ZsGk\u0011D'KoXg\u0000IaEr\u0004Q\u0017O~On|q\u001b\u007f{Z]Xq\u0017O|CsE,\u0000HdOo\u0005r\u0000RxOn_k\u0017N";
        int n3 = "a\u001dP'F+_g\u0011U'YyYt\u0017O'ZsGk\u0011D'KoXg\u0000IaEr\u0004Q\u0017O~On|q\u001b\u007f{Z]Xq\u0017O|CsE,\u0000HdOo\u0005r\u0000RxOn_k\u0017NIa\u001dP'F+_g\u0011U'YyYt\u0017O'ZsGk\u0011D'KoXg\u0000IaEr\u0004Q\u0017O~On|q\u001b\u007f{Z]Xq\u0017O|CsE,\u0000HdOo\u0005r\u0000RxOn_k\u0017N".length();
        int n4 = 73;
        int n5 = -1;
        while (true) {
            int n6 = ++n5;
            stringArray[n2++] = ServerWsiBspAssertion.c(16, ServerWsiBspAssertion.c(string.substring(n6, n6 + n4)));
            if ((n5 += n4) >= n3) {
                k = stringArray;
                i = k[1];
                return;
            }
            n4 = string.charAt(n5);
        }
    }

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

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String c(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 -> 18;
                    case 1 -> 98;
                    case 2 -> 45;
                    case 3 -> 24;
                    case 4 -> 58;
                    case 5 -> 12;
                    default -> 59;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

