package com.l7tech.external.assertions.gatewaymanagement.server;

import com.l7tech.common.io.XmlUtil;
import com.l7tech.gateway.api.ManagedObjectFactory;
import com.l7tech.gateway.api.PolicyExportResult;
import com.l7tech.gateway.api.PolicyImportResult;
import com.l7tech.gateway.api.PolicyValidationResult;
import com.l7tech.gateway.api.Resource;
import com.l7tech.gateway.api.PolicyImportResult.ImportedPolicyReference;
import com.l7tech.gateway.api.PolicyValidationResult.AssertionDetail;
import com.l7tech.gateway.api.PolicyValidationResult.PolicyValidationMessage;
import com.l7tech.gateway.api.PolicyValidationResult.ValidationStatus;
import com.l7tech.gateway.api.impl.PolicyImportContext;
import com.l7tech.gateway.api.impl.PolicyValidationContext;
import com.l7tech.gateway.common.cassandra.CassandraConnection;
import com.l7tech.gateway.common.custom.CustomAssertionsRegistrar;
import com.l7tech.gateway.common.export.ExternalReferenceFactory;
import com.l7tech.gateway.common.jdbc.JdbcConnection;
import com.l7tech.gateway.common.resources.ResourceEntryHeader;
import com.l7tech.gateway.common.resources.ResourceType;
import com.l7tech.gateway.common.security.keystore.SsgKeyEntry;
import com.l7tech.gateway.common.security.password.SecurePassword;
import com.l7tech.gateway.common.security.rbac.OperationType;
import com.l7tech.gateway.common.security.rbac.PermissionDeniedException;
import com.l7tech.gateway.common.siteminder.SiteMinderConfiguration;
import com.l7tech.gateway.common.transport.SsgActiveConnector;
import com.l7tech.gateway.common.transport.jms.JmsConnection;
import com.l7tech.gateway.common.transport.jms.JmsEndpoint;
import com.l7tech.identity.Group;
import com.l7tech.identity.IdentityProvider;
import com.l7tech.identity.IdentityProviderConfig;
import com.l7tech.identity.IdentityProviderConfigManager;
import com.l7tech.identity.User;
import com.l7tech.objectmodel.Entity;
import com.l7tech.objectmodel.EntityHeader;
import com.l7tech.objectmodel.EntityHeaderSet;
import com.l7tech.objectmodel.EntityManager;
import com.l7tech.objectmodel.EntityType;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.IdentityHeader;
import com.l7tech.objectmodel.ObjectNotFoundException;
import com.l7tech.policy.AssertionLicense;
import com.l7tech.policy.GenericEntity;
import com.l7tech.policy.GenericEntityHeader;
import com.l7tech.policy.Policy;
import com.l7tech.policy.PolicyType;
import com.l7tech.policy.PolicyValidator;
import com.l7tech.policy.PolicyValidatorResult;
import com.l7tech.policy.PolicyValidatorResult.Error;
import com.l7tech.policy.PolicyValidatorResult.Message;
import com.l7tech.policy.assertion.Assertion;
import com.l7tech.policy.assertion.Include;
import com.l7tech.policy.assertion.PolicyReference;
import com.l7tech.policy.assertion.RoutingAssertion;
import com.l7tech.policy.assertion.composite.AllAssertion;
import com.l7tech.policy.assertion.composite.CompositeAssertion;
import com.l7tech.policy.assertion.ext.entity.CustomEntitySerializer;
import com.l7tech.policy.assertion.ext.store.KeyValueStore;
import com.l7tech.policy.exporter.ExternalReference;
import com.l7tech.policy.exporter.ExternalReferenceErrorListener;
import com.l7tech.policy.exporter.ExternalReferenceFinder;
import com.l7tech.policy.exporter.GlobalResourceReference;
import com.l7tech.policy.exporter.IncludedPolicyReference;
import com.l7tech.policy.exporter.JdbcConnectionReference;
import com.l7tech.policy.exporter.PolicyExporter;
import com.l7tech.policy.exporter.PolicyImporter.PolicyImporterAdvisor;
import com.l7tech.policy.wsp.WspReader;
import com.l7tech.security.cert.TrustedCert;
import com.l7tech.security.cert.TrustedCertManager;
import com.l7tech.server.cassandra.CassandraConnectionEntityManager;
import com.l7tech.server.entity.GenericEntityManager;
import com.l7tech.server.globalresources.HttpConfigurationManager;
import com.l7tech.server.globalresources.ResourceEntryManager;
import com.l7tech.server.identity.IdentityProviderFactory;
import com.l7tech.server.jdbc.JdbcConnectionManager;
import com.l7tech.server.policy.CustomKeyValueStoreManager;
import com.l7tech.server.policy.PolicyAssertionRbacChecker;
import com.l7tech.server.policy.PolicyManager;
import com.l7tech.server.policy.export.PolicyExporterImporterManager;
import com.l7tech.server.security.keystore.SsgKeyStoreManager;
import com.l7tech.server.security.password.SecurePasswordManager;
import com.l7tech.server.security.rbac.RbacServices;
import com.l7tech.server.security.rbac.RoleManager;
import com.l7tech.server.security.rbac.SecurityFilter;
import com.l7tech.server.siteminder.SiteMinderConfigurationManager;
import com.l7tech.server.transport.SsgActiveConnectorManager;
import com.l7tech.server.transport.jms.JmsConnectionManager;
import com.l7tech.server.transport.jms.JmsEndpointManager;
import com.l7tech.server.util.JaasUtils;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.GoidUpgradeMapper;
import com.l7tech.util.Option;
import com.l7tech.util.Pair;
import com.l7tech.util.Triple;
import com.l7tech.wsdl.Wsdl;
import com.l7tech.xml.soap.SoapVersion;
import java.io.IOException;
import java.security.KeyStoreException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.logging.Logger;
import javax.wsdl.WSDLException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.w3c.dom.Document;
import org.xml.sax.EntityResolver;
import org.xml.sax.SAXException;

public class PolicyHelper {
   private static final Logger a;
   private static final String b;
   private static final String c;
   private final AssertionLicense d;
   private final PolicyValidator e;
   private final WspReader f;
   private final PolicyHelper.GatewayExternalReferenceFinder g;
   private final EntityResolver h;
   private final PolicyAssertionRbacChecker i;
   private final cr j = new cr();
   private static final String[] k;

   public PolicyHelper(
      AssertionLicense var1,
      PolicyValidator var2,
      WspReader var3,
      PolicyHelper.GatewayExternalReferenceFinder var4,
      EntityResolver var5,
      PolicyAssertionRbacChecker var6
   ) {
      this.d = var1;
      this.e = var2;
      this.f = var3;
      this.g = var4;
      this.h = var5;
      this.i = var6;
   }

   public PolicyExportResult exportPolicy(Policy var1) {
      try {
         PolicyExporter var2 = new PolicyExporter(this.g, this.h);
         Document var3 = var2.exportToDocument(var1.getAssertion(), this.g.findAllExternalReferenceFactories());
         PolicyExportResult var4 = ManagedObjectFactory.createPolicyExportResult();
         Resource var5 = ManagedObjectFactory.createResource();
         String[] var12 = k;
         var5.setType(var12[26]);
         var5.setContent(XmlUtil.nodeToFormattedString(var3));
         var4.setResource(var5);
         return var4;
      } catch (SAXException var7) {
         String var14 = ExceptionUtils.getMessage(var7);
         String[] var11 = k;
         throw new ResourceFactory.ResourceAccessException(var11[44] + var14 + var11[28], var7);
      } catch (IOException var8) {
         String var13 = ExceptionUtils.getMessage(var8);
         String[] var10 = k;
         throw new ResourceFactory.ResourceAccessException(var10[10] + var13 + var10[31], var8);
      } catch (FindException var9) {
         String var10002 = ExceptionUtils.getMessage(var9);
         String[] var6 = k;
         throw new ResourceFactory.ResourceAccessException(var6[10] + var10002 + var6[31], var9);
      }
   }

   public PolicyImportResult importPolicy(Policy param1, PolicyImportContext param2) throws ResourceFactory.InvalidResourceException {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 000: aload 2
      // 001: ifnonnull 019
      // 004: new com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException
      // 007: dup
      // 008: getstatic com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType.MISSING_VALUES Lcom/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType;
      // 00b: getstatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.k [Ljava/lang/String;
      // 00e: bipush 39
      // 010: aaload
      // 011: invokespecial com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException.<init> (Lcom/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType;Ljava/lang/String;)V
      // 014: athrow
      // 015: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 018: athrow
      // 019: aload 2
      // 01a: invokevirtual com/l7tech/gateway/api/impl/PolicyImportContext.getResource ()Lcom/l7tech/gateway/api/Resource;
      // 01d: ifnonnull 035
      // 020: new com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException
      // 023: dup
      // 024: getstatic com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType.MISSING_VALUES Lcom/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType;
      // 027: getstatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.k [Ljava/lang/String;
      // 02a: bipush 22
      // 02c: aaload
      // 02d: invokespecial com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException.<init> (Lcom/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType;Ljava/lang/String;)V
      // 030: athrow
      // 031: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 034: athrow
      // 035: aload 2
      // 036: invokevirtual com/l7tech/gateway/api/impl/PolicyImportContext.getResource ()Lcom/l7tech/gateway/api/Resource;
      // 039: astore 3
      // 03a: getstatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.k [Ljava/lang/String;
      // 03d: bipush 4
      // 03e: aaload
      // 03f: aload 3
      // 040: invokevirtual com/l7tech/gateway/api/Resource.getType ()Ljava/lang/String;
      // 043: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 046: ifne 075
      // 049: getstatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.k [Ljava/lang/String;
      // 04c: bipush 20
      // 04e: aaload
      // 04f: aload 3
      // 050: invokevirtual com/l7tech/gateway/api/Resource.getType ()Ljava/lang/String;
      // 053: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 056: ifne 075
      // 059: goto 060
      // 05c: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 05f: athrow
      // 060: new com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException
      // 063: dup
      // 064: getstatic com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType.INVALID_VALUES Lcom/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType;
      // 067: getstatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.k [Ljava/lang/String;
      // 06a: bipush 33
      // 06c: aaload
      // 06d: invokespecial com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException.<init> (Lcom/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType;Ljava/lang/String;)V
      // 070: athrow
      // 071: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 074: athrow
      // 075: aload 3
      // 076: invokevirtual com/l7tech/gateway/api/Resource.getContent ()Ljava/lang/String;
      // 079: astore 4
      // 07b: aload 4
      // 07d: ifnonnull 094
      // 080: new com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException
      // 083: dup
      // 084: getstatic com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType.MISSING_VALUES Lcom/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType;
      // 087: getstatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.k [Ljava/lang/String;
      // 08a: bipush 2
      // 08b: aaload
      // 08c: invokespecial com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException.<init> (Lcom/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType;Ljava/lang/String;)V
      // 08f: athrow
      // 090: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 093: athrow
      // 094: aload 4
      // 096: invokestatic com/l7tech/common/io/XmlUtil.parse (Ljava/lang/String;)Lorg/w3c/dom/Document;
      // 099: astore 5
      // 09b: new java/util/ArrayList
      // 09e: dup
      // 09f: invokespecial java/util/ArrayList.<init> ()V
      // 0a2: astore 6
      // 0a4: new java/util/ArrayList
      // 0a7: dup
      // 0a8: invokespecial java/util/ArrayList.<init> ()V
      // 0ab: astore 7
      // 0ad: new java/util/ArrayList
      // 0b0: dup
      // 0b1: invokespecial java/util/ArrayList.<init> ()V
      // 0b4: astore 8
      // 0b6: new java/util/ArrayList
      // 0b9: dup
      // 0ba: invokespecial java/util/ArrayList.<init> ()V
      // 0bd: astore 9
      // 0bf: aload 1
      // 0c0: aload 5
      // 0c2: aload 0
      // 0c3: getfield com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.g Lcom/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper$GatewayExternalReferenceFinder;
      // 0c6: invokevirtual com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper$GatewayExternalReferenceFinder.findAllExternalReferenceFactories ()Ljava/util/Set;
      // 0c9: aload 0
      // 0ca: getfield com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.f Lcom/l7tech/policy/wsp/WspReader;
      // 0cd: aload 0
      // 0ce: getfield com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.g Lcom/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper$GatewayExternalReferenceFinder;
      // 0d1: aload 0
      // 0d2: getfield com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.h Lorg/xml/sax/EntityResolver;
      // 0d5: aload 0
      // 0d6: aload 7
      // 0d8: invokevirtual com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/util/List;)Lcom/l7tech/policy/exporter/ExternalReferenceErrorListener;
      // 0db: aload 0
      // 0dc: aload 2
      // 0dd: aload 6
      // 0df: aload 8
      // 0e1: aload 9
      // 0e3: invokevirtual com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Lcom/l7tech/gateway/api/impl/PolicyImportContext;Ljava/util/List;Ljava/util/List;Ljava/util/List;)Lcom/l7tech/policy/exporter/PolicyImporter$PolicyImporterAdvisor;
      // 0e6: invokestatic com/l7tech/policy/exporter/PolicyImporter.importPolicy (Lcom/l7tech/policy/Policy;Lorg/w3c/dom/Document;Ljava/util/Set;Lcom/l7tech/policy/wsp/WspReader;Lcom/l7tech/policy/exporter/ExternalReferenceFinder;Lorg/xml/sax/EntityResolver;Lcom/l7tech/policy/exporter/ExternalReferenceErrorListener;Lcom/l7tech/policy/exporter/PolicyImporter$PolicyImporterAdvisor;)Lcom/l7tech/policy/exporter/PolicyImporter$PolicyImporterResult;
      // 0e9: astore 10
      // 0eb: invokestatic com/l7tech/gateway/api/ManagedObjectFactory.createPolicyImportResult ()Lcom/l7tech/gateway/api/PolicyImportResult;
      // 0ee: astore 11
      // 0f0: aload 8
      // 0f2: invokeinterface java/util/List.isEmpty ()Z 1
      // 0f7: ifeq 10b
      // 0fa: aload 9
      // 0fc: invokeinterface java/util/List.isEmpty ()Z 1
      // 101: ifne 122
      // 104: goto 10b
      // 107: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 10a: athrow
      // 10b: aload 0
      // 10c: aload 8
      // 10e: aload 9
      // 110: invokevirtual com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/util/List;Ljava/util/List;)Ljava/lang/String;
      // 113: astore 12
      // 115: new com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException
      // 118: dup
      // 119: getstatic com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType.INVALID_VALUES Lcom/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType;
      // 11c: aload 12
      // 11e: invokespecial com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException.<init> (Lcom/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType;Ljava/lang/String;)V
      // 121: athrow
      // 122: aload 1
      // 123: aload 10
      // 125: getfield com/l7tech/policy/exporter/PolicyImporter$PolicyImporterResult.assertion Lcom/l7tech/policy/assertion/Assertion;
      // 128: invokestatic com/l7tech/policy/wsp/WspWriter.getPolicyXml (Lcom/l7tech/policy/assertion/Assertion;)Ljava/lang/String;
      // 12b: invokevirtual com/l7tech/policy/Policy.setXml (Ljava/lang/String;)V
      // 12e: aload 10
      // 130: getfield com/l7tech/policy/exporter/PolicyImporter$PolicyImporterResult.policyFragments Ljava/util/HashMap;
      // 133: invokevirtual java/util/HashMap.values ()Ljava/util/Collection;
      // 136: invokeinterface java/util/Collection.iterator ()Ljava/util/Iterator; 1
      // 13b: astore 12
      // 13d: aload 12
      // 13f: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 144: ifeq 241
      // 147: aload 12
      // 149: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 14e: checkcast com/l7tech/policy/Policy
      // 151: astore 13
      // 153: aload 0
      // 154: getfield com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.g Lcom/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper$GatewayExternalReferenceFinder;
      // 157: getfield com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper$GatewayExternalReferenceFinder.i Lcom/l7tech/server/policy/PolicyManager;
      // 15a: aload 13
      // 15c: invokevirtual com/l7tech/policy/Policy.getGuid ()Ljava/lang/String;
      // 15f: invokeinterface com/l7tech/server/policy/PolicyManager.findByGuid (Ljava/lang/String;)Lcom/l7tech/policy/Policy; 2
      // 164: ifnonnull 23e
      // 167: aload 13
      // 169: invokevirtual com/l7tech/policy/Policy.getType ()Lcom/l7tech/policy/PolicyType;
      // 16c: getstatic com/l7tech/policy/PolicyType.INCLUDE_FRAGMENT Lcom/l7tech/policy/PolicyType;
      // 16f: if_acmpeq 19d
      // 172: goto 179
      // 175: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 178: athrow
      // 179: aload 13
      // 17b: invokevirtual com/l7tech/policy/Policy.getType ()Lcom/l7tech/policy/PolicyType;
      // 17e: getstatic com/l7tech/policy/PolicyType.INTERNAL Lcom/l7tech/policy/PolicyType;
      // 181: if_acmpeq 19d
      // 184: goto 18b
      // 187: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 18a: athrow
      // 18b: new com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$ResourceAccessException
      // 18e: dup
      // 18f: getstatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.k [Ljava/lang/String;
      // 192: bipush 35
      // 194: aaload
      // 195: invokespecial com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$ResourceAccessException.<init> (Ljava/lang/String;)V
      // 198: athrow
      // 199: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 19c: athrow
      // 19d: aload 13
      // 19f: getstatic com/l7tech/policy/Policy.DEFAULT_GOID Lcom/l7tech/objectmodel/Goid;
      // 1a2: invokevirtual com/l7tech/policy/Policy.setGoid (Lcom/l7tech/objectmodel/Goid;)V
      // 1a5: aload 13
      // 1a7: aconst_null
      // 1a8: invokevirtual com/l7tech/policy/Policy.setFolder (Lcom/l7tech/objectmodel/folder/Folder;)V
      // 1ab: aload 0
      // 1ac: getfield com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.g Lcom/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper$GatewayExternalReferenceFinder;
      // 1af: invokevirtual com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper$GatewayExternalReferenceFinder.a ()Lcom/l7tech/identity/User;
      // 1b2: ifnull 1d8
      // 1b5: aload 0
      // 1b6: getfield com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.g Lcom/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper$GatewayExternalReferenceFinder;
      // 1b9: getfield com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper$GatewayExternalReferenceFinder.a Lcom/l7tech/server/security/rbac/RbacServices;
      // 1bc: aload 0
      // 1bd: getfield com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.g Lcom/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper$GatewayExternalReferenceFinder;
      // 1c0: invokevirtual com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper$GatewayExternalReferenceFinder.a ()Lcom/l7tech/identity/User;
      // 1c3: aload 13
      // 1c5: getstatic com/l7tech/gateway/common/security/rbac/OperationType.CREATE Lcom/l7tech/gateway/common/security/rbac/OperationType;
      // 1c8: aconst_null
      // 1c9: invokeinterface com/l7tech/server/security/rbac/RbacServices.isPermittedForEntity (Lcom/l7tech/identity/User;Lcom/l7tech/objectmodel/Entity;Lcom/l7tech/gateway/common/security/rbac/OperationType;Ljava/lang/String;)Z 5
      // 1ce: ifne 1ea
      // 1d1: goto 1d8
      // 1d4: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 1d7: athrow
      // 1d8: new com/l7tech/gateway/common/security/rbac/PermissionDeniedException
      // 1db: dup
      // 1dc: getstatic com/l7tech/gateway/common/security/rbac/OperationType.CREATE Lcom/l7tech/gateway/common/security/rbac/OperationType;
      // 1df: getstatic com/l7tech/objectmodel/EntityType.POLICY Lcom/l7tech/objectmodel/EntityType;
      // 1e2: invokespecial com/l7tech/gateway/common/security/rbac/PermissionDeniedException.<init> (Lcom/l7tech/gateway/common/security/rbac/OperationType;Lcom/l7tech/objectmodel/EntityType;)V
      // 1e5: athrow
      // 1e6: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 1e9: athrow
      // 1ea: aload 0
      // 1eb: getfield com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.g Lcom/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper$GatewayExternalReferenceFinder;
      // 1ee: getfield com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper$GatewayExternalReferenceFinder.i Lcom/l7tech/server/policy/PolicyManager;
      // 1f1: aload 13
      // 1f3: invokeinterface com/l7tech/server/policy/PolicyManager.save (Lcom/l7tech/objectmodel/PersistentEntity;)Lcom/l7tech/objectmodel/Goid; 2
      // 1f8: astore 14
      // 1fa: invokestatic com/l7tech/gateway/api/ManagedObjectFactory.createImportedPolicyReference ()Lcom/l7tech/gateway/api/PolicyImportResult$ImportedPolicyReference;
      // 1fd: astore 15
      // 1ff: aload 15
      // 201: getstatic com/l7tech/gateway/api/PolicyImportResult$ImportedPolicyReferenceType.CREATED Lcom/l7tech/gateway/api/PolicyImportResult$ImportedPolicyReferenceType;
      // 204: invokevirtual com/l7tech/gateway/api/PolicyImportResult$ImportedPolicyReference.setType (Lcom/l7tech/gateway/api/PolicyImportResult$ImportedPolicyReferenceType;)V
      // 207: aload 15
      // 209: getstatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.k [Ljava/lang/String;
      // 20c: astore 16
      // 20e: aload 16
      // 210: bipush 13
      // 212: aaload
      // 213: invokevirtual com/l7tech/gateway/api/PolicyImportResult$ImportedPolicyReference.setReferenceType (Ljava/lang/String;)V
      // 216: aload 15
      // 218: aload 13
      // 21a: invokevirtual com/l7tech/policy/Policy.getGuid ()Ljava/lang/String;
      // 21d: invokevirtual com/l7tech/gateway/api/PolicyImportResult$ImportedPolicyReference.setReferenceId (Ljava/lang/String;)V
      // 220: aload 15
      // 222: aload 14
      // 224: invokestatic com/l7tech/objectmodel/Goid.toString (Lcom/l7tech/objectmodel/Goid;)Ljava/lang/String;
      // 227: invokevirtual com/l7tech/gateway/api/PolicyImportResult$ImportedPolicyReference.setId (Ljava/lang/String;)V
      // 22a: aload 15
      // 22c: aload 13
      // 22e: invokevirtual com/l7tech/policy/Policy.getGuid ()Ljava/lang/String;
      // 231: invokevirtual com/l7tech/gateway/api/PolicyImportResult$ImportedPolicyReference.setGuid (Ljava/lang/String;)V
      // 234: aload 6
      // 236: aload 15
      // 238: invokeinterface java/util/List.add (Ljava/lang/Object;)Z 2
      // 23d: pop
      // 23e: goto 13d
      // 241: aload 7
      // 243: invokeinterface java/util/List.isEmpty ()Z 1
      // 248: ifne 259
      // 24b: aload 11
      // 24d: aload 7
      // 24f: invokevirtual com/l7tech/gateway/api/PolicyImportResult.setWarnings (Ljava/util/List;)V
      // 252: goto 259
      // 255: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 258: athrow
      // 259: aload 6
      // 25b: invokeinterface java/util/List.isEmpty ()Z 1
      // 260: ifne 271
      // 263: aload 11
      // 265: aload 6
      // 267: invokevirtual com/l7tech/gateway/api/PolicyImportResult.setImportedPolicyReferences (Ljava/util/List;)V
      // 26a: goto 271
      // 26d: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 270: athrow
      // 271: aload 11
      // 273: areturn
      // 274: astore 5
      // 276: new com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$ResourceAccessException
      // 279: dup
      // 27a: aload 5
      // 27c: invokespecial com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$ResourceAccessException.<init> (Ljava/lang/Throwable;)V
      // 27f: athrow
      // 280: astore 5
      // 282: new com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$ResourceAccessException
      // 285: dup
      // 286: aload 5
      // 288: invokespecial com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$ResourceAccessException.<init> (Ljava/lang/Throwable;)V
      // 28b: athrow
      // 28c: astore 5
      // 28e: new com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException
      // 291: dup
      // 292: getstatic com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType.INVALID_VALUES Lcom/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType;
      // 295: aload 5
      // 297: invokestatic com/l7tech/util/ExceptionUtils.getMessage (Ljava/lang/Throwable;)Ljava/lang/String;
      // 29a: getstatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.k [Ljava/lang/String;
      // 29d: astore 16
      // 29f: aload 16
      // 2a1: bipush 32
      // 2a3: aaload
      // 2a4: swap
      // 2a5: ldc "'"
      // 2a7: invokedynamic makeConcatWithConstants (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; bsm=java/lang/invoke/StringConcatFactory.makeConcatWithConstants (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite; args=[ "\u0001\u0001\u0001" ]
      // 2ac: invokespecial com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException.<init> (Lcom/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType;Ljava/lang/String;)V
      // 2af: athrow
      // 2b0: astore 5
      // 2b2: new com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException
      // 2b5: dup
      // 2b6: getstatic com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType.INVALID_VALUES Lcom/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType;
      // 2b9: aload 5
      // 2bb: invokestatic com/l7tech/util/ExceptionUtils.getMessage (Ljava/lang/Throwable;)Ljava/lang/String;
      // 2be: getstatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.k [Ljava/lang/String;
      // 2c1: bipush 11
      // 2c3: aaload
      // 2c4: swap
      // 2c5: ldc "'"
      // 2c7: invokedynamic makeConcatWithConstants (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; bsm=java/lang/invoke/StringConcatFactory.makeConcatWithConstants (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite; args=[ "\u0001\u0001\u0001" ]
      // 2cc: invokespecial com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException.<init> (Lcom/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType;Ljava/lang/String;)V
      // 2cf: athrow
      // try (256 -> 262): 263 com/l7tech/policy/exporter/PolicyImportCancelledException
      // try (247 -> 253): 254 com/l7tech/policy/exporter/PolicyImportCancelledException
      // try (190 -> 210): 210 com/l7tech/policy/exporter/PolicyImportCancelledException
      // try (180 -> 201): 202 com/l7tech/policy/exporter/PolicyImportCancelledException
      // try (164 -> 178): 178 com/l7tech/policy/exporter/PolicyImportCancelledException
      // try (157 -> 168): 169 com/l7tech/policy/exporter/PolicyImportCancelledException
      // try (150 -> 161): 162 com/l7tech/policy/exporter/PolicyImportCancelledException
      // try (113 -> 119): 120 com/l7tech/policy/exporter/PolicyImportCancelledException
      // try (58 -> 68): 68 com/l7tech/policy/exporter/PolicyImportCancelledException
      // try (35 -> 53): 53 com/l7tech/policy/exporter/PolicyImportCancelledException
      // try (28 -> 42): 43 com/l7tech/policy/exporter/PolicyImportCancelledException
      // try (12 -> 23): 23 com/l7tech/policy/exporter/PolicyImportCancelledException
      // try (0 -> 10): 10 com/l7tech/policy/exporter/PolicyImportCancelledException
      // try (70 -> 266): 267 com/l7tech/policy/exporter/PolicyImportCancelledException
      // try (70 -> 266): 273 com/l7tech/objectmodel/ObjectModelException
      // try (70 -> 266): 279 org/xml/sax/SAXException
      // try (70 -> 266): 295 com/l7tech/policy/wsp/InvalidPolicyStreamException
   }

   public PolicyValidationResult validatePolicy(PolicyValidationContext var1, be var2) throws ResourceFactory.InvalidResourceException, ResourceFactory.ResourceNotFoundException {
      PolicyValidationContext var3 = (PolicyValidationContext)Option.optional(var1).orSome(new PolicyValidationContext());
      PolicyType var4 = this.a(var3.getPolicyType());
      String var5 = null;
      String var6 = null;
      boolean var7 = this.a(var3.getProperties());

      SoapVersion var10000;
      label92: {
         try {
            if (var7) {
               var10000 = this.b(var3.getProperties());
               break label92;
            }
         } catch (IOException var31) {
            throw a(var31);
         }

         var10000 = null;
      }

      SoapVersion var8 = var10000;
      Map var9 = this.j.a(var3.getResourceSets());
      String[] var26 = k;
      Wsdl var10 = this.a(this.j.a(var9, var26[27], false, null));
      Assertion var11 = this.b(this.j.a(var9, var26[12], false, null));
      if (var11 == null) {
         Policy var12 = var2.resolve();

         try {
            var11 = var12.getAssertion();
         } catch (IOException var29) {
            var26 = k;
            throw new ResourceFactory.ResourceAccessException(var26[15]);
         }

         var4 = var12.getType();
         var5 = var12.getInternalTag();
         var6 = var12.getInternalSubTag();
         var7 = var12.isSoap();
         var10 = var2.resolveWsdl();
         var8 = var2.resolveSoapVersion();
      }

      PolicyValidatorResult var32;
      try {
         com.l7tech.policy.validator.PolicyValidationContext var13 = new com.l7tech.policy.validator.PolicyValidationContext(
            var4, var5, var6, var10, var7, var8
         );
         var32 = this.e.validate(var11, var13, this.d);
      } catch (InterruptedException var28) {
         Thread.currentThread().interrupt();
         throw new ResourceFactory.ResourceAccessException(var28);
      }

      LinkedHashSet var33 = new LinkedHashSet();
      ValidationStatus var14 = ValidationStatus.OK;

      for (Message var16 : var32.getMessages()) {
         PolicyValidationMessage var17 = ManagedObjectFactory.createPolicyValidationMessage();
         var17.setAssertionOrdinal(var16.getAssertionOrdinal());
         if (var16 instanceof Error) {
            var14 = ValidationStatus.ERROR;
            var26 = k;
            var17.setLevel(var26[6]);
         } else {
            if (var14 == ValidationStatus.OK) {
               var14 = ValidationStatus.WARNING;
            }

            var26 = k;
            var17.setLevel(var26[36]);
         }

         var17.setMessage(var16.getMessage());
         ArrayList var18 = new ArrayList();
         Assertion var19 = var11;

         for (Integer var21 : var16.getAssertionIndexPath()) {
            AssertionDetail var22 = ManagedObjectFactory.createAssertionDetail();
            var22.setPosition(var21);
            Assertion var23 = null;
            if (var19 instanceof CompositeAssertion) {
               var23 = (Assertion)((CompositeAssertion)var19).getChildren().get(var21);
            } else if (var19 instanceof Include var24) {
               Policy var25 = this.a(var24);
               var23 = this.a(var25, var21);
            }

            var19 = var23;

            label79: {
               try {
                  if (var19 != null) {
                     var22.setDescription((String)var19.meta().get(k[38]) + k[30] + (String)var19.meta().get(k[14]) + ")");
                     break label79;
                  }
               } catch (IOException var30) {
                  throw a(var30);
               }

               var22.setDescription("");
            }

            var18.add(var22);
         }

         var17.setAssertionDetails(var18);
         var33.add(var17);
      }

      PolicyValidationResult var34 = ManagedObjectFactory.createPolicyValidationResult();

      try {
         var34.setStatus(var14);
         if (!var33.isEmpty()) {
            var34.setPolicyValidationMessages(new ArrayList(var33));
         }

         return var34;
      } catch (IOException var27) {
         throw a(var27);
      }
   }

   public String validatePolicySyntax(String var1) throws ResourceFactory.InvalidResourceException {
      try {
         Assertion var2 = this.f.parsePermissively(var1, WspReader.INCLUDE_DISABLED);

         try {
            if (!(var2 instanceof AllAssertion)) {
               throw new ResourceFactory.InvalidResourceException(ResourceFactory.InvalidResourceException.ExceptionType.INVALID_VALUES, k[34]);
            } else {
               return var1;
            }
         } catch (IOException var3) {
            throw a(var3);
         }
      } catch (IOException var4) {
         throw new ResourceFactory.InvalidResourceException(ResourceFactory.InvalidResourceException.ExceptionType.INVALID_VALUES, k[1]);
      }
   }

   public boolean hasRoutingAssertion(Policy var1) throws IOException {
      try {
         if (null != Assertion.find(var1.getAssertion(), RoutingAssertion.class, true)) {
            return true;
         }
      } catch (IOException var2) {
         throw a(var2);
      }

      return false;
   }

   public void checkPolicyAssertionAccess(Policy var1) throws PermissionDeniedException, ResourceFactory.InvalidResourceException {
      try {
         try {
            if (this.i != null) {
               this.i.checkPolicy(var1);
            }
         } catch (PermissionDeniedException var4) {
            throw a(var4);
         }
      } catch (IOException var5) {
         String[] var3 = k;
         throw new ResourceFactory.InvalidResourceException(ResourceFactory.InvalidResourceException.ExceptionType.INVALID_VALUES, var3[1]);
      } catch (FindException var6) {
         throw (PermissionDeniedException)new PermissionDeniedException(OperationType.CREATE, EntityType.ASSERTION_ACCESS, k[19]).initCause(var6);
      }
   }

   private boolean a(Map<String, Object> var1) {
      boolean var2 = false;

      try {
         if (var1 == null || !(var1.get(k[9]) instanceof Boolean)) {
            return var2;
         }
      } catch (ResourceFactory.ResourceAccessException var3) {
         throw a(var3);
      }

      return (Boolean)var1.get(k[5]);
   }

   private SoapVersion b(Map<String, Object> var1) {
      SoapVersion var2 = null;

      try {
         if (var1 == null || var1.get(k[42]) == null) {
            return var2;
         }
      } catch (ResourceFactory.ResourceAccessException var4) {
         throw a(var4);
      }

      String var3 = var1.get(k[7]).toString().trim();
      if (var3 != null) {
         var2 = SoapVersion.versionNumberToSoapVersion(var3);
      }

      return var2;
   }

   private PolicyType a(com.l7tech.gateway.api.PolicyDetail.PolicyType var1) {
      try {
         if (var1 != null) {
            switch (bc.a[var1.ordinal()]) {
               case 1:
                  return PolicyType.INCLUDE_FRAGMENT;
               case 2:
                  return PolicyType.INTERNAL;
               case 3:
                  return PolicyType.GLOBAL_FRAGMENT;
               default:
                  throw new ResourceFactory.ResourceAccessException(k[41] + var1 + "'");
            }
         }
      } catch (ResourceFactory.ResourceAccessException var3) {
         throw a(var3);
      }

      return PolicyType.PRIVATE_SERVICE;
   }

   private Map<String, String> a(Collection<Resource> param1, boolean param2, String param3) throws ResourceFactory.InvalidResourceException {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: new java/util/HashMap
      // 03: dup
      // 04: invokespecial java/util/HashMap.<init> ()V
      // 07: astore 4
      // 09: aload 1
      // 0a: invokeinterface java/util/Collection.iterator ()Ljava/util/Iterator; 1
      // 0f: astore 5
      // 11: aload 5
      // 13: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 18: ifeq aa
      // 1b: aload 5
      // 1d: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 22: checkcast com/l7tech/gateway/api/Resource
      // 25: astore 6
      // 27: iload 2
      // 28: ifeq 37
      // 2b: aload 6
      // 2d: invokevirtual com/l7tech/gateway/api/Resource.getSourceUrl ()Ljava/lang/String;
      // 30: goto 3c
      // 33: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 36: athrow
      // 37: aload 6
      // 39: invokevirtual com/l7tech/gateway/api/Resource.getId ()Ljava/lang/String;
      // 3c: astore 7
      // 3e: aload 7
      // 40: ifnull a7
      // 43: aload 6
      // 45: invokevirtual com/l7tech/gateway/api/Resource.getContent ()Ljava/lang/String;
      // 48: ifnull a7
      // 4b: goto 52
      // 4e: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 51: athrow
      // 52: aload 3
      // 53: ifnull 70
      // 56: goto 5d
      // 59: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 5c: athrow
      // 5d: aload 3
      // 5e: aload 6
      // 60: invokevirtual com/l7tech/gateway/api/Resource.getType ()Ljava/lang/String;
      // 63: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 66: ifeq a7
      // 69: goto 70
      // 6c: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 6f: athrow
      // 70: aload 4
      // 72: aload 7
      // 74: aload 6
      // 76: invokevirtual com/l7tech/gateway/api/Resource.getContent ()Ljava/lang/String;
      // 79: invokeinterface java/util/Map.put (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; 3
      // 7e: ifnull a7
      // 81: goto 88
      // 84: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 87: athrow
      // 88: new com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException
      // 8b: dup
      // 8c: getstatic com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType.INVALID_VALUES Lcom/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType;
      // 8f: aload 7
      // 91: getstatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.k [Ljava/lang/String;
      // 94: bipush 43
      // 96: aaload
      // 97: swap
      // 98: ldc "'"
      // 9a: invokedynamic makeConcatWithConstants (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; bsm=java/lang/invoke/StringConcatFactory.makeConcatWithConstants (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite; args=[ "\u0001\u0001\u0001" ]
      // 9f: invokespecial com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException.<init> (Lcom/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException$ExceptionType;Ljava/lang/String;)V
      // a2: athrow
      // a3: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // a6: athrow
      // a7: goto 11
      // aa: aload 4
      // ac: areturn
      // try (14 -> 19): 19 com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException
      // try (24 -> 29): 30 com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException
      // try (26 -> 34): 35 com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException
      // try (32 -> 42): 43 com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException
      // try (37 -> 51): 52 com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException
      // try (45 -> 66): 66 com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$InvalidResourceException
   }

   private Wsdl a(Collection<Resource> var1) throws ResourceFactory.InvalidResourceException {
      Wsdl var2 = null;
      if (!var1.isEmpty()) {
         Resource var3 = (Resource)var1.iterator().next();

         try {
            if (!k[0].equals(var3.getType())) {
               throw new ResourceFactory.InvalidResourceException(ResourceFactory.InvalidResourceException.ExceptionType.INVALID_VALUES, k[25]);
            }
         } catch (WSDLException var6) {
            throw a(var6);
         }

         try {
            var2 = Wsdl.newInstance(Wsdl.getWSDLLocator(var3.getSourceUrl(), this.a(var1, true, null), a));
         } catch (WSDLException var5) {
            throw new ResourceFactory.InvalidResourceException(
               ResourceFactory.InvalidResourceException.ExceptionType.INVALID_VALUES, k[3] + ExceptionUtils.getMessage(var5) + "'"
            );
         }
      }

      return var2;
   }

   private Assertion b(Collection<Resource> var1) throws ResourceFactory.InvalidResourceException {
      Assertion var2 = null;
      if (!var1.isEmpty()) {
         Resource var3 = (Resource)var1.iterator().next();

         try {
            if (!k[45].equals(var3.getType())) {
               throw new ResourceFactory.InvalidResourceException(ResourceFactory.InvalidResourceException.ExceptionType.INVALID_VALUES, k[37]);
            }
         } catch (IOException var7) {
            throw a(var7);
         }

         try {
            var2 = this.f.parsePermissively(var3.getContent(), WspReader.INCLUDE_DISABLED);
            String[] var5 = k;
            this.a(var2, this.a(var1, false, var5[12]));
         } catch (IOException var6) {
            throw new ResourceFactory.InvalidResourceException(
               ResourceFactory.InvalidResourceException.ExceptionType.INVALID_VALUES, k[24] + ExceptionUtils.getMessage(var6) + "'"
            );
         }
      }

      return var2;
   }

   private Policy a(Include var1) {
      Policy var2 = var1.retrieveFragmentPolicy();
      if (var2 == null) {
         try {
            var2 = this.g.findPolicyByGuid(var1.getPolicyGuid());
         } catch (FindException var4) {
            throw new ResourceFactory.ResourceAccessException(var4);
         }

         var1.replaceFragmentPolicy(var2);
      }

      return var2;
   }

   private Assertion a(Policy var1, int var2) {
      Assertion var3 = null;
      if (var1 != null) {
         try {
            Assertion var4 = var1.getAssertion();

            label35: {
               try {
                  if (var4 instanceof CompositeAssertion var10000) {
                     break label35;
                  }
               } catch (IOException var7) {
                  throw a(var7);
               }

               var10000 = null;
            }

            CompositeAssertion var5 = var10000;

            try {
               if (var5 == null || var5.getChildren().size() <= var2) {
                  return var3;
               }
            } catch (IOException var6) {
               throw a(var6);
            }

            var3 = (Assertion)var5.getChildren().get(var2);
         } catch (IOException var8) {
         }
      }

      return var3;
   }

   private void a(@Nullable Assertion var1, Map<String, String> var2) throws IOException {
      if (var1 instanceof CompositeAssertion var3) {
         Iterator var4 = var3.children();

         while (var4.hasNext()) {
            Assertion var5 = (Assertion)var4.next();
            this.a(var5, var2);
         }
      } else if (var1 instanceof PolicyReference var6) {
         String var7 = var6.retrievePolicyGuid();
         if (var2.containsKey(var7)) {
            Policy var8 = new Policy(PolicyType.INCLUDE_FRAGMENT, var7, (String)var2.get(var7), false);
            var6.replaceFragmentPolicy(var8);
            this.a(var6.retrieveFragmentPolicy().getAssertion(), var2);
         }
      }
   }

   private String a(ExternalReference var1) {
      String var2 = var1.getRefId();
      if (var2 == null) {
         try {
            if (var1 instanceof JdbcConnectionReference) {
               String var10 = ((JdbcConnectionReference)var1).getConnectionName();
               if (var10 != null) {
                  JdbcConnection var11 = this.g.getJdbcConnection(var10);
                  if (var11 != null) {
                     var2 = var11.getId();
                  }
               }
            } else {
               label45:
               if (var1 instanceof GlobalResourceReference var3) {
                  ResourceType var4 = var3.getType();
                  String var5 = var3.getSystemIdentifier();
                  String var6 = var3.getResourceKey1();
                  if (var5 != null) {
                     ResourceEntryHeader var7 = this.g.findResourceEntryByUriAndType(var5, var4);
                     if (var7 != null) {
                        var2 = var7.getStrId();
                     }
                  }

                  try {
                     if (var2 != null || var6 == null) {
                        break label45;
                     }
                  } catch (FindException var8) {
                     throw a(var8);
                  }

                  Collection var12 = this.g.findResourceEntryByKeyAndType(var6, var4);
                  if (var12.size() == 1) {
                     var2 = ((ResourceEntryHeader)var12.iterator().next()).getStrId();
                  }
               } else if (var1 instanceof IncludedPolicyReference) {
                  var2 = ((IncludedPolicyReference)var1).getGuid();
               }
            }

            if (var2 == null) {
               var2 = var1.getSyntheticRefId();
            }
         } catch (FindException var9) {
            throw new ResourceFactory.ResourceAccessException(var9);
         }
      }

      return var2;
   }

   private String a(List<Triple<String, String, String>> param1, List<ExternalReference> param2) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 000: new java/lang/StringBuilder
      // 003: dup
      // 004: invokespecial java/lang/StringBuilder.<init> ()V
      // 007: astore 3
      // 008: aload 2
      // 009: invokeinterface java/util/List.isEmpty ()Z 1
      // 00e: ifne 081
      // 011: aload 3
      // 012: getstatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.k [Ljava/lang/String;
      // 015: astore 7
      // 017: aload 7
      // 019: bipush 21
      // 01b: aaload
      // 01c: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 01f: pop
      // 020: bipush 1
      // 021: istore 4
      // 023: aload 2
      // 024: invokeinterface java/util/List.iterator ()Ljava/util/Iterator; 1
      // 029: astore 5
      // 02b: aload 5
      // 02d: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 032: ifeq 07a
      // 035: aload 5
      // 037: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 03c: checkcast com/l7tech/policy/exporter/ExternalReference
      // 03f: astore 6
      // 041: iload 4
      // 043: ifeq 04c
      // 046: bipush 0
      // 047: istore 4
      // 049: goto 05b
      // 04c: aload 3
      // 04d: getstatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.k [Ljava/lang/String;
      // 050: astore 7
      // 052: aload 7
      // 054: bipush 18
      // 056: aaload
      // 057: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 05a: pop
      // 05b: aload 3
      // 05c: aload 6
      // 05e: invokevirtual com/l7tech/policy/exporter/ExternalReference.getRefType ()Ljava/lang/String;
      // 061: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 064: pop
      // 065: aload 3
      // 066: ldc ":"
      // 068: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 06b: pop
      // 06c: aload 3
      // 06d: aload 0
      // 06e: aload 6
      // 070: invokevirtual com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Lcom/l7tech/policy/exporter/ExternalReference;)Ljava/lang/String;
      // 073: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 076: pop
      // 077: goto 02b
      // 07a: aload 3
      // 07b: ldc ")"
      // 07d: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 080: pop
      // 081: aload 1
      // 082: invokeinterface java/util/List.isEmpty ()Z 1
      // 087: ifne 15d
      // 08a: aload 2
      // 08b: invokeinterface java/util/List.isEmpty ()Z 1
      // 090: ifne 0ac
      // 093: goto 09a
      // 096: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 099: athrow
      // 09a: aload 3
      // 09b: getstatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.k [Ljava/lang/String;
      // 09e: bipush 16
      // 0a0: aaload
      // 0a1: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 0a4: pop
      // 0a5: goto 0ac
      // 0a8: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0ab: athrow
      // 0ac: aload 3
      // 0ad: getstatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.k [Ljava/lang/String;
      // 0b0: astore 7
      // 0b2: aload 7
      // 0b4: bipush 23
      // 0b6: aaload
      // 0b7: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 0ba: pop
      // 0bb: bipush 1
      // 0bc: istore 4
      // 0be: aload 1
      // 0bf: invokeinterface java/util/List.iterator ()Ljava/util/Iterator; 1
      // 0c4: astore 5
      // 0c6: aload 5
      // 0c8: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 0cd: ifeq 156
      // 0d0: aload 5
      // 0d2: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 0d7: checkcast com/l7tech/util/Triple
      // 0da: astore 6
      // 0dc: iload 4
      // 0de: ifeq 0e7
      // 0e1: bipush 0
      // 0e2: istore 4
      // 0e4: goto 0f6
      // 0e7: aload 3
      // 0e8: getstatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.k [Ljava/lang/String;
      // 0eb: astore 7
      // 0ed: aload 7
      // 0ef: bipush 29
      // 0f1: aaload
      // 0f2: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 0f5: pop
      // 0f6: aload 3
      // 0f7: aload 6
      // 0f9: getfield com/l7tech/util/Triple.left Ljava/lang/Object;
      // 0fc: checkcast java/lang/String
      // 0ff: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 102: pop
      // 103: aload 6
      // 105: getfield com/l7tech/util/Triple.left Ljava/lang/Object;
      // 108: checkcast java/lang/String
      // 10b: aload 6
      // 10d: getfield com/l7tech/util/Triple.middle Ljava/lang/Object;
      // 110: checkcast java/lang/String
      // 113: invokevirtual java/lang/String.equalsIgnoreCase (Ljava/lang/String;)Z
      // 116: ifne 134
      // 119: aload 3
      // 11a: bipush 47
      // 11c: invokevirtual java/lang/StringBuilder.append (C)Ljava/lang/StringBuilder;
      // 11f: pop
      // 120: aload 3
      // 121: aload 6
      // 123: getfield com/l7tech/util/Triple.middle Ljava/lang/Object;
      // 126: checkcast java/lang/String
      // 129: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 12c: pop
      // 12d: goto 134
      // 130: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 133: athrow
      // 134: aload 3
      // 135: getstatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper.k [Ljava/lang/String;
      // 138: bipush 40
      // 13a: aaload
      // 13b: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 13e: pop
      // 13f: aload 3
      // 140: aload 6
      // 142: getfield com/l7tech/util/Triple.right Ljava/lang/Object;
      // 145: checkcast java/lang/String
      // 148: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 14b: pop
      // 14c: aload 3
      // 14d: bipush 93
      // 14f: invokevirtual java/lang/StringBuilder.append (C)Ljava/lang/StringBuilder;
      // 152: pop
      // 153: goto 0c6
      // 156: aload 3
      // 157: ldc ")"
      // 159: invokevirtual java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
      // 15c: pop
      // 15d: aload 3
      // 15e: invokevirtual java/lang/StringBuilder.toString ()Ljava/lang/String;
      // 161: areturn
      // try (60 -> 66): 67 com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$ResourceAccessException
      // try (63 -> 75): 76 com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$ResourceAccessException
      // try (111 -> 135): 136 com/l7tech/external/assertions/gatewaymanagement/server/ResourceFactory$ResourceAccessException
   }

   private PolicyImporterAdvisor a(
      PolicyImportContext var1, List<ImportedPolicyReference> var2, List<Triple<String, String, String>> var3, List<ExternalReference> var4
   ) {
      return new ba(this, var2, var1, var4, var3);
   }

   private ExternalReferenceErrorListener a(List<String> var1) {
      return new bb(this, var1);
   }

   static {
      String[] var5 = new String[46];
      int var3 = 0;
      String var2 = "6ZV/\u000e(GD\"oD\faY]/jN\u0011\u0015,@A0jC\u000faY]/jN\u0011aLJ3l_\u001c\u000e(GD\"oD\fa~a\u0007O\rO\f1F^*`T\r9Y]1w\u00042FS3\u0005\u0004[@,q\u000b2FS3UH\u001a2@]-\u0005'F@ f\u00042FS3\u001e\u0004[@,q\r\u000b3LS7jC\u000faY]/jN\u0011aLJ3l_\u001ca\u000e\u0017(GD\"oD\faY]/jN\u0011aLJ3l_\u001ca\u000e\u00061F^*`T:\"F_mo\u001a\u001c$JZm`B\u00062F^&-]\u0007-@Q:-H\u00101F@7f_F\bGQ/vI\r%y]/jN\u0011\u0013LT&qH\u0006\"L\u000f1H^&wY\r\u000fFV&ML\u0005$\u0012\u0011F^*`TH(Z\u0012*m[\t-@Vm\u0002o\t\u0014 JQ&sY8.E[ zn\u0007/O^*`Y\u0002m\t\u001a\u0004[@,q\r\u0001/\tB&q@\u00012Z[,m\r\u000b)LQ(-\f$GQ\"p^\r9Y]1w@\u0015AWceB\u0004-FE*mJH%LB&mI\r/J[&p\r\u000b.\\^'#C\u00075\tP&#L\u001d5F_\"wD\u000b E^:#_\r2F^5fIHi\u001e,@A0jC\u000faY]/jN\u0011aLJ3l_\u001ca[W0lX\u001a\"Ly\u0015AWceB\u0004-FE*mJH1F^*`TH(GQ/vI\raO@\"d@\r/]AcbA\u001a$HV:#H\u0010(ZFcaX\u001caM]cmB\u001caDS7`EH5AWcsB\u0004(JKcjC\u000b-\\V&#K\u001a N_&mY\u001ba@\\cwE\raY]/jN\u0011aLJ3l_\u001ca\u0001\u0016\u0004[@,q\r\u0018 [A*mJH1F^*`THf\"\u0016zv\u000f#_\u0007.]\u00121f^\u00074[Q&#Y\u00111L\u0012*mN\u00073[W w\u0003\f1F^*`T\r9Y]1w\u00046ZV/\u0002f\u0007\u0002m\t\u0002a\u0001\u0002f\u0007\u0017(GD\"oD\faY]/jN\u0011aLJ3l_\u001ca\u000e\u00184GW;sH\u000b5LVcqH\u001b.\\@ f\r\u001c8YW\u000e(GD\"oD\faY]/jN\u00110\u0011F^*`TH(GQ/vI\raO@\"d@\r/]\u0012*p\r\u0006.]\u0012,e\r\r9YW wH\fa]K3f\u0003\u0007\u0016H@-jC\u000f$\u0011F^*`TH3F]7#_\r2FG1`HH5PB&#D\u0006\"F@1fN\u001co\u000f6ZB\u0006{Y\r3GS/ML\u0005$\u0016,@A0jC\u000fa@_3l_\u001caJ]-wH\u00105\u0006\u001aNG*g\u0017\u0015\u0014GY-lZ\u0006aY]/jN\u0011a]K3f\rO\u000b2FS3UH\u001a2@]-\u0014%\\B/jN\t5L\u00121f^\u00074[Q&#\n";
      int var4 = "6ZV/\u000e(GD\"oD\faY]/jN\u0011\u0015,@A0jC\u000faY]/jN\u0011aLJ3l_\u001c\u000e(GD\"oD\fa~a\u0007O\rO\f1F^*`T\r9Y]1w\u00042FS3\u0005\u0004[@,q\u000b2FS3UH\u001a2@]-\u0005'F@ f\u00042FS3\u001e\u0004[@,q\r\u000b3LS7jC\u000faY]/jN\u0011aLJ3l_\u001ca\u000e\u0017(GD\"oD\faY]/jN\u0011aLJ3l_\u001ca\u000e\u00061F^*`T:\"F_mo\u001a\u001c$JZm`B\u00062F^&-]\u0007-@Q:-H\u00101F@7f_F\bGQ/vI\r%y]/jN\u0011\u0013LT&qH\u0006\"L\u000f1H^&wY\r\u000fFV&ML\u0005$\u0012\u0011F^*`TH(Z\u0012*m[\t-@Vm\u0002o\t\u0014 JQ&sY8.E[ zn\u0007/O^*`Y\u0002m\t\u001a\u0004[@,q\r\u0001/\tB&q@\u00012Z[,m\r\u000b)LQ(-\f$GQ\"p^\r9Y]1w@\u0015AWceB\u0004-FE*mJH%LB&mI\r/J[&p\r\u000b.\\^'#C\u00075\tP&#L\u001d5F_\"wD\u000b E^:#_\r2F^5fIHi\u001e,@A0jC\u000faY]/jN\u0011aLJ3l_\u001ca[W0lX\u001a\"Ly\u0015AWceB\u0004-FE*mJH1F^*`TH(GQ/vI\raO@\"d@\r/]AcbA\u001a$HV:#H\u0010(ZFcaX\u001caM]cmB\u001caDS7`EH5AWcsB\u0004(JKcjC\u000b-\\V&#K\u001a N_&mY\u001ba@\\cwE\raY]/jN\u0011aLJ3l_\u001ca\u0001\u0016\u0004[@,q\r\u0018 [A*mJH1F^*`THf\"\u0016zv\u000f#_\u0007.]\u00121f^\u00074[Q&#Y\u00111L\u0012*mN\u00073[W w\u0003\f1F^*`T\r9Y]1w\u00046ZV/\u0002f\u0007\u0002m\t\u0002a\u0001\u0002f\u0007\u0017(GD\"oD\faY]/jN\u0011aLJ3l_\u001ca\u000e\u00184GW;sH\u000b5LVcqH\u001b.\\@ f\r\u001c8YW\u000e(GD\"oD\faY]/jN\u00110\u0011F^*`TH(GQ/vI\raO@\"d@\r/]\u0012*p\r\u0006.]\u0012,e\r\r9YW wH\fa]K3f\u0003\u0007\u0016H@-jC\u000f$\u0011F^*`TH3F]7#_\r2FG1`HH5PB&#D\u0006\"F@1fN\u001co\u000f6ZB\u0006{Y\r3GS/ML\u0005$\u0016,@A0jC\u000fa@_3l_\u001caJ]-wH\u00105\u0006\u001aNG*g\u0017\u0015\u0014GY-lZ\u0006aY]/jN\u0011a]K3f\rO\u000b2FS3UH\u001a2@]-\u0014%\\B/jN\t5L\u00121f^\u00074[Q&#\n"
         .length();
      char var1 = 4;
      int var7 = -1;

      label24:
      while (true) {
         byte var10000 = 35;
         String var10001 = var2.substring(++var7, var7 + var1);
         byte var10002 = -1;

         while (true) {
            String var8 = a(var10000, a(var10001));
            switch (var10002) {
               case 0:
                  var5[var3++] = var8;
                  if ((var7 += var1) >= var4) {
                     k = var5;
                     String[] var9 = k;
                     b = k[17];
                     c = var9[8];
                     a = Logger.getLogger(PolicyHelper.class.getName());
                     return;
                  }

                  var1 = var2.charAt(var7);
                  break;
               default:
                  var5[var3++] = var8;
                  if ((var7 += var1) < var4) {
                     var1 = var2.charAt(var7);
                     continue label24;
                  }

                  var2 = "2mv\u001aG;=\u0005ze\u0001\\u9Wok\u0019\\x'Wz|\u0005Zi*W8\u0006\u0007ph\u001cVb";
                  var4 = "2mv\u001aG;=\u0005ze\u0001\\u9Wok\u0019\\x'Wz|\u0005Zi*W8\u0006\u0007ph\u001cVb".length();
                  var1 = 30;
                  var7 = -1;
            }

            var10000 = 21;
            var10001 = var2.substring(++var7, var7 + var1);
            var10002 = 0;
         }
      }
   }

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

   private static char[] a(String var0) {
      char[] var10000 = var0.toCharArray();
      if (var10000.length < 2) {
         var10000[0] = (char)(var10000[0] ^ 75);
      }

      return var10000;
   }

   private static String a(int var0, char[] var1) {
      int var10003 = var1.length;
      int var10002 = var0;
      char[] var10001 = var1;
      int var10000 = var10003;

      for (int var2 = 0; var10000 > var2; var2++) {
         var10001[var2] = (char)(var10001[var2] ^ var10002 ^ switch (var2 % 7) {
            case 0 -> 98;
            case 1 -> 10;
            case 2 -> 17;
            case 3 -> 96;
            case 4 -> 32;
            case 5 -> 14;
            default -> 75;
         });
      }

      return new String(var10001).intern();
   }

   public static class GatewayExternalReferenceFinder implements ExternalReferenceFinder {
      private final RbacServices a;
      private final SecurityFilter b;
      private final CustomAssertionsRegistrar c;
      private final IdentityProviderConfigManager d;
      private final IdentityProviderFactory e;
      private final JdbcConnectionManager f;
      private final JmsConnectionManager g;
      private final JmsEndpointManager h;
      private final PolicyManager i;
      private final ResourceEntryManager j;
      private final SsgKeyStoreManager k;
      private final TrustedCertManager l;
      private final SsgActiveConnectorManager m;
      private final PolicyExporterImporterManager n;
      private final SiteMinderConfigurationManager o;
      private final GenericEntityManager p;
      private final HttpConfigurationManager q;
      private final RoleManager r;
      private final SecurePasswordManager s;
      private final CustomKeyValueStoreManager t;
      private final CassandraConnectionEntityManager u;
      private static final String[] v;

      public GatewayExternalReferenceFinder(
         RbacServices var1,
         SecurityFilter var2,
         CustomAssertionsRegistrar var3,
         IdentityProviderConfigManager var4,
         IdentityProviderFactory var5,
         JdbcConnectionManager var6,
         JmsConnectionManager var7,
         JmsEndpointManager var8,
         PolicyManager var9,
         ResourceEntryManager var10,
         SsgKeyStoreManager var11,
         TrustedCertManager var12,
         SsgActiveConnectorManager var13,
         PolicyExporterImporterManager var14,
         SiteMinderConfigurationManager var15,
         GenericEntityManager var16,
         HttpConfigurationManager var17,
         RoleManager var18,
         SecurePasswordManager var19,
         CustomKeyValueStoreManager var20,
         CassandraConnectionEntityManager var21
      ) {
         this.a = var1;
         this.b = var2;
         this.c = var3;
         this.d = var4;
         this.e = var5;
         this.f = var6;
         this.g = var7;
         this.h = var8;
         this.i = var9;
         this.j = var10;
         this.k = var11;
         this.l = var12;
         this.m = var13;
         this.n = var14;
         this.o = var15;
         this.p = var16;
         this.q = var17;
         this.r = var18;
         this.s = var19;
         this.t = var20;
         this.u = var21;
      }

      private User a() {
         return JaasUtils.getCurrentUser();
      }

      private <E extends Entity> E a(E param1) throws FindException {
         // $VF: Couldn't be decompiled
         // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
         // java.lang.RuntimeException: parsing failure!
         //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
         //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
         //
         // Bytecode:
         // 00: aconst_null
         // 01: astore 2
         // 02: aload 1
         // 03: ifnull 32
         // 06: aload 0
         // 07: invokevirtual com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper$GatewayExternalReferenceFinder.a ()Lcom/l7tech/identity/User;
         // 0a: ifnull 32
         // 0d: goto 14
         // 10: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper$GatewayExternalReferenceFinder.a (Lcom/l7tech/objectmodel/FindException;)Lcom/l7tech/objectmodel/FindException;
         // 13: athrow
         // 14: aload 0
         // 15: getfield com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper$GatewayExternalReferenceFinder.a Lcom/l7tech/server/security/rbac/RbacServices;
         // 18: aload 0
         // 19: invokevirtual com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper$GatewayExternalReferenceFinder.a ()Lcom/l7tech/identity/User;
         // 1c: aload 1
         // 1d: getstatic com/l7tech/gateway/common/security/rbac/OperationType.READ Lcom/l7tech/gateway/common/security/rbac/OperationType;
         // 20: aconst_null
         // 21: invokeinterface com/l7tech/server/security/rbac/RbacServices.isPermittedForEntity (Lcom/l7tech/identity/User;Lcom/l7tech/objectmodel/Entity;Lcom/l7tech/gateway/common/security/rbac/OperationType;Ljava/lang/String;)Z 5
         // 26: ifeq 32
         // 29: goto 30
         // 2c: invokestatic com/l7tech/external/assertions/gatewaymanagement/server/PolicyHelper$GatewayExternalReferenceFinder.a (Lcom/l7tech/objectmodel/FindException;)Lcom/l7tech/objectmodel/FindException;
         // 2f: athrow
         // 30: aload 1
         // 31: astore 2
         // 32: aload 2
         // 33: areturn
         // try (2 -> 7): 8 com/l7tech/objectmodel/FindException
         // try (4 -> 19): 20 com/l7tech/objectmodel/FindException
      }

      private <EH extends EntityHeader> EH a(EH var1) throws FindException {
         EntityHeader var2 = null;

         try {
            if (var1 == null || this.a() == null) {
               return (EH)var2;
            }
         } catch (FindException var4) {
            throw a(var4);
         }

         Collection var3 = this.b.filter(Collections.singleton(var1), this.a(), OperationType.READ, null);
         if (!var3.isEmpty()) {
            var2 = var1;
         }

         return (EH)var2;
      }

      private <E> Collection<E> a(Collection<E> var1) throws FindException {
         EntityType var3 = null;
         if (var1.size() > 0) {
            Object var4 = var1.iterator().next();
            if (var4 instanceof EntityHeader) {
               var3 = ((EntityHeader)var4).getType();
            } else if (var4 instanceof Entity) {
               var3 = EntityType.findTypeByEntity(var4.getClass());
            }
         }

         User var6 = this.a();
         Collection var2;
         if (var6 == null) {
            var2 = Collections.emptyList();
         } else {
            label38: {
               try {
                  if (var3 != null && this.a.isPermittedForAnyEntityOfType(var6, OperationType.READ, var3)) {
                     break label38;
                  }
               } catch (FindException var5) {
                  throw a(var5);
               }

               var2 = this.b.filter(var1, var6, OperationType.READ, null);
               return var2;
            }

            var2 = var1;
         }

         return var2;
      }

      public TrustedCert findCertByPrimaryKey(Goid var1) throws FindException {
         return this.a((TrustedCert)this.l.findByPrimaryKey(var1));
      }

      public Collection<TrustedCert> findAllCerts() throws FindException {
         return this.a(this.l.findAll());
      }

      public SsgKeyEntry findKeyEntry(String var1, Goid var2) throws FindException, KeyStoreException {
         try {
            return this.a(this.k.lookupKeyByKeyAlias(var1, var2));
         } catch (ObjectNotFoundException var4) {
            return null;
         }
      }

      public Collection getAssertions() {
         return this.c.getAssertions();
      }

      public Policy findPolicyByGuid(String var1) throws FindException {
         return this.a(this.i.findByGuid(var1));
      }

      public Policy findPolicyByUniqueName(String var1) throws FindException {
         return this.a((Policy)this.i.findByUniqueName(var1));
      }

      public ResourceEntryHeader findResourceEntryByUriAndType(String var1, ResourceType var2) throws FindException {
         return this.a(this.j.findHeaderByUriAndType(var1, var2));
      }

      public Collection<ResourceEntryHeader> findResourceEntryByKeyAndType(String var1, ResourceType var2) throws FindException {
         return this.a(this.j.findHeadersByKeyAndType(var1, var2));
      }

      public JdbcConnection getJdbcConnectionById(String var1) throws FindException {
         try {
            return this.a((JdbcConnection)this.f.findByPrimaryKey(GoidUpgradeMapper.mapId(EntityType.JDBC_CONNECTION, var1)));
         } catch (IllegalArgumentException var3) {
            return null;
         }
      }

      public JdbcConnection getJdbcConnection(String var1) throws FindException {
         return this.a((JdbcConnection)this.f.findByUniqueName(var1));
      }

      public CassandraConnection getCassandraConnection(String var1) throws FindException {
         return this.a((CassandraConnection)this.u.findByUniqueName(var1));
      }

      public JmsEndpoint findEndpointByPrimaryKey(Goid var1) throws FindException {
         return this.a((JmsEndpoint)this.h.findByPrimaryKey(var1));
      }

      public JmsConnection findConnectionByPrimaryKey(Goid var1) throws FindException {
         return this.a((JmsConnection)this.g.findByPrimaryKey(var1));
      }

      public SsgActiveConnector findConnectorByPrimaryKey(Goid var1) throws FindException {
         return this.a((SsgActiveConnector)this.m.findByPrimaryKey(var1));
      }

      public Collection<SsgActiveConnector> findSsgActiveConnectorsByType(String var1) throws FindException {
         return this.a(this.m.findSsgActiveConnectorsByType(var1));
      }

      public Set<ExternalReferenceFactory> findAllExternalReferenceFactories() throws FindException {
         return this.n.findAllExternalReferenceFactories();
      }

      public List<Pair<JmsEndpoint, JmsConnection>> loadJmsQueues() throws FindException {
         ArrayList var1 = new ArrayList();

         for (JmsConnection var4 : this.a(this.g.findAll())) {
            JmsEndpoint[] var5 = this.h.findEndpointsForConnection(var4.getGoid());

            for (JmsEndpoint var9 : var5) {
               JmsEndpoint var10 = this.a(var9);

               try {
                  if (var10 != null) {
                     var1.add(new Pair(var10, var4));
                  }
               } catch (FindException var11) {
                  throw a(var11);
               }
            }
         }

         return var1;
      }

      public EntityHeader[] findAllIdentityProviderConfig() throws FindException {
         Collection var1 = this.a(this.d.findAllHeaders());
         return var1.toArray(new EntityHeader[var1.size()]);
      }

      public IdentityProviderConfig findIdentityProviderConfigByID(Goid var1) throws FindException {
         return this.a((IdentityProviderConfig)this.d.findByPrimaryKey(var1));
      }

      public EntityHeaderSet<IdentityHeader> findAllGroups(Goid var1) throws FindException {
         return (EntityHeaderSet<IdentityHeader>)this.<IdentityHeader>a(this.a(var1).getGroupManager().findAllHeaders());
      }

      public Group findGroupByID(Goid var1, String var2) throws FindException {
         return this.a(this.a(var1).getGroupManager().findByPrimaryKey(var2));
      }

      public Group findGroupByName(Goid var1, String var2) throws FindException {
         return this.a(this.a(var1).getGroupManager().findByName(var2));
      }

      public Collection<IdentityHeader> getUserHeaders(Goid var1, String var2) throws FindException {
         return this.a(this.a(var1).getGroupManager().getUserHeaders(var2));
      }

      public Collection<IdentityHeader> findAllUsers(Goid var1) throws FindException {
         return this.a(this.a(var1).getUserManager().findAllHeaders());
      }

      public User findUserByID(Goid var1, String var2) throws FindException {
         return this.a(this.a(var1).getUserManager().findByPrimaryKey(var2));
      }

      public User findUserByLogin(Goid var1, String var2) throws FindException {
         return this.a(this.a(var1).getUserManager().findByLogin(var2));
      }

      public SiteMinderConfiguration findSiteMinderConfigurationByName(String var1) throws FindException {
         return this.a((SiteMinderConfiguration)this.o.findByUniqueName(var1));
      }

      public SiteMinderConfiguration findSiteMinderConfigurationByID(Goid var1) throws FindException {
         return this.a((SiteMinderConfiguration)this.o.findByPrimaryKey(var1));
      }

      public <ET extends GenericEntity> EntityManager<ET, GenericEntityHeader> getGenericEntityManager(@NotNull Class<ET> var1) throws FindException {
         try {
            if (var1 == null) {
               a(0);
            }
         } catch (FindException var2) {
            throw a(var2);
         }

         return this.p.getEntityManager(var1);
      }

      public SecurePassword findSecurePasswordById(Goid var1) throws FindException {
         return this.a((SecurePassword)this.s.findByPrimaryKey(var1));
      }

      public SecurePassword findSecurePasswordByName(String var1) throws FindException {
         return this.a((SecurePassword)this.s.findByUniqueName(var1));
      }

      public KeyValueStore getCustomKeyValueStore() {
         return new bd(this, this.t);
      }

      public CustomEntitySerializer getCustomKeyValueEntitySerializer(String var1) {
         return this.c.getExternalEntitySerializer(var1);
      }

      private IdentityProvider<?, ?, ?, ?> a(Goid var1) throws FindException {
         IdentityProvider var2 = this.e.getProvider(var1);

         try {
            if (var2 == null) {
               throw new FindException(v[1]);
            } else {
               return var2;
            }
         } catch (FindException var3) {
            throw a(var3);
         }
      }

      private static FindException a(FindException var0) {
         return var0;
      }

      static {
         String[] var5 = new String[5];
         int var3 = 0;
         String var2 = "'}o\u007f1\u0000\u001e\u0012/ne.E0(`|D)\t\u001cF\u007fix=\b\u0015\u0012jz*{@\u0003A/gl|@\u0003H*{*1\u0010\u0003\u0012/fe(E\u0012\u0003/f\u007f0\t#/kmd(\f\u0004\u001f_ze*\f\u0014\u0003}(i3\u0010\u001c\u0002/fe(E\u0012\u0003/ne)\u000b\u0014\u000b\u0003a|c(\u001c3\nn{y";
         int var4 = "'}o\u007f1\u0000\u001e\u0012/ne.E0(`|D)\t\u001cF\u007fix=\b\u0015\u0012jz*{@\u0003A/gl|@\u0003H*{*1\u0010\u0003\u0012/fe(E\u0012\u0003/f\u007f0\t#/kmd(\f\u0004\u001f_ze*\f\u0014\u0003}(i3\u0010\u001c\u0002/fe(E\u0012\u0003/ne)\u000b\u0014\u000b\u0003a|c(\u001c3\nn{y"
            .length();
         char var1 = '>';
         int var7 = -1;

         label24:
         while (true) {
            byte var10000 = 115;
            String var10001 = var2.substring(++var7, var7 + var1);
            byte var10002 = -1;

            while (true) {
               String var8 = a(var10000, a(var10001));
               switch (var10002) {
                  case 0:
                     var5[var3++] = var8;
                     if ((var7 += var1) >= var4) {
                        v = var5;
                        return;
                     }

                     var1 = var2.charAt(var7);
                     break;
                  default:
                     var5[var3++] = var8;
                     if ((var7 += var1) < var4) {
                        var1 = var2.charAt(var7);
                        continue label24;
                     }

                     var2 = "\u0005`e%0R\u0004\u0003l`%9\u001d\u0004\u0003}fk0J\u0011\u0015|mx(\f\u001f\b|'m=\u0011\u0015\u0011nqg=\u000b\u0011\u0001jeo2\u0011_\u0015jz|9\u0017_6`dc?\u001c8\u0003cxo.A7\u0007{m}=\u001c5\u001e{mx2\u0004\u001c4jno.\u0000\u001e\u0005jNc2\u0001\u0015\u0014\u0017\u0001j|M9\u000b\u0015\u0014fkO2\u0011\u0019\u0012vEk2\u0004\u0017\u0003}";
                     var4 = "\u0005`e%0R\u0004\u0003l`%9\u001d\u0004\u0003}fk0J\u0011\u0015|mx(\f\u001f\b|'m=\u0011\u0015\u0011nqg=\u000b\u0011\u0001jeo2\u0011_\u0015jz|9\u0017_6`dc?\u001c8\u0003cxo.A7\u0007{m}=\u001c5\u001e{mx2\u0004\u001c4jno.\u0000\u001e\u0005jNc2\u0001\u0015\u0014\u0017\u0001j|M9\u000b\u0015\u0014fkO2\u0011\u0019\u0012vEk2\u0004\u0017\u0003}"
                        .length();
                     var1 = 'c';
                     var7 = -1;
               }

               var10000 = 115;
               var10001 = var2.substring(++var7, var7 + var1);
               var10002 = 0;
            }
         }
      }

      private static char[] a(String var0) {
         char[] var10000 = var0.toCharArray();
         if (var10000.length < 2) {
            var10000[0] = (char)(var10000[0] ^ 3);
         }

         return var10000;
      }

      private static String a(int var0, char[] var1) {
         int var10003 = var1.length;
         int var10002 = var0;
         char[] var10001 = var1;
         int var10000 = var10003;

         for (int var2 = 0; var10000 > var2; var2++) {
            var10001[var2] = (char)(var10001[var2] ^ var10002 ^ switch (var2 % 7) {
               case 0 -> 21;
               case 1 -> 124;
               case 2 -> 123;
               case 3 -> 121;
               case 4 -> 47;
               case 5 -> 22;
               default -> 3;
            });
         }

         return new String(var10001).intern();
      }
   }
}
