/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.common.log.HybridDiagnosticContext
 *  com.l7tech.gateway.common.RequestId
 *  com.l7tech.gateway.common.audit.AssertionMessages
 *  com.l7tech.gateway.common.audit.Audit
 *  com.l7tech.gateway.common.audit.AuditDetailMessage
 *  com.l7tech.gateway.common.mapping.MessageContextMapping
 *  com.l7tech.gateway.common.service.PublishedService
 *  com.l7tech.message.Message
 *  com.l7tech.message.ProcessingContext
 *  com.l7tech.policy.assertion.Assertion
 *  com.l7tech.policy.assertion.AssertionStatus
 *  com.l7tech.policy.assertion.MessageTargetable
 *  com.l7tech.policy.assertion.RoutingStatus
 *  com.l7tech.policy.variable.BuiltinVariables
 *  com.l7tech.policy.variable.NoSuchVariableException
 *  com.l7tech.policy.variable.Syntax
 *  com.l7tech.policy.variable.VariableNotSettableException
 *  com.l7tech.security.xml.processor.ProcessorResult
 *  com.l7tech.util.InvalidDocumentFormatException
 *  com.l7tech.util.Pair
 *  com.l7tech.util.TimeSource
 *  com.l7tech.wsdl.Wsdl
 *  com.l7tech.xml.SoapFaultLevel
 *  com.l7tech.xml.soap.SoapUtil
 *  com.l7tech.xml.soap.SoapVersion
 *  javax.wsdl.Binding
 *  javax.wsdl.Operation
 *  javax.wsdl.WSDLException
 *  org.jetbrains.annotations.NotNull
 *  org.jetbrains.annotations.Nullable
 */
package com.l7tech.server.message;

import com.l7tech.common.log.HybridDiagnosticContext;
import com.l7tech.gateway.common.RequestId;
import com.l7tech.gateway.common.audit.AssertionMessages;
import com.l7tech.gateway.common.audit.Audit;
import com.l7tech.gateway.common.audit.AuditDetailMessage;
import com.l7tech.gateway.common.mapping.MessageContextMapping;
import com.l7tech.gateway.common.service.PublishedService;
import com.l7tech.message.Message;
import com.l7tech.message.ProcessingContext;
import com.l7tech.policy.assertion.Assertion;
import com.l7tech.policy.assertion.AssertionStatus;
import com.l7tech.policy.assertion.MessageTargetable;
import com.l7tech.policy.assertion.RoutingStatus;
import com.l7tech.policy.variable.BuiltinVariables;
import com.l7tech.policy.variable.NoSuchVariableException;
import com.l7tech.policy.variable.Syntax;
import com.l7tech.policy.variable.VariableNotSettableException;
import com.l7tech.security.xml.processor.ProcessorResult;
import com.l7tech.server.RequestIdGenerator;
import com.l7tech.server.audit.AuditContext;
import com.l7tech.server.message.AssertionTraceListener;
import com.l7tech.server.message.AuthenticationContext;
import com.l7tech.server.message.PolicyContextCache;
import com.l7tech.server.message.PolicyEnforcementContext;
import com.l7tech.server.message.f;
import com.l7tech.server.message.metrics.GatewayMetricsPublisher;
import com.l7tech.server.message.metrics.GatewayMetricsSupport;
import com.l7tech.server.message.metrics.GatewayMetricsUtils;
import com.l7tech.server.message.metrics.LatencyMetrics;
import com.l7tech.server.otel.OtelContext;
import com.l7tech.server.otel.OtelContextNoop;
import com.l7tech.server.policy.PolicyMetadata;
import com.l7tech.server.policy.assertion.CompositeRoutingResultListener;
import com.l7tech.server.policy.assertion.RoutingResultListener;
import com.l7tech.server.policy.assertion.ServerAssertion;
import com.l7tech.server.policy.variable.ServerVariables;
import com.l7tech.server.stepdebug.DebugContext;
import com.l7tech.util.InvalidDocumentFormatException;
import com.l7tech.util.Pair;
import com.l7tech.util.TimeSource;
import com.l7tech.wsdl.Wsdl;
import com.l7tech.xml.SoapFaultLevel;
import com.l7tech.xml.soap.SoapUtil;
import com.l7tech.xml.soap.SoapVersion;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Deque;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.TreeMap;
import java.util.logging.Level;
import javax.wsdl.Binding;
import javax.wsdl.Operation;
import javax.wsdl.WSDLException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.xml.sax.SAXException;

/*
 * Exception performing whole class analysis ignored.
 */
class b
extends ProcessingContext<AuthenticationContext>
implements PolicyEnforcementContext,
GatewayMetricsSupport {
    private final long a;
    private long b;
    private long c;
    private final RequestId d;
    private List<String> e;
    private final Map<ServerAssertion, ServerAssertion> f;
    private boolean g;
    private Level h;
    private boolean i;
    private boolean j;
    private SoapFaultLevel k;
    private boolean l;
    private boolean m;
    private PublishedService n;
    private Set<AssertionStatus> o;
    private final Map<String, Object> p;
    private PolicyContextCache q;
    private CompositeRoutingResultListener r;
    private boolean s;
    private Pair<Binding, Operation> t;
    private RoutingStatus u;
    private URL v;
    private long w;
    private long x;
    private long y;
    private AssertionStatus z;
    private Boolean A;
    private Boolean B;
    private List<MessageContextMapping> C;
    private boolean D;
    private boolean E;
    private boolean F;
    private boolean G;
    private boolean H;
    private boolean I;
    private String J;
    private Deque<Integer> K;
    private AssertionTraceListener L;
    private DebugContext M;
    private PolicyMetadata N;
    private PolicyMetadata O;
    private OtelContext P;
    @Nullable
    private AuditContext Q;
    @Nullable
    private GatewayMetricsPublisher R;
    private final Map<ServerAssertion, AssertionStatus> S;
    private LinkedList<PolicyEnforcementContext.AssertionResult> T;
    private ServerAssertion U;
    private static final String[] V;

    protected b(@Nullable Message message, @Nullable Message message2, @NotNull TimeSource timeSource) {
        if (timeSource == null) {
            com.l7tech.server.message.b.a(0);
        }
        this(message, message2, timeSource, RequestIdGenerator.next());
    }

    protected b(@Nullable Message message, @Nullable Message message2, @NotNull TimeSource timeSource, @NotNull RequestId requestId) {
        if (timeSource == null) {
            com.l7tech.server.message.b.a(1);
        }
        if (requestId == null) {
            com.l7tech.server.message.b.a(2);
        }
        super(message, message2);
        this.b = 0L;
        this.e = new ArrayList<String>();
        this.f = new LinkedHashMap<ServerAssertion, ServerAssertion>();
        this.k = null;
        this.l = false;
        this.m = false;
        this.o = new HashSet<AssertionStatus>();
        this.p = new TreeMap<String, Object>(String.CASE_INSENSITIVE_ORDER);
        this.r = new CompositeRoutingResultListener();
        this.s = false;
        this.t = null;
        this.u = RoutingStatus.NONE;
        this.A = null;
        this.B = null;
        this.C = new ArrayList<MessageContextMapping>(5);
        this.H = true;
        this.I = true;
        this.K = null;
        this.L = null;
        this.M = null;
        this.N = null;
        this.O = null;
        this.P = new OtelContextNoop();
        this.S = new LinkedHashMap<ServerAssertion, AssertionStatus>();
        this.d = requestId;
        HybridDiagnosticContext.put((String)V[4], (String)this.d.toString());
        this.a = timeSource.currentTimeMillis();
    }

    protected AuthenticationContext buildContext() {
        return new AuthenticationContext();
    }

    @Override
    public RoutingStatus getRoutingStatus() {
        return this.u;
    }

    @Override
    public void setRoutingStatus(RoutingStatus routingStatus) {
        this.u = routingStatus;
    }

    @Override
    public boolean isPostRouting() {
        boolean bl2;
        block5: {
            block4: {
                try {
                    try {
                        if (!RoutingStatus.ROUTED.equals(this.getRoutingStatus()) && !RoutingStatus.ATTEMPTED.equals(this.getRoutingStatus())) break block4;
                    }
                    catch (NullPointerException nullPointerException) {
                        throw com.l7tech.server.message.b.a(nullPointerException);
                    }
                    bl2 = true;
                    break block5;
                }
                catch (NullPointerException nullPointerException) {
                    throw com.l7tech.server.message.b.a(nullPointerException);
                }
            }
            bl2 = false;
        }
        return bl2;
    }

    @Override
    public boolean isReplyExpected() {
        return this.g;
    }

    public void setReplyExpected(boolean bl2) {
        this.g = bl2;
    }

    @Override
    public Level getAuditLevel() {
        return this.h;
    }

    @Override
    public void setAuditLevel(Level level) {
        this.h = level;
    }

    @Override
    public RequestId getRequestId() {
        return this.d;
    }

    @Override
    public void addSeenAssertionStatus(AssertionStatus assertionStatus) {
        try {
            if (assertionStatus == null) {
                throw new NullPointerException(V[21]);
            }
        }
        catch (NullPointerException nullPointerException) {
            throw com.l7tech.server.message.b.a(nullPointerException);
        }
        this.o.add(assertionStatus);
    }

    @Override
    public Set<AssertionStatus> getSeenAssertionStatus() {
        return Collections.unmodifiableSet(this.o);
    }

    @Override
    public boolean isAuditSaveRequest() {
        return this.i;
    }

    @Override
    public void setAuditSaveRequest(boolean bl2) {
        this.i = bl2;
    }

    @Override
    public boolean isAuditSaveResponse() {
        return this.j;
    }

    @Override
    public void setAuditSaveResponse(boolean bl2) {
        this.j = bl2;
    }

    @Override
    public Collection<ServerAssertion> getDeferredAssertions() {
        return this.f.values();
    }

    @Override
    public void addDeferredAssertion(ServerAssertion serverAssertion, ServerAssertion serverAssertion2) {
        this.f.put(serverAssertion, serverAssertion2);
    }

    @Override
    public void removeDeferredAssertion(ServerAssertion serverAssertion) {
        this.f.remove(serverAssertion);
    }

    @Override
    public RoutingResultListener getRoutingResultListener() {
        return this.r;
    }

    @Override
    public void addRoutingResultListener(RoutingResultListener routingResultListener) {
        this.r.addListener(routingResultListener);
    }

    @Override
    public void removeRoutingResultListener(RoutingResultListener routingResultListener) {
        this.r.removeListener(routingResultListener);
    }

    @Override
    public void setAuthenticationMissing() {
        ((AuthenticationContext)super.getDefaultAuthenticationContext()).setAuthenticationMissing();
        this.setRequestPolicyViolated();
    }

    @Override
    public boolean isRequestPolicyViolated() {
        return this.l;
    }

    @Override
    public void setRequestPolicyViolated() {
        this.l = true;
    }

    @Override
    public void setRequestClaimingWrongPolicyVersion() {
        this.m = true;
    }

    @Override
    public boolean isRequestClaimingWrongPolicyVersion() {
        return this.m;
    }

    @Override
    public PublishedService getService() {
        return this.n;
    }

    @Override
    public void setService(PublishedService publishedService) {
        this.n = publishedService;
    }

    @Override
    public PolicyMetadata getServicePolicyMetadata() {
        return this.O;
    }

    @Override
    public void setServicePolicyMetadata(PolicyMetadata policyMetadata) {
        this.O = policyMetadata;
    }

    @Override
    public PolicyMetadata getCurrentPolicyMetadata() {
        return this.N;
    }

    @Override
    public void setCurrentPolicyMetadata(PolicyMetadata policyMetadata) {
        this.N = policyMetadata;
    }

    @Override
    public void setCache(PolicyContextCache policyContextCache) {
        this.q = policyContextCache;
    }

    @Override
    public PolicyContextCache getCache() {
        return this.q;
    }

    @Override
    public List<String> getIncrementedCounters() {
        return this.e;
    }

    /*
     * Enabled aggressive block sorting
     * Enabled unnecessary exception pruning
     * Enabled aggressive exception aggregation
     */
    @Override
    public void setVariable(String string, Object object) throws VariableNotSettableException {
        try {
            if (string == null) {
                return;
            }
        }
        catch (NoSuchVariableException noSuchVariableException) {
            throw com.l7tech.server.message.b.a((Exception)((Object)noSuchVariableException));
        }
        try {
            if (this.isBuiltinVariable(string)) {
                try {
                    this.setBuiltinVariable(string, object);
                    return;
                }
                catch (NoSuchVariableException noSuchVariableException) {
                    String[] stringArray = V;
                    throw new RuntimeException(stringArray[8] + string + stringArray[9], noSuchVariableException);
                }
            }
        }
        catch (VariableNotSettableException variableNotSettableException) {
            throw com.l7tech.server.message.b.a((Exception)((Object)variableNotSettableException));
        }
        try {
            if (this.p.containsKey(string)) {
                this.p.remove(string);
            }
        }
        catch (NoSuchVariableException noSuchVariableException) {
            throw com.l7tech.server.message.b.a((Exception)((Object)noSuchVariableException));
        }
        this.p.put(string, object);
    }

    protected boolean isBuiltinVariable(String string) {
        boolean bl2;
        block5: {
            block4: {
                try {
                    try {
                        if (!BuiltinVariables.isSupported((String)string) || !ServerVariables.isValidForContext(string, this)) break block4;
                    }
                    catch (NullPointerException nullPointerException) {
                        throw com.l7tech.server.message.b.a(nullPointerException);
                    }
                    bl2 = true;
                    break block5;
                }
                catch (NullPointerException nullPointerException) {
                    throw com.l7tech.server.message.b.a(nullPointerException);
                }
            }
            bl2 = false;
        }
        return bl2;
    }

    protected void setBuiltinVariable(String string, Object object) throws NoSuchVariableException {
        ServerVariables.set(string, object, this);
    }

    protected Object getBuiltinVariable(String string) throws NoSuchVariableException {
        return ServerVariables.get(string, this);
    }

    @Override
    public Object getVariable(String string) throws NoSuchVariableException {
        Object object = this.a(string);
        try {
            if (object == null) {
                throw new NoSuchVariableException(string, V[12] + string + V[19]);
            }
        }
        catch (NoSuchVariableException noSuchVariableException) {
            throw com.l7tech.server.message.b.a((Exception)((Object)noSuchVariableException));
        }
        return object;
    }

    private Object a(String string) throws NoSuchVariableException {
        Object object = this.isBuiltinVariable(string) ? this.getBuiltinVariable(string) : this.p.get(string);
        return object;
    }

    @Override
    public Map<String, Object> getAllVariables() {
        return Collections.unmodifiableMap(this.p);
    }

    private Pair<String, Object> b(String string) throws NoSuchVariableException {
        Object object;
        String string2 = string;
        if (this.isBuiltinVariable(string)) {
            object = this.getBuiltinVariable(string);
        } else {
            String string3 = Syntax.getMatchingName((String)string, this.p.keySet());
            if (string3 != null) {
                string2 = string3;
                object = this.p.get(string3);
            } else {
                String[] stringArray = V;
                throw new NoSuchVariableException(string, stringArray[15] + string + stringArray[0]);
            }
        }
        return new Pair((Object)string2, object);
    }

    @Override
    public Map<String, Object> getVariableMap(String[] stringArray, Audit audit) {
        TreeMap<String, Object> treeMap = new TreeMap<String, Object>(String.CASE_INSENSITIVE_ORDER);
        for (String string : stringArray) {
            try {
                Pair<String, Object> pair = this.b(string);
                try {
                    treeMap.put((String)pair.left, pair.right);
                    if (pair.right != null) continue;
                    audit.logAndAudit((AuditDetailMessage)AssertionMessages.VARIABLE_IS_NULL, new String[]{string});
                }
                catch (NoSuchVariableException noSuchVariableException) {
                    throw com.l7tech.server.message.b.a((Exception)((Object)noSuchVariableException));
                }
            }
            catch (NoSuchVariableException noSuchVariableException) {
                audit.logAndAudit((AuditDetailMessage)AssertionMessages.NO_SUCH_VARIABLE, new String[]{string});
            }
        }
        return treeMap;
    }

    @Override
    public void routingStarted() {
        this.w = System.currentTimeMillis();
    }

    @Override
    public void routingFinished() {
        this.x = System.currentTimeMillis();
        this.y += this.x - this.w;
    }

    @Override
    public long getRoutingStartTime() {
        return this.w;
    }

    @Override
    public long getRoutingEndTime() {
        return this.x;
    }

    @Override
    public long getRoutingTotalTime() {
        return this.y;
    }

    @Override
    public Pair<Binding, Operation> getBindingAndOperation() throws IOException, SAXException, WSDLException, InvalidDocumentFormatException {
        block13: {
            try {
                if (this.s) {
                    return this.t;
                }
            }
            catch (IOException iOException) {
                throw com.l7tech.server.message.b.a(iOException);
            }
            try {
                block12: {
                    try {
                        try {
                            this.s = true;
                            if (this.n == null || this.n.getWsdlXml() == null) break block12;
                        }
                        catch (IOException iOException) {
                            throw com.l7tech.server.message.b.a(iOException);
                        }
                        if (this.n.getWsdlXml().length() > 0) break block13;
                    }
                    catch (IOException iOException) {
                        throw com.l7tech.server.message.b.a(iOException);
                    }
                }
                return null;
            }
            catch (IOException iOException) {
                throw com.l7tech.server.message.b.a(iOException);
            }
        }
        Wsdl wsdl = this.n.parsedWsdl();
        SoapVersion soapVersion = this.n.getSoapVersion();
        Pair pair = SoapUtil.getBindingAndOperation((Wsdl)wsdl, (Message)this.getRequest(), (SoapVersion)soapVersion);
        try {
            if (pair != null) {
                this.t = pair;
            }
        }
        catch (IOException iOException) {
            throw com.l7tech.server.message.b.a(iOException);
        }
        return this.t;
    }

    @Override
    public boolean isStealthResponseMode() {
        boolean bl2;
        block5: {
            block4: {
                try {
                    try {
                        if (this.k == null || this.k.getLevel() != 0) break block4;
                    }
                    catch (NullPointerException nullPointerException) {
                        throw com.l7tech.server.message.b.a(nullPointerException);
                    }
                    bl2 = true;
                    break block5;
                }
                catch (NullPointerException nullPointerException) {
                    throw com.l7tech.server.message.b.a(nullPointerException);
                }
            }
            bl2 = false;
        }
        return bl2;
    }

    @Override
    public long getStartTime() {
        return this.a;
    }

    @Override
    public long getAssertionLatencyNanos() {
        return this.b;
    }

    @Override
    public void setAssertionLatencyNanos(long l2) {
        this.b = l2;
    }

    @Override
    public URL getRoutedServiceUrl() {
        return this.v;
    }

    @Override
    public void setRoutedServiceUrl(URL uRL) {
        this.v = uRL;
    }

    @Override
    public long getEndTime() {
        return this.c;
    }

    @Override
    public void setEndTime() {
        try {
            if (this.c != 0L) {
                throw new IllegalStateException(V[5]);
            }
        }
        catch (NullPointerException nullPointerException) {
            throw com.l7tech.server.message.b.a(nullPointerException);
        }
        this.c = System.currentTimeMillis();
    }

    @Override
    public SoapFaultLevel getFaultlevel() {
        return this.k;
    }

    @Override
    public void setFaultlevel(SoapFaultLevel soapFaultLevel) {
        this.k = soapFaultLevel;
    }

    @Override
    public void assertionStarting(ServerAssertion serverAssertion) {
        try {
            this.U = serverAssertion;
            if (this.M != null) {
                this.M.onStartAssertion(this, this.U);
            }
        }
        catch (NullPointerException nullPointerException) {
            throw com.l7tech.server.message.b.a(nullPointerException);
        }
    }

    @Override
    public void assertionFinished(ServerAssertion serverAssertion, AssertionStatus assertionStatus, @Nullable LatencyMetrics latencyMetrics) {
        block13: {
            try {
                try {
                    if (serverAssertion != null && assertionStatus != null) break block13;
                }
                catch (NullPointerException nullPointerException) {
                    throw com.l7tech.server.message.b.a(nullPointerException);
                }
                throw new NullPointerException();
            }
            catch (NullPointerException nullPointerException) {
                throw com.l7tech.server.message.b.a(nullPointerException);
            }
        }
        try {
            this.S.put(serverAssertion, assertionStatus);
            if (this.L != null) {
                this.L.assertionFinished(serverAssertion, assertionStatus, latencyMetrics);
            }
        }
        catch (NullPointerException nullPointerException) {
            throw com.l7tech.server.message.b.a(nullPointerException);
        }
        try {
            if (this.M != null) {
                this.M.onFinishAssertion(this);
            }
        }
        catch (NullPointerException nullPointerException) {
            throw com.l7tech.server.message.b.a(nullPointerException);
        }
        try {
            this.U = null;
            if (latencyMetrics != null) {
                GatewayMetricsUtils.publishAssertionFinish(this, serverAssertion, latencyMetrics);
            }
        }
        catch (NullPointerException nullPointerException) {
            throw com.l7tech.server.message.b.a(nullPointerException);
        }
    }

    @Override
    public List<PolicyEnforcementContext.AssertionResult> getAssertionResults() {
        if (this.T == null) {
            this.T = new LinkedList();
            for (Map.Entry<ServerAssertion, AssertionStatus> entry : this.S.entrySet()) {
                ServerAssertion serverAssertion = entry.getKey();
                AssertionStatus assertionStatus = entry.getValue();
                PolicyEnforcementContext.AssertionResult assertionResult = new PolicyEnforcementContext.AssertionResult((Assertion)serverAssertion.getAssertion(), assertionStatus, serverAssertion);
                this.T.add(assertionResult);
            }
        }
        return this.T;
    }

    @Override
    public Collection<Integer> getAssertionNumber() {
        Integer n2;
        Integer n32;
        ArrayList<Integer> arrayList;
        if (this.K != null) {
            arrayList = new ArrayList(this.K.size() + 1);
            for (Integer n32 : this.K) {
                arrayList.add(n32);
            }
        } else {
            arrayList = new ArrayList<Integer>();
        }
        ServerAssertion serverAssertion = this.U;
        try {
            n2 = serverAssertion == null ? null : (Integer)serverAssertion.getAssertion();
        }
        catch (NullPointerException nullPointerException) {
            throw com.l7tech.server.message.b.a(nullPointerException);
        }
        n32 = n2;
        try {
            if (n32 != null) {
                arrayList.add(n32.getOrdinal());
            }
        }
        catch (NullPointerException nullPointerException) {
            throw com.l7tech.server.message.b.a(nullPointerException);
        }
        return arrayList;
    }

    @Override
    public Message getTargetMessage(MessageTargetable messageTargetable) throws NoSuchVariableException {
        return this.getTargetMessage(messageTargetable, false);
    }

    /*
     * Loose catch block
     */
    @Override
    public Message getOrCreateTargetMessage(MessageTargetable messageTargetable, boolean bl2) throws NoSuchVariableException, VariableNotSettableException {
        Message message;
        block15: {
            String string;
            block17: {
                block18: {
                    block16: {
                        message = null;
                        string = null;
                        switch (messageTargetable.getTarget()) {
                            case REQUEST: {
                                message = this.getRequest();
                                break;
                            }
                            case RESPONSE: {
                                message = this.getResponse();
                                break;
                            }
                            case OTHER: {
                                string = messageTargetable.getOtherTargetMessageVariable();
                            }
                        }
                        if (message != null) break block15;
                        try {
                            block19: {
                                if (string != null) break block16;
                                break block19;
                                catch (NoSuchVariableException noSuchVariableException) {
                                    throw com.l7tech.server.message.b.a((Exception)((Object)noSuchVariableException));
                                }
                            }
                            throw new NoSuchVariableException(V[2], V[6]);
                        }
                        catch (NoSuchVariableException noSuchVariableException) {
                            throw com.l7tech.server.message.b.a((Exception)((Object)noSuchVariableException));
                        }
                    }
                    Object object = null;
                    try {
                        object = this.a(string);
                    }
                    catch (NoSuchVariableException noSuchVariableException) {
                        // empty catch block
                    }
                    try {
                        try {
                            if (object == null) break block17;
                            if (object instanceof Message) break block18;
                        }
                        catch (NoSuchVariableException noSuchVariableException) {
                            throw com.l7tech.server.message.b.a((Exception)((Object)noSuchVariableException));
                        }
                        if (!bl2) break block17;
                    }
                    catch (NoSuchVariableException noSuchVariableException) {
                        throw com.l7tech.server.message.b.a((Exception)((Object)noSuchVariableException));
                    }
                }
                message = this.getTargetMessage(messageTargetable, bl2);
                break block15;
            }
            message = new Message();
            this.setVariable(string, message);
            Message message2 = message;
            this.runOnClose(new f(this, message2));
        }
        return message;
    }

    /*
     * Exception decompiling
     */
    @Override
    public Message getTargetMessage(MessageTargetable var1_1, boolean var2_2) throws NoSuchVariableException {
        /*
         * This method has failed to decompile.  When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file.
         * 
         * org.benf.cfr.reader.util.ConfusedCFRException: Tried to end blocks [0[TRYBLOCK]], but top level block is 2[SWITCH]
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.processEndingBlocks(Op04StructuredStatement.java:435)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:484)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:736)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:850)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201)
         *     at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94)
         *     at org.benf.cfr.reader.entities.Method.analyse(Method.java:531)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942)
         *     at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257)
         *     at org.benf.cfr.reader.Driver.doJar(Driver.java:139)
         *     at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76)
         *     at org.benf.cfr.reader.Main.main(Main.java:54)
         */
        throw new IllegalStateException("Decompilation failed");
    }

    @Override
    public boolean isResponseWss11() {
        boolean bl2;
        block8: {
            block7: {
                try {
                    if (this.E) {
                        return true;
                    }
                }
                catch (NullPointerException nullPointerException) {
                    throw com.l7tech.server.message.b.a(nullPointerException);
                }
                ProcessorResult processorResult = this.getRequest().getSecurityKnob().getProcessorResult();
                try {
                    try {
                        if (processorResult == null || !processorResult.isWsse11Seen()) break block7;
                    }
                    catch (NullPointerException nullPointerException) {
                        throw com.l7tech.server.message.b.a(nullPointerException);
                    }
                    bl2 = true;
                    break block8;
                }
                catch (NullPointerException nullPointerException) {
                    throw com.l7tech.server.message.b.a(nullPointerException);
                }
            }
            bl2 = false;
        }
        return bl2;
    }

    @Override
    public void setResponseWss11(boolean bl2) {
        this.E = bl2;
    }

    @Override
    public void setMalformedRequest() {
        this.F = true;
    }

    @Override
    public boolean isMalformedRequest() {
        return this.F;
    }

    @Override
    public void setSavedRequestL7aMessageId(String string) {
        this.J = string;
    }

    @Override
    public String getSavedRequestL7aMessageId() {
        return this.J;
    }

    @Override
    public void setPolicyExecutionAttempted(boolean bl2) {
        this.G = bl2;
    }

    @Override
    public DebugContext getDebugContext() {
        return this.M;
    }

    @Override
    public void setDebugContext(DebugContext debugContext) {
        this.M = debugContext;
    }

    @Override
    public OtelContext getOtelContext() {
        return this.P;
    }

    @Override
    @Nullable
    public void setOtelContext(OtelContext otelContext) {
        this.P = otelContext;
    }

    @Override
    public void setAuditContext(@Nullable AuditContext auditContext) {
        this.Q = auditContext;
    }

    @Override
    @Nullable
    public AuditContext getAuditContext() {
        return this.Q;
    }

    @Override
    public boolean isOverwriteResponseCookiePath() {
        return this.H;
    }

    @Override
    public void setOverwriteResponseCookiePath(boolean bl2) {
        this.H = bl2;
    }

    @Override
    public boolean isOverwriteResponseCookieDomain() {
        return this.I;
    }

    @Override
    public void setOverwriteResponseCookieDomain(boolean bl2) {
        this.I = bl2;
    }

    @Override
    public boolean isPolicyExecutionAttempted() {
        return this.G;
    }

    @Override
    public AssertionStatus getPolicyResult() {
        return this.z;
    }

    @Override
    public void setPolicyResult(AssertionStatus assertionStatus) {
        this.z = assertionStatus;
        this.A = null;
        this.B = null;
    }

    void a() {
        boolean bl2;
        boolean bl3;
        block14: {
            bl3 = false;
            bl2 = false;
            RoutingStatus routingStatus = this.getRoutingStatus();
            if (this.getPolicyResult() == AssertionStatus.NONE) {
                bl3 = true;
                if (routingStatus == RoutingStatus.NONE) {
                    bl2 = true;
                } else {
                    block15: {
                        try {
                            try {
                                if (routingStatus != RoutingStatus.ROUTED) break block14;
                                if (!this.getRequest().isHttpRequest()) break block15;
                            }
                            catch (NullPointerException nullPointerException) {
                                throw com.l7tech.server.message.b.a(nullPointerException);
                            }
                            if (this.getResponse().getHttpResponseKnob().getStatus() >= 400) break block14;
                        }
                        catch (NullPointerException nullPointerException) {
                            throw com.l7tech.server.message.b.a(nullPointerException);
                        }
                    }
                    bl2 = true;
                }
            } else {
                block16: {
                    try {
                        try {
                            try {
                                if (routingStatus == RoutingStatus.ATTEMPTED) break block16;
                                if (routingStatus != RoutingStatus.ROUTED) break block14;
                            }
                            catch (NullPointerException nullPointerException) {
                                throw com.l7tech.server.message.b.a(nullPointerException);
                            }
                            if (!this.getRequest().isHttpRequest()) break block14;
                        }
                        catch (NullPointerException nullPointerException) {
                            throw com.l7tech.server.message.b.a(nullPointerException);
                        }
                        if (this.getResponse().getHttpResponseKnob().getStatus() < 400) break block14;
                    }
                    catch (NullPointerException nullPointerException) {
                        throw com.l7tech.server.message.b.a(nullPointerException);
                    }
                }
                bl3 = true;
            }
        }
        this.A = bl3;
        this.B = bl2;
    }

    @Override
    public boolean isAuthorizedRequest() {
        try {
            if (this.A == null) {
                this.a();
            }
        }
        catch (NullPointerException nullPointerException) {
            throw com.l7tech.server.message.b.a(nullPointerException);
        }
        return this.A;
    }

    @Override
    public boolean isCompletedRequest() {
        try {
            if (this.B == null) {
                this.a();
            }
        }
        catch (NullPointerException nullPointerException) {
            throw com.l7tech.server.message.b.a(nullPointerException);
        }
        return this.B;
    }

    @Override
    @NotNull
    public List<MessageContextMapping> getMappings() {
        List<MessageContextMapping> list;
        try {
            list = this.C;
            if (list == null) {
                com.l7tech.server.message.b.a(3);
            }
        }
        catch (NullPointerException nullPointerException) {
            throw com.l7tech.server.message.b.a(nullPointerException);
        }
        return list;
    }

    @Override
    public void setMappings(List<MessageContextMapping> list) {
        this.C = list;
    }

    @Override
    public Collection<Integer> getAssertionOrdinalPath() {
        ArrayList<Integer> arrayList;
        try {
            arrayList = this.K == null ? Collections.emptyList() : new ArrayList<Integer>(this.K);
        }
        catch (NullPointerException nullPointerException) {
            throw com.l7tech.server.message.b.a(nullPointerException);
        }
        return arrayList;
    }

    @Override
    public void pushAssertionOrdinal(int n2) {
        try {
            if (this.K == null) {
                this.K = new LinkedList<Integer>();
            }
        }
        catch (NullPointerException nullPointerException) {
            throw com.l7tech.server.message.b.a(nullPointerException);
        }
        this.K.addLast(n2);
        this.U = null;
    }

    @Override
    public int popAssertionOrdinal() {
        try {
            if (this.K == null) {
                throw new NoSuchElementException(V[10]);
            }
        }
        catch (NullPointerException nullPointerException) {
            throw com.l7tech.server.message.b.a(nullPointerException);
        }
        return this.K.removeLast();
    }

    @Override
    public void passDownAssertionOrdinal(@NotNull PolicyEnforcementContext policyEnforcementContext) {
        try {
            if (policyEnforcementContext == null) {
                com.l7tech.server.message.b.a(4);
            }
        }
        catch (NullPointerException nullPointerException) {
            throw com.l7tech.server.message.b.a(nullPointerException);
        }
        if (this.K != null) {
            for (Integer n2 : this.K) {
                policyEnforcementContext.pushAssertionOrdinal(n2);
            }
        }
    }

    @Override
    public void setTraceListener(AssertionTraceListener assertionTraceListener) {
        this.L = assertionTraceListener;
    }

    @Override
    public boolean hasTraceListener() {
        boolean bl2;
        try {
            bl2 = this.L != null;
        }
        catch (NullPointerException nullPointerException) {
            throw com.l7tech.server.message.b.a(nullPointerException);
        }
        return bl2;
    }

    @Override
    public AssertionTraceListener getTraceListener() {
        return this.L;
    }

    @Override
    public boolean isRequestWasCompressed() {
        return this.D;
    }

    @Override
    public void setRequestWasCompressed(boolean bl2) {
        this.D = bl2;
    }

    @Override
    public void setGatewayMetricsEventsPublisher(@Nullable GatewayMetricsPublisher gatewayMetricsPublisher) {
        this.R = gatewayMetricsPublisher;
    }

    @Override
    @Nullable
    public GatewayMetricsPublisher getGatewayMetricsEventsPublisher() {
        return this.R;
    }

    /*
     * Exception decompiling
     */
    private static /* synthetic */ void a(int var0) {
        /*
         * This method has failed to decompile.  When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file.
         * 
         * org.benf.cfr.reader.util.ConfusedCFRException: Tried to end blocks [0[TRYBLOCK]], but top level block is 6[SWITCH]
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.processEndingBlocks(Op04StructuredStatement.java:435)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:484)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:736)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:850)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201)
         *     at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94)
         *     at org.benf.cfr.reader.entities.Method.analyse(Method.java:531)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1050)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942)
         *     at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257)
         *     at org.benf.cfr.reader.Driver.doJar(Driver.java:139)
         *     at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76)
         *     at org.benf.cfr.reader.Main.main(Main.java:54)
         */
        throw new IllegalStateException("Decompilation failed");
    }

    private static Exception a(Exception exception) {
        return exception;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[24];
                var3_1 = 0;
                var2_2 = "Pz\u001a<\u0000=%R4\u0016'U3$R<\u0016&\u001b5o\t\u0000?\b&\u0010\"5;>\u0006N\u0014,\u001f9o\n\u00063\u00146&>4\u00009\u001c\n\u0000?\b&\u0010\"5_3\u001d\u001d1;\u0017t\u0001q\"\u00136\u0015s\u00064574\u001d\u0007\u001c<$ZsY'\u00028\"\u0017\u001d&;\u000b4\u0010%a\u0004;\u000b:\u00143-\u0017z\u00172\u00184a\u001b)Y=\u0000=-\\>3(\u001e&\u00184/\u0006z\u001f<\u0007q\u0001<5\r\u001d\u0000=-R*\u0018!\u0014<$\u0006?\u000bsRt2Uz\u00165Ut2\\\u007f\ns\u0018$2\u0006z\u0017<\u0001q#\u0017z\u0017&\u0019=\n$;\u000b:\u00143-\u0017z^,Uz\u0010 U\"4\u0002*\u0016 \u00105-\u000bz\n&\u0005!.\u0000.\u001c7Yq#\u0007.Y7\u001a42\u001c}\rs\u0010)(\u0001.\u0019\u001c5Y2\u0006\"$\u0000.\u0010<\u001bq.\u0000>\u0010=\u0014=a\u0002;\r;\u0006N3\u0017:\u0001o\u000e&2\u001cs\u000303\u001b;\u001b?\u0010qc\u000b\u0015?\r\u001e\u0014!1\u001b4\u001e ,&;\u000b4\u0010%a\u001b)Y\u001c!\u0019\u0004 z\u001b&\u0001q/\u001dz\u000f2\u00078 \u00106\u001cs\u001b0,\u0017z\u000e2\u0006q2\u0017.\u000e&2\u001cs\u000303\u001b;\u001b?\u0010qc\u001c'4\n&\u0005!.\u0000.\u001c7U<$\u0001)\u00184\u0010q5\u0013(\u001e6\u0001ka\u0018\u0002;\n 1>6\u001c\u001b\n \u0010#5\u001b5\u0017\u001c\u00075(\u001c;\u0015*2\u0014\u0016';$-\u001ez\u00146\u00019.\u0016z\\ [t2R7\f \u0001q/\u001d.Y!\u0010%4\u00004Y=\u0000=-\u0015Pz\u001a<\u0000=%R4\u0016'U3$R<\u0016&\u001b5o\u0005\u00112\u0010?\u0011 \u0013)\n6\u0007%(\u001d4*'\u0014%4\u0001z\u0014&\u0006%a\u001c5\rs\u00174a\u001c/\u0015?";
                var4_3 = "Pz\u001a<\u0000=%R4\u0016'U3$R<\u0016&\u001b5o\t\u0000?\b&\u0010\"5;>\u0006N\u0014,\u001f9o\n\u00063\u00146&>4\u00009\u001c\n\u0000?\b&\u0010\"5_3\u001d\u001d1;\u0017t\u0001q\"\u00136\u0015s\u00064574\u001d\u0007\u001c<$ZsY'\u00028\"\u0017\u001d&;\u000b4\u0010%a\u0004;\u000b:\u00143-\u0017z\u00172\u00184a\u001b)Y=\u0000=-\\>3(\u001e&\u00184/\u0006z\u001f<\u0007q\u0001<5\r\u001d\u0000=-R*\u0018!\u0014<$\u0006?\u000bsRt2Uz\u00165Ut2\\\u007f\ns\u0018$2\u0006z\u0017<\u0001q#\u0017z\u0017&\u0019=\n$;\u000b:\u00143-\u0017z^,Uz\u0010 U\"4\u0002*\u0016 \u00105-\u000bz\n&\u0005!.\u0000.\u001c7Yq#\u0007.Y7\u001a42\u001c}\rs\u0010)(\u0001.\u0019\u001c5Y2\u0006\"$\u0000.\u0010<\u001bq.\u0000>\u0010=\u0014=a\u0002;\r;\u0006N3\u0017:\u0001o\u000e&2\u001cs\u000303\u001b;\u001b?\u0010qc\u000b\u0015?\r\u001e\u0014!1\u001b4\u001e ,&;\u000b4\u0010%a\u001b)Y\u001c!\u0019\u0004 z\u001b&\u0001q/\u001dz\u000f2\u00078 \u00106\u001cs\u001b0,\u0017z\u000e2\u0006q2\u0017.\u000e&2\u001cs\u000303\u001b;\u001b?\u0010qc\u001c'4\n&\u0005!.\u0000.\u001c7U<$\u0001)\u00184\u0010q5\u0013(\u001e6\u0001ka\u0018\u0002;\n 1>6\u001c\u001b\n \u0010#5\u001b5\u0017\u001c\u00075(\u001c;\u0015*2\u0014\u0016';$-\u001ez\u00146\u00019.\u0016z\\ [t2R7\f \u0001q/\u001d.Y!\u0010%4\u00004Y=\u0000=-\u0015Pz\u001a<\u0000=%R4\u0016'U3$R<\u0016&\u001b5o\u0005\u00112\u0010?\u0011 \u0013)\n6\u0007%(\u001d4*'\u0014%4\u0001z\u0014&\u0006%a\u001c5\rs\u00174a\u001c/\u0015?".length();
                var1_4 = 21;
                var0_5 = -1;
lbl7:
                // 2 sources

                while (true) {
                    v0 = 74;
                    v1 = ++var0_5;
                    v2 = var2_2.substring(v1, v1 + var1_4);
                    v3 = -1;
                    break block9;
                    break;
                }
lbl13:
                // 1 sources

                while (true) {
                    var5[var3_1++] = com.l7tech.server.message.b.b(v0, com.l7tech.server.message.b.c(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "5\u00110X=B\u00113\u001d5X\"\u0010\u0017 \u001b/X<\u0010\u0016%\u001f:\u0012~\u0017\u001b5\u00110X=B\u00113\u001d5X\"\u0010\u0017 \u001b/X<\u0010\u0016%\u001f:\u0012~\u0017";
                    var4_3 = "5\u00110X=B\u00113\u001d5X\"\u0010\u0017 \u001b/X<\u0010\u0016%\u001f:\u0012~\u0017\u001b5\u00110X=B\u00113\u001d5X\"\u0010\u0017 \u001b/X<\u0010\u0016%\u001f:\u0012~\u0017".length();
                    var1_4 = 27;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 110;
                        v4 = ++var0_5;
                        v2 = var2_2.substring(v4, v4 + var1_4);
                        v3 = 0;
                        break block9;
                        break;
                    }
                    break;
                }
lbl28:
                // 1 sources

                while (true) {
                    var5[var3_1++] = com.l7tech.server.message.b.b(v0, com.l7tech.server.message.b.c(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    break block10;
                    break;
                }
            }
            switch (v3) {
                default: {
                    ** continue;
                }
                ** case 0:
lbl39:
                // 1 sources

                ** continue;
            }
        }
        com.l7tech.server.message.b.V = var5;
    }

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

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String b(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 -> 56;
                    case 1 -> 16;
                    case 2 -> 51;
                    case 3 -> 25;
                    case 4 -> 63;
                    case 5 -> 27;
                    default -> 11;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

