package com.l7tech.gateway.common.service;

import com.l7tech.common.http.HttpMethod;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.JaxbMapType.JaxbMapTypeAdapter;
import com.l7tech.objectmodel.folder.Folder;
import com.l7tech.objectmodel.folder.HasFolder;
import com.l7tech.objectmodel.imp.PersistentEntityUtil;
import com.l7tech.objectmodel.imp.ZoneableNamedEntityImp;
import com.l7tech.objectmodel.migration.Migration;
import com.l7tech.objectmodel.migration.MigrationMappingSelection;
import com.l7tech.objectmodel.migration.PropertyResolver.Type;
import com.l7tech.policy.Policy;
import com.l7tech.policy.PolicyType;
import com.l7tech.search.Dependency;
import com.l7tech.security.rbac.RbacAttribute;
import com.l7tech.util.DeserializeSafe;
import com.l7tech.util.Functions.TernaryThrows;
import com.l7tech.wsdl.SerializableWSDLLocator;
import com.l7tech.wsdl.Wsdl;
import com.l7tech.xml.soap.SoapVersion;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.ElementCollection;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.JoinTable;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.MapKeyColumn;
import jakarta.persistence.Table;
import jakarta.persistence.Transient;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.io.Flushable;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectOutputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicReference;
import java.util.logging.Logger;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import javax.validation.constraints.Pattern.List;
import javax.wsdl.BindingOperation;
import javax.wsdl.Port;
import javax.wsdl.WSDLException;
import javax.wsdl.extensions.ExtensibilityElement;
import javax.wsdl.extensions.soap.SOAPOperation;
import javax.wsdl.extensions.soap12.SOAP12Operation;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Proxy;
import org.jetbrains.annotations.Nullable;

@XmlRootElement
@Entity
@Proxy(lazy = false)
@Table(name = "published_service")
@DeserializeSafe
public class PublishedService extends ZoneableNamedEntityImp implements Flushable, HasFolder {
   private static final Logger logger;
   public static final EnumSet<HttpMethod> METHODS_SOAP;
   public static final EnumSet<HttpMethod> METHODS_REST;
   private Policy policy;
   private String _wsdlUrl;
   private String _wsdlXml;
   private SoapVersion _soapVersion = null;
   private boolean _disabled;
   private boolean soap = true;
   private boolean internal = false;
   private String routingUri;
   private String defaultRoutingUrl;
   private Set<HttpMethod> httpMethods;
   private boolean laxResolution;
   private boolean wssProcessingEnabled;
   private boolean tracingEnabled;
   private Folder folder;
   private Map<String, String> properties;
   private transient PublishedService.WsdlStrategy wsdlStrategy;
   private final AtomicReference<Wsdl> _parsedWsdl;
   private final AtomicReference<SerializableWSDLLocator> _wsdlLocator;
   private final AtomicReference<Port> _wsdlPort;
   private transient URL _serviceUrl;
   private transient Boolean multipart;
   static final long serialVersionUID = 6183646586455579305L;
   private static final String[] b;

   public PublishedService() {
      this.httpMethods = EnumSet.copyOf(METHODS_SOAP);
      this.wssProcessingEnabled = true;
      this.tracingEnabled = false;
      this.properties = new HashMap<>();
      this._parsedWsdl = new AtomicReference<>(null);
      this._wsdlLocator = new AtomicReference<>(null);
      this._wsdlPort = new AtomicReference<>(null);
      this.setVersion(1);
      this.policy = new Policy(PolicyType.PRIVATE_SERVICE, null, null, false);
   }

   public PublishedService(PublishedService var1) {
      this(var1, false);
   }

   public PublishedService(PublishedService var1, boolean var2) {
      super(var1);
      this.httpMethods = EnumSet.copyOf(METHODS_SOAP);
      this.wssProcessingEnabled = true;
      this.tracingEnabled = false;
      this.properties = new HashMap<>();
      this._parsedWsdl = new AtomicReference<>(null);
      this._wsdlLocator = new AtomicReference<>(null);
      this._wsdlPort = new AtomicReference<>(null);
      this.setDisabled(var1.isDisabled());
      this.setHttpMethods(var1.getHttpMethodsReadOnly());
      this.setLaxResolution(var1.isLaxResolution());
      this.setWssProcessingEnabled(var1.isWssProcessingEnabled());
      this.setTracingEnabled(var1.isTracingEnabled());
      this.setPolicy(var1.getPolicy() == null ? null : new Policy(var1.getPolicy()));
      this.setRoutingUri(var1.getRoutingUri());
      this.setSoap(var1.isSoap());
      this.setInternal(var1.isInternal());
      this._soapVersion = var1.getSoapVersion();
      this.setFolder(var1.getFolder());
      this._wsdlUrl = var1._wsdlUrl;
      this.setWsdlXml(var1.getWsdlXml());
      this.setProperties(var1.getProperties());
      this.setSecurityZone(var1.getSecurityZone());
      if (var2) {
         PersistentEntityUtil.lock(this.policy);
         this.lock();
      }
   }

   @Transient
   @Migration(mapName = MigrationMappingSelection.NONE, mapValue = MigrationMappingSelection.NONE, resolver = Type.SERVICE_DOCUMENT)
   public String getId() {
      return super.getId();
   }

   @Transient
   @RbacAttribute
   @Size(min = 1, max = 255)
   public String getName() {
      return super.getName();
   }

   public void ping() throws IOException, WSDLException {
      InputStream var1 = null;

      try {
         URL var2 = this.serviceUrl();
         var1 = var2.openStream();
      } finally {
         try {
            if (var1 != null) {
               var1.close();
            }
         } catch (IOException var7) {
            throw a(var7);
         }
      }
   }

   @RbacAttribute
   @Size(max = 4096)
   @Column(name = "wsdl_url")
   public String getWsdlUrl() {
      if (this._wsdlUrl == null) {
         this._wsdlUrl = "";
      }

      return this._wsdlUrl;
   }

   public void setWsdlUrl(String param1) throws MalformedURLException {
      // $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: aload 0
      // 01: invokevirtual com/l7tech/gateway/common/service/PublishedService.checkLocked ()V
      // 04: aload 0
      // 05: getfield com/l7tech/gateway/common/service/PublishedService._wsdlUrl Ljava/lang/String;
      // 08: ifnull 29
      // 0b: aload 0
      // 0c: getfield com/l7tech/gateway/common/service/PublishedService._wsdlUrl Ljava/lang/String;
      // 0f: aload 1
      // 10: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 13: ifne 29
      // 16: goto 1d
      // 19: invokestatic com/l7tech/gateway/common/service/PublishedService.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 1c: athrow
      // 1d: aload 0
      // 1e: aconst_null
      // 1f: putfield com/l7tech/gateway/common/service/PublishedService._wsdlXml Ljava/lang/String;
      // 22: goto 29
      // 25: invokestatic com/l7tech/gateway/common/service/PublishedService.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 28: athrow
      // 29: aload 1
      // 2a: ifnull 50
      // 2d: aload 1
      // 2e: invokevirtual java/lang/String.length ()I
      // 31: ifle 50
      // 34: goto 3b
      // 37: invokestatic com/l7tech/gateway/common/service/PublishedService.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 3a: athrow
      // 3b: new java/net/URL
      // 3e: dup
      // 3f: aload 1
      // 40: invokespecial java/net/URL.<init> (Ljava/lang/String;)V
      // 43: pop
      // 44: aload 0
      // 45: aload 1
      // 46: putfield com/l7tech/gateway/common/service/PublishedService._wsdlUrl Ljava/lang/String;
      // 49: goto 55
      // 4c: invokestatic com/l7tech/gateway/common/service/PublishedService.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 4f: athrow
      // 50: aload 0
      // 51: aconst_null
      // 52: putfield com/l7tech/gateway/common/service/PublishedService._wsdlUrl Ljava/lang/String;
      // 55: return
      // try (0 -> 10): 11 java/net/MalformedURLException
      // try (5 -> 16): 17 java/net/MalformedURLException
      // try (19 -> 24): 25 java/net/MalformedURLException
      // try (21 -> 36): 36 java/net/MalformedURLException
   }

   @NotNull(groups = PublishedService.SoapValidationGroup.class, message = "WSDL is required for SOAP services")
   @Size(max = 16000000)
   @Column(name = "wsdl_xml")
   public String getWsdlXml() {
      return this._wsdlXml;
   }

   public synchronized void setWsdlXml(String var1) {
      this.checkLocked();
      this._wsdlXml = var1;
      this._parsedWsdl.set(null);
      this._wsdlLocator.set(null);
   }

   private static SoapVersion guessSoapVersionFromWsdl(Wsdl var0) {
      if (var0 == null) {
         return SoapVersion.UNKNOWN;
      }

      EnumSet var1 = EnumSet.noneOf(SoapVersion.class);

      for (BindingOperation var3 : var0.getBindingOperations()) {
         for (ExtensibilityElement var5 : var3.getExtensibilityElements()) {
            if (var5 instanceof SOAPOperation) {
               var1.add(SoapVersion.SOAP_1_1);
            } else if (var5 instanceof SOAP12Operation) {
               var1.add(SoapVersion.SOAP_1_2);
            }
         }
      }

      SoapVersion var6 = SoapVersion.UNKNOWN;
      if (var1.size() == 1) {
         var6 = (SoapVersion)var1.iterator().next();
      }

      return var6;
   }

   @Column(name = "soap_version")
   @org.hibernate.annotations.Type(
      type = "com.l7tech.server.util.GenericEnumUserType",
      parameters = @Parameter(name = "enumClass", value = "com.l7tech.xml.soap.SoapVersion")
   )
   public synchronized SoapVersion getSoapVersion() {
      if (this._soapVersion == null) {
         try {
            this._soapVersion = guessSoapVersionFromWsdl(this.parsedWsdl());
         } catch (WSDLException var2) {
            this._soapVersion = SoapVersion.UNKNOWN;
         }
      }

      return this._soapVersion;
   }

   public void setSoapVersion(SoapVersion var1) {
      this.checkLocked();
      this._soapVersion = var1;
   }

   public boolean soapVersionSet() {
      return this._soapVersion != null;
   }

   @Transient
   @RbacAttribute
   public String getBaseURI() {
      return this._wsdlUrl == null ? null : Wsdl.extractBaseURI(this._wsdlUrl);
   }

   public Wsdl parsedWsdl() throws WSDLException {
      return this.accessWsdlItem(this._parsedWsdl, new c(this));
   }

   public SerializableWSDLLocator wsdlLocator() throws WSDLException {
      return this.accessWsdlItem(this._wsdlLocator, new d(this));
   }

   public void parseWsdlStrategy(PublishedService.WsdlStrategy var1) {
      this.wsdlStrategy = var1;
   }

   public PublishedService.WsdlStrategy parseWsdlStrategy() {
      return this.wsdlStrategy;
   }

   public Port wsdlPort() throws WSDLException {
      Port var1 = this._wsdlPort.get();

      try {
         if (var1 != null) {
            return var1;
         }
      } catch (WSDLException var7) {
         throw a(var7);
      }

      Wsdl var2 = this.parsedWsdl();

      try {
         if (var2 == null) {
            return null;
         }
      } catch (WSDLException var6) {
         throw a(var6);
      }

      synchronized (this) {
         var1 = this._wsdlPort.get();
         if (var1 != null) {
            return var1;
         }

         var1 = var2.getSoapPort();
         this._wsdlPort.set(var1);
         return var1;
      }
   }

   public synchronized URL serviceUrl() throws WSDLException, MalformedURLException {
      // $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: aload 0
      // 01: getfield com/l7tech/gateway/common/service/PublishedService.defaultRoutingUrl Ljava/lang/String;
      // 04: ifnull 2b
      // 07: aload 0
      // 08: getfield com/l7tech/gateway/common/service/PublishedService._serviceUrl Ljava/net/URL;
      // 0b: ifnonnull 2b
      // 0e: goto 15
      // 11: invokestatic com/l7tech/gateway/common/service/PublishedService.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 14: athrow
      // 15: aload 0
      // 16: new java/net/URL
      // 19: dup
      // 1a: aload 0
      // 1b: getfield com/l7tech/gateway/common/service/PublishedService.defaultRoutingUrl Ljava/lang/String;
      // 1e: invokespecial java/net/URL.<init> (Ljava/lang/String;)V
      // 21: putfield com/l7tech/gateway/common/service/PublishedService._serviceUrl Ljava/net/URL;
      // 24: goto 2b
      // 27: invokestatic com/l7tech/gateway/common/service/PublishedService.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 2a: athrow
      // 2b: aload 0
      // 2c: invokevirtual com/l7tech/gateway/common/service/PublishedService.isSoap ()Z
      // 2f: ifne 3b
      // 32: aload 0
      // 33: getfield com/l7tech/gateway/common/service/PublishedService._serviceUrl Ljava/net/URL;
      // 36: areturn
      // 37: invokestatic com/l7tech/gateway/common/service/PublishedService.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 3a: athrow
      // 3b: aload 0
      // 3c: getfield com/l7tech/gateway/common/service/PublishedService._serviceUrl Ljava/net/URL;
      // 3f: ifnonnull f5
      // 42: aload 0
      // 43: invokevirtual com/l7tech/gateway/common/service/PublishedService.wsdlPort ()Ljavax/wsdl/Port;
      // 46: astore 1
      // 47: aload 1
      // 48: ifnonnull 51
      // 4b: aconst_null
      // 4c: areturn
      // 4d: invokestatic com/l7tech/gateway/common/service/PublishedService.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 50: athrow
      // 51: aload 0
      // 52: invokevirtual com/l7tech/gateway/common/service/PublishedService.parsedWsdl ()Lcom/l7tech/wsdl/Wsdl;
      // 55: aload 1
      // 56: invokevirtual com/l7tech/wsdl/Wsdl.getUriFromPort (Ljavax/wsdl/Port;)Ljava/lang/String;
      // 59: astore 2
      // 5a: aload 2
      // 5b: ifnonnull 89
      // 5e: aload 0
      // 5f: invokevirtual com/l7tech/gateway/common/service/PublishedService.getWsdlUrl ()Ljava/lang/String;
      // 62: getstatic com/l7tech/gateway/common/service/PublishedService.b [Ljava/lang/String;
      // 65: astore 4
      // 67: aload 4
      // 69: bipush 0
      // 6a: aaload
      // 6b: swap
      // 6c: aload 4
      // 6e: bipush 2
      // 6f: aaload
      // 70: 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" ]
      // 75: astore 3
      // 76: getstatic com/l7tech/gateway/common/service/PublishedService.logger Ljava/util/logging/Logger;
      // 79: aload 3
      // 7a: invokevirtual java/util/logging/Logger.severe (Ljava/lang/String;)V
      // 7d: new javax/wsdl/WSDLException
      // 80: dup
      // 81: getstatic com/l7tech/xml/soap/SoapUtil.FC_SERVER Ljava/lang/String;
      // 84: aload 3
      // 85: invokespecial javax/wsdl/WSDLException.<init> (Ljava/lang/String;Ljava/lang/String;)V
      // 88: athrow
      // 89: aload 0
      // 8a: invokevirtual com/l7tech/gateway/common/service/PublishedService.getWsdlUrl ()Ljava/lang/String;
      // 8d: astore 3
      // 8e: aload 3
      // 8f: ifnull e9
      // 92: aload 3
      // 93: invokevirtual java/lang/String.toLowerCase ()Ljava/lang/String;
      // 96: getstatic com/l7tech/gateway/common/service/PublishedService.b [Ljava/lang/String;
      // 99: bipush 3
      // 9a: aaload
      // 9b: invokevirtual java/lang/String.startsWith (Ljava/lang/String;)Z
      // 9e: ifeq e9
      // a1: goto a8
      // a4: invokestatic com/l7tech/gateway/common/service/PublishedService.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // a7: athrow
      // a8: aload 2
      // a9: invokevirtual java/lang/String.toLowerCase ()Ljava/lang/String;
      // ac: getstatic com/l7tech/gateway/common/service/PublishedService.b [Ljava/lang/String;
      // af: bipush 6
      // b1: aaload
      // b2: invokevirtual java/lang/String.startsWith (Ljava/lang/String;)Z
      // b5: ifeq d2
      // b8: goto bf
      // bb: invokestatic com/l7tech/gateway/common/service/PublishedService.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // be: athrow
      // bf: aload 0
      // c0: new java/net/URL
      // c3: dup
      // c4: aload 2
      // c5: invokespecial java/net/URL.<init> (Ljava/lang/String;)V
      // c8: putfield com/l7tech/gateway/common/service/PublishedService._serviceUrl Ljava/net/URL;
      // cb: goto f5
      // ce: invokestatic com/l7tech/gateway/common/service/PublishedService.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // d1: athrow
      // d2: aload 0
      // d3: new java/net/URL
      // d6: dup
      // d7: new java/net/URL
      // da: dup
      // db: aload 3
      // dc: invokespecial java/net/URL.<init> (Ljava/lang/String;)V
      // df: aload 2
      // e0: invokespecial java/net/URL.<init> (Ljava/net/URL;Ljava/lang/String;)V
      // e3: putfield com/l7tech/gateway/common/service/PublishedService._serviceUrl Ljava/net/URL;
      // e6: goto f5
      // e9: aload 0
      // ea: new java/net/URL
      // ed: dup
      // ee: aload 2
      // ef: invokespecial java/net/URL.<init> (Ljava/lang/String;)V
      // f2: putfield com/l7tech/gateway/common/service/PublishedService._serviceUrl Ljava/net/URL;
      // f5: aload 0
      // f6: getfield com/l7tech/gateway/common/service/PublishedService._serviceUrl Ljava/net/URL;
      // f9: areturn
      // try (0 -> 6): 7 javax/wsdl/WSDLException
      // try (3 -> 16): 17 javax/wsdl/WSDLException
      // try (19 -> 25): 25 javax/wsdl/WSDLException
      // try (33 -> 37): 37 javax/wsdl/WSDLException
      // try (71 -> 80): 81 javax/wsdl/WSDLException
      // try (73 -> 90): 91 javax/wsdl/WSDLException
      // try (83 -> 100): 100 javax/wsdl/WSDLException
   }

   @Override
   public String toString() {
      return this._name;
   }

   @Valid
   @Migration(mapName = MigrationMappingSelection.NONE, mapValue = MigrationMappingSelection.NONE, resolver = Type.POLICY)
   @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
   @JoinColumn(name = "policy_goid")
   public Policy getPolicy() {
      return this.policy;
   }

   public void setPolicy(Policy var1) {
      this.checkLocked();
      this.policy = var1;
      if (var1 != null) {
         var1.setFolder(this.folder);
      }
   }

   @RbacAttribute
   @Column(name = "disabled")
   public boolean isDisabled() {
      return this._disabled;
   }

   public void setDisabled(boolean var1) {
      this.checkLocked();
      this._disabled = var1;
   }

   @Override
   public boolean equals(Object var1) {
      if (this == var1) {
         return true;
      } else if (!(var1 instanceof PublishedService var2)) {
         return false;
      } else if (this._wsdlUrl != null ? this._wsdlUrl.equals(var2._wsdlUrl) : var2._wsdlUrl == null) {
         if (!Goid.isDefault(this.getGoid()) ? Goid.equals(this.getGoid(), var2.getGoid()) : Goid.isDefault(var2.getGoid())) {
            return this.securityZone != null ? this.securityZone.equals(var2.securityZone) : var2.securityZone == null;
         } else {
            return false;
         }
      } else {
         return false;
      }
   }

   @Override
   public int hashCode() {
      int var1 = this._wsdlUrl != null ? this._wsdlUrl.hashCode() : 0;
      var1 = 29 * var1 + (this.getGoid() != null ? this.getGoid().hashCode() : 0);
      return 29 * var1 + (this.securityZone != null ? this.securityZone.hashCode() : 0);
   }

   @RbacAttribute
   @Column(name = "soap")
   public boolean isSoap() {
      return this.soap;
   }

   public void setSoap(boolean var1) {
      this.checkLocked();
      this.soap = var1;
      if (this.policy != null) {
         this.policy.setSoap(var1);
      }
   }

   @RbacAttribute
   @Column(name = "internal")
   public boolean isInternal() {
      return this.internal;
   }

   public void setInternal(boolean var1) {
      this.checkLocked();
      this.internal = var1;
   }

   public String displayName() {
      String var1 = this.getName();
      String var2 = this.getRoutingUri();
      if (var2 != null) {
         var1 = var1 + b[1] + var2 + "]";
      }

      return var1;
   }

   @Size(max = 128)
   @List({@Pattern(regexp = "(?!/ssg).*", message = "must not start with '/ssg'"), @Pattern(regexp = "(?!.*?/service/\\d+$).*"), @Pattern(regexp = "/.+")})
   @RbacAttribute
   @Column(name = "routing_uri")
   public String getRoutingUri() {
      return this.routingUri;
   }

   public void setRoutingUri(String var1) {
      this.checkLocked();
      this.routingUri = var1;
   }

   @RbacAttribute
   @Size(max = 4096)
   @Column(name = "default_routing_url")
   public String getDefaultRoutingUrl() {
      return this.defaultRoutingUrl;
   }

   public void setDefaultRoutingUrl(String var1) {
      this.checkLocked();
      this.defaultRoutingUrl = var1;
   }

   @Transient
   public boolean isMethodAllowed(HttpMethod var1) {
      return this.httpMethods.contains(var1);
   }

   @Deprecated
   @Column(name = "http_methods")
   @org.hibernate.annotations.Type(
      type = "com.l7tech.server.util.GenericEnumSetUserType",
      parameters = @Parameter(name = "enumClass", value = "com.l7tech.common.http.HttpMethod")
   )
   public Set<HttpMethod> getHttpMethods() {
      return this.httpMethods;
   }

   @Transient
   public Set<HttpMethod> getHttpMethodsReadOnly() {
      return Collections.unmodifiableSet(this.httpMethods);
   }

   public void setHttpMethods(Set<HttpMethod> var1) {
      this.checkLocked();
      this.httpMethods = var1;
   }

   @Transient
   public boolean isMultipart() throws PublishedService.ServiceException {
      // $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: aload 0
      // 01: getfield com/l7tech/gateway/common/service/PublishedService.multipart Ljava/lang/Boolean;
      // 04: ifnonnull 5a
      // 07: aload 0
      // 08: invokevirtual com/l7tech/gateway/common/service/PublishedService.parsedWsdl ()Lcom/l7tech/wsdl/Wsdl;
      // 0b: astore 1
      // 0c: aload 0
      // 0d: invokevirtual com/l7tech/gateway/common/service/PublishedService.isSoap ()Z
      // 10: ifne 21
      // 13: aload 0
      // 14: getstatic java/lang/Boolean.TRUE Ljava/lang/Boolean;
      // 17: putfield com/l7tech/gateway/common/service/PublishedService.multipart Ljava/lang/Boolean;
      // 1a: goto 48
      // 1d: invokestatic com/l7tech/gateway/common/service/PublishedService.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 20: athrow
      // 21: aload 1
      // 22: ifnull 41
      // 25: aload 1
      // 26: invokevirtual com/l7tech/wsdl/Wsdl.hasMultipartOperations ()Z
      // 29: ifeq 41
      // 2c: goto 33
      // 2f: invokestatic com/l7tech/gateway/common/service/PublishedService.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 32: athrow
      // 33: aload 0
      // 34: getstatic java/lang/Boolean.TRUE Ljava/lang/Boolean;
      // 37: putfield com/l7tech/gateway/common/service/PublishedService.multipart Ljava/lang/Boolean;
      // 3a: goto 48
      // 3d: invokestatic com/l7tech/gateway/common/service/PublishedService.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 40: athrow
      // 41: aload 0
      // 42: getstatic java/lang/Boolean.FALSE Ljava/lang/Boolean;
      // 45: putfield com/l7tech/gateway/common/service/PublishedService.multipart Ljava/lang/Boolean;
      // 48: goto 5a
      // 4b: astore 1
      // 4c: new com/l7tech/gateway/common/service/PublishedService$ServiceException
      // 4f: dup
      // 50: getstatic com/l7tech/gateway/common/service/PublishedService.b [Ljava/lang/String;
      // 53: bipush 5
      // 54: aaload
      // 55: aload 1
      // 56: invokespecial com/l7tech/gateway/common/service/PublishedService$ServiceException.<init> (Ljava/lang/String;Ljava/lang/Throwable;)V
      // 59: athrow
      // 5a: aload 0
      // 5b: getfield com/l7tech/gateway/common/service/PublishedService.multipart Ljava/lang/Boolean;
      // 5e: invokevirtual java/lang/Boolean.booleanValue ()Z
      // 61: ireturn
      // try (17 -> 27): 27 javax/wsdl/WSDLException
      // try (15 -> 20): 21 javax/wsdl/WSDLException
      // try (6 -> 13): 13 javax/wsdl/WSDLException
      // try (3 -> 32): 33 javax/wsdl/WSDLException
   }

   @Column(name = "lax_resolution")
   public boolean isLaxResolution() {
      return this.laxResolution;
   }

   public void setLaxResolution(boolean var1) {
      this.checkLocked();
      this.laxResolution = var1;
   }

   @Column(name = "wss_processing")
   public boolean isWssProcessingEnabled() {
      return this.wssProcessingEnabled;
   }

   public void setWssProcessingEnabled(boolean var1) {
      this.checkLocked();
      this.wssProcessingEnabled = var1;
   }

   @Column(name = "tracing")
   public boolean isTracingEnabled() {
      return this.tracingEnabled;
   }

   public void setTracingEnabled(boolean var1) {
      this.checkLocked();
      this.tracingEnabled = var1;
   }

   @Migration(mapName = MigrationMappingSelection.NONE, mapValue = MigrationMappingSelection.NONE, resolver = Type.ASSERTION)
   @Dependency(isDependency = false)
   @ManyToOne
   @JoinColumn(name = "folder_goid")
   public Folder getFolder() {
      return this.folder;
   }

   public void setFolder(Folder var1) {
      this.checkLocked();
      this.folder = var1;
      if (this.policy != null) {
         this.policy.setFolder(var1);
      }
   }

   public String generatePolicyName() {
      StringBuilder var1 = new StringBuilder(300);
      String[] var2 = b;
      var1.append(var2[7]);
      var1.append(this.getId());
      var1.append(var2[4]);
      var1.append(this.getName());
      if (var1.length() > 255) {
         var1.setLength(255);
      }

      return var1.toString();
   }

   @Override
   public void flush() throws IOException {
      try {
         this.checkLocked();
         if (this.policy != null) {
            this.policy.flush();
         }
      } catch (IOException var1) {
         throw a(var1);
      }
   }

   @Fetch(FetchMode.SUBSELECT)
   @ElementCollection(fetch = FetchType.EAGER)
   @JoinTable(name = "published_service_property", joinColumns = @JoinColumn(name = "published_service_goid", referencedColumnName = "goid"))
   @MapKeyColumn(name = "name", length = 128)
   @Column(name = "value", nullable = false, length = 32672)
   @XmlElement(name = "Properties")
   @XmlJavaTypeAdapter(JaxbMapTypeAdapter.class)
   public Map<String, String> getProperties() {
      return this.properties;
   }

   public void setProperties(Map<String, String> var1) {
      this.checkLocked();
      this.properties = var1;
   }

   @Transient
   @org.jetbrains.annotations.NotNull
   public Set<String> getPropertyNames() {
      return new HashSet<>(this.properties.keySet());
   }

   @Transient
   @Nullable
   public String getProperty(@NotNull String var1) {
      return this.properties.get(var1);
   }

   public void putProperty(@NotNull String var1, @NotNull String var2) {
      this.checkLocked();
      this.properties.put(var1, var2);
   }

   public String removeProperty(@NotNull String var1) {
      this.checkLocked();
      return this.properties.remove(var1);
   }

   private void writeObject(ObjectOutputStream var1) throws IOException {
      this._parsedWsdl.set(null);
      this._wsdlLocator.set(null);
      this._wsdlPort.set(null);
      var1.defaultWriteObject();
   }

   private <WI> WI accessWsdlItem(AtomicReference<WI> var1, TernaryThrows<WI, PublishedService.WsdlStrategy, String, String, WSDLException> var2) throws WSDLException {
      Object var3 = var1.get();

      try {
         if (var3 != null) {
            return (WI)var3;
         }
      } catch (WSDLException var10) {
         throw a(var10);
      }

      String var4 = this.getWsdlXml();

      try {
         if (var4 == null) {
            return null;
         }
      } catch (WSDLException var9) {
         throw a(var9);
      }

      synchronized (this) {
         var3 = var1.get();
         if (var3 != null) {
            return (WI)var3;
         }

         PublishedService.WsdlStrategy var6 = this.wsdlStrategy;
         if (var6 == null) {
            var6 = new e();
         }

         var3 = var2.call(var6, this.getWsdlUrl(), var4);
         var1.set(var3);
         return (WI)var3;
      }
   }

   static {
      String[] var5 = new String[8];
      int var3 = 0;
      String var2 = "+C{\u007f\u001e\u0002\\K\u001c\\tVW\u001eP\u007f\b0\\\\PJq\u0015~\u001fR\u001eHq\u0010y[\u0013kl\\\u0004\u0014dKC\u0002P08?qQ]QJ0\u0018uKVLSy\u0012u\u001f^KRd\u0015`^AJ\u001ev\u0010qX\u001f\u001e]\u007f\t|[\u0013PQd\\`M\\][c\u000f0h`zr>";
      int var4 = "+C{\u007f\u001e\u0002\\K\u001c\\tVW\u001eP\u007f\b0\\\\PJq\u0015~\u001fR\u001eHq\u0010y[\u0013kl\\\u0004\u0014dKC\u0002P08?qQ]QJ0\u0018uKVLSy\u0012u\u001f^KRd\u0015`^AJ\u001ev\u0010qX\u001f\u001e]\u007f\t|[\u0013PQd\\`M\\][c\u000f0h`zr>"
         .length();
      char var1 = 5;
      int var7 = -1;

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

         while (true) {
            String var8 = b(var10000, b(var10001));
            switch (var10002) {
               case 0:
                  var5[var3++] = var8;
                  if ((var7 += var1) >= var4) {
                     b = var5;
                     logger = Logger.getLogger(PublishedService.class.getName());
                     METHODS_SOAP = EnumSet.of(HttpMethod.POST);
                     METHODS_REST = EnumSet.of(HttpMethod.POST, HttpMethod.GET, HttpMethod.PUT, HttpMethod.DELETE, HttpMethod.HEAD);
                     return;
                  }

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

                  var2 = "\u0017gH@\u0014/|PY^D3\u0019|N\u0010NXa\tz_U\u001d\u001e";
                  var4 = "\u0017gH@\u0014/|PY^D3\u0019|N\u0010NXa\tz_U\u001d\u001e".length();
                  var1 = 4;
                  var7 = -1;
            }

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

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

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

      return var10000;
   }

   private static String b(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 -> 62;
            case 1 -> 82;
            case 2 -> 125;
            case 3 -> 113;
            case 4 -> 124;
            case 5 -> 124;
            default -> 82;
         });
      }

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

   public static class ServiceException extends Exception {
      static final long serialVersionUID = 5045391267020703068L;

      public ServiceException(String var1, Throwable var2) {
         super(var1, var2);
      }
   }

   public interface SoapValidationGroup {
   }

   public interface WsdlStrategy {
      Wsdl parseWsdl(PublishedService var1, String var2, String var3) throws WSDLException;

      SerializableWSDLLocator wsdlLocator(PublishedService var1, String var2, String var3) throws WSDLException;
   }
}
