package com.l7tech.server.wsdm.subscription;

import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.imp.PersistentEntityImp;
import com.l7tech.server.wsdm.faults.TopicNotSupportedFaultException;
import com.l7tech.server.wsdm.method.Subscribe;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import jakarta.persistence.Version;
import org.hibernate.annotations.Proxy;
import org.hibernate.annotations.Type;

@Entity
@Proxy(lazy = false)
@Table(name = "wsdm_subscription")
public class Subscription extends PersistentEntityImp {
   public static final int TOPIC_METRICS_CAPABILITY = 1;
   public static final int TOPIC_OPERATIONAL_STATUS = 2;
   public static final String NS;
   private String uuid;
   private Goid esmServiceGoid;
   private Goid publishedServiceGoid;
   private String referenceCallback;
   private int topic = -1;
   private volatile long termination;
   private String notificationPolicyGuid;
   private String ownerNodeId;
   private long lastNotificationTime;
   private static final String OPERATIONAL_STATUS_CAPABILITY;
   private static final String OPERATIONAL_STATUS_CAPABILITY_PREFIX;
   private static final String METRICS_CAPABILITY;
   private static final String METRICS_CAPABILITY_PREFIX;
   private String referenceParams;
   static final long serialVersionUID = -6997413458179829069L;
   private static final String[] b;

   public Subscription(Subscribe param1, String param2, String param3) throws TopicNotSupportedFaultException {
      // $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: invokespecial com/l7tech/objectmodel/imp/PersistentEntityImp.<init> ()V
      // 04: aload 0
      // 05: bipush -1
      // 06: putfield com/l7tech/server/wsdm/subscription/Subscription.topic I
      // 09: aload 0
      // 0a: aload 2
      // 0b: putfield com/l7tech/server/wsdm/subscription/Subscription.uuid Ljava/lang/String;
      // 0e: aload 0
      // 0f: aload 1
      // 10: invokevirtual com/l7tech/server/wsdm/method/Subscribe.getEsmServiceGoid ()Lcom/l7tech/objectmodel/Goid;
      // 13: putfield com/l7tech/server/wsdm/subscription/Subscription.esmServiceGoid Lcom/l7tech/objectmodel/Goid;
      // 16: aload 0
      // 17: getstatic com/l7tech/objectmodel/EntityType.SERVICE Lcom/l7tech/objectmodel/EntityType;
      // 1a: aload 1
      // 1b: invokevirtual com/l7tech/server/wsdm/method/Subscribe.getServiceId ()Ljava/lang/String;
      // 1e: invokestatic com/l7tech/util/GoidUpgradeMapper.mapId (Lcom/l7tech/objectmodel/EntityType;Ljava/lang/String;)Lcom/l7tech/objectmodel/Goid;
      // 21: putfield com/l7tech/server/wsdm/subscription/Subscription.publishedServiceGoid Lcom/l7tech/objectmodel/Goid;
      // 24: aload 0
      // 25: aload 3
      // 26: putfield com/l7tech/server/wsdm/subscription/Subscription.ownerNodeId Ljava/lang/String;
      // 29: aload 1
      // 2a: invokevirtual com/l7tech/server/wsdm/method/Subscribe.isTerminationParsed ()Z
      // 2d: ifeq 38
      // 30: aload 0
      // 31: aload 1
      // 32: invokevirtual com/l7tech/server/wsdm/method/Subscribe.getTermination ()J
      // 35: putfield com/l7tech/server/wsdm/subscription/Subscription.termination J
      // 38: aload 0
      // 39: aload 1
      // 3a: invokevirtual com/l7tech/server/wsdm/method/Subscribe.getReferenceParams ()Ljava/lang/String;
      // 3d: putfield com/l7tech/server/wsdm/subscription/Subscription.referenceParams Ljava/lang/String;
      // 40: aload 1
      // 41: invokevirtual com/l7tech/server/wsdm/method/Subscribe.getTopicValue ()Ljava/lang/String;
      // 44: astore 4
      // 46: aconst_null
      // 47: astore 5
      // 49: aload 4
      // 4b: ldc ":"
      // 4d: invokevirtual java/lang/String.contains (Ljava/lang/CharSequence;)Z
      // 50: ifeq 69
      // 53: aload 4
      // 55: ldc ":"
      // 57: bipush 2
      // 58: invokevirtual java/lang/String.split (Ljava/lang/String;I)[Ljava/lang/String;
      // 5b: astore 6
      // 5d: aload 6
      // 5f: bipush 0
      // 60: aaload
      // 61: astore 5
      // 63: aload 6
      // 65: bipush 1
      // 66: aaload
      // 67: astore 4
      // 69: aload 4
      // 6b: getstatic com/l7tech/server/wsdm/subscription/Subscription.b [Ljava/lang/String;
      // 6e: bipush 2
      // 6f: aaload
      // 70: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 73: ifeq a2
      // 76: aload 5
      // 78: ifnull a2
      // 7b: goto 82
      // 7e: invokestatic com/l7tech/server/wsdm/subscription/Subscription.a (Lcom/l7tech/server/wsdm/faults/TopicNotSupportedFaultException;)Lcom/l7tech/server/wsdm/faults/TopicNotSupportedFaultException;
      // 81: athrow
      // 82: aload 5
      // 84: getstatic com/l7tech/server/wsdm/subscription/Subscription.b [Ljava/lang/String;
      // 87: bipush 3
      // 88: aaload
      // 89: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 8c: ifeq a2
      // 8f: goto 96
      // 92: invokestatic com/l7tech/server/wsdm/subscription/Subscription.a (Lcom/l7tech/server/wsdm/faults/TopicNotSupportedFaultException;)Lcom/l7tech/server/wsdm/faults/TopicNotSupportedFaultException;
      // 95: athrow
      // 96: aload 0
      // 97: bipush 1
      // 98: putfield com/l7tech/server/wsdm/subscription/Subscription.topic I
      // 9b: goto f3
      // 9e: invokestatic com/l7tech/server/wsdm/subscription/Subscription.a (Lcom/l7tech/server/wsdm/faults/TopicNotSupportedFaultException;)Lcom/l7tech/server/wsdm/faults/TopicNotSupportedFaultException;
      // a1: athrow
      // a2: aload 4
      // a4: getstatic com/l7tech/server/wsdm/subscription/Subscription.b [Ljava/lang/String;
      // a7: bipush 9
      // a9: aaload
      // aa: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // ad: ifeq dd
      // b0: aload 5
      // b2: ifnull dd
      // b5: goto bc
      // b8: invokestatic com/l7tech/server/wsdm/subscription/Subscription.a (Lcom/l7tech/server/wsdm/faults/TopicNotSupportedFaultException;)Lcom/l7tech/server/wsdm/faults/TopicNotSupportedFaultException;
      // bb: athrow
      // bc: aload 5
      // be: getstatic com/l7tech/server/wsdm/subscription/Subscription.b [Ljava/lang/String;
      // c1: bipush 8
      // c3: aaload
      // c4: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // c7: ifeq dd
      // ca: goto d1
      // cd: invokestatic com/l7tech/server/wsdm/subscription/Subscription.a (Lcom/l7tech/server/wsdm/faults/TopicNotSupportedFaultException;)Lcom/l7tech/server/wsdm/faults/TopicNotSupportedFaultException;
      // d0: athrow
      // d1: aload 0
      // d2: bipush 2
      // d3: putfield com/l7tech/server/wsdm/subscription/Subscription.topic I
      // d6: goto f3
      // d9: invokestatic com/l7tech/server/wsdm/subscription/Subscription.a (Lcom/l7tech/server/wsdm/faults/TopicNotSupportedFaultException;)Lcom/l7tech/server/wsdm/faults/TopicNotSupportedFaultException;
      // dc: athrow
      // dd: new com/l7tech/server/wsdm/faults/TopicNotSupportedFaultException
      // e0: dup
      // e1: aload 1
      // e2: invokevirtual com/l7tech/server/wsdm/method/Subscribe.getTopicValue ()Ljava/lang/String;
      // e5: getstatic com/l7tech/server/wsdm/subscription/Subscription.b [Ljava/lang/String;
      // e8: bipush 4
      // e9: aaload
      // ea: invokedynamic makeConcatWithConstants (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" ]
      // ef: invokespecial com/l7tech/server/wsdm/faults/TopicNotSupportedFaultException.<init> (Ljava/lang/String;)V
      // f2: athrow
      // f3: aload 0
      // f4: aload 1
      // f5: invokevirtual com/l7tech/server/wsdm/method/Subscribe.getCallBackAddress ()Ljava/lang/String;
      // f8: putfield com/l7tech/server/wsdm/subscription/Subscription.referenceCallback Ljava/lang/String;
      // fb: return
      // try (54 -> 62): 63 com/l7tech/server/wsdm/faults/TopicNotSupportedFaultException
      // try (60 -> 71): 72 com/l7tech/server/wsdm/faults/TopicNotSupportedFaultException
      // try (65 -> 78): 78 com/l7tech/server/wsdm/faults/TopicNotSupportedFaultException
      // try (80 -> 88): 89 com/l7tech/server/wsdm/faults/TopicNotSupportedFaultException
      // try (86 -> 97): 98 com/l7tech/server/wsdm/faults/TopicNotSupportedFaultException
      // try (91 -> 104): 104 com/l7tech/server/wsdm/faults/TopicNotSupportedFaultException
   }

   @Version
   @Column(name = "version")
   public int getVersion() {
      return super.getVersion();
   }

   @Column(name = "uuid", nullable = false, unique = true, length = 36)
   public String getUuid() {
      return this.uuid;
   }

   @Column(name = "esm_service_goid", nullable = false)
   @Type(type = "com.l7tech.server.util.GoidType")
   public Goid getEsmServiceGoid() {
      return this.esmServiceGoid;
   }

   @Column(name = "callback_url", nullable = false, length = 255)
   public String getReferenceCallback() {
      return this.referenceCallback;
   }

   @Column(name = "termination_time", nullable = false)
   public long getTermination() {
      return this.termination;
   }

   @Column(name = "topic", nullable = false)
   public int getTopic() {
      return this.topic;
   }

   @Column(name = "published_service_goid", nullable = false)
   @Type(type = "com.l7tech.server.util.GoidType")
   public Goid getPublishedServiceGoid() {
      return this.publishedServiceGoid;
   }

   @Column(name = "notification_policy_guid", length = 36)
   public String getNotificationPolicyGuid() {
      return this.notificationPolicyGuid;
   }

   @Column(name = "reference_parameters", length = 16384)
   public String getReferenceParams() {
      return this.referenceParams;
   }

   @Deprecated
   public void setReferenceParams(String var1) {
      this.referenceParams = var1;
   }

   public void setNotificationPolicyGuid(String var1) {
      this.notificationPolicyGuid = var1;
   }

   public void setTermination(long var1) {
      this.termination = var1;
   }

   @Deprecated
   protected void setPublishedServiceGoid(Goid var1) {
      this.publishedServiceGoid = var1;
   }

   @Deprecated
   protected Subscription() {
   }

   @Deprecated
   protected void setUuid(String var1) {
      this.uuid = var1;
   }

   @Deprecated
   public void setEsmServiceGoid(Goid var1) {
      this.esmServiceGoid = var1;
   }

   @Deprecated
   protected void setReferenceCallback(String var1) {
      this.referenceCallback = var1;
   }

   @Deprecated
   protected void setTopic(int var1) {
      this.topic = var1;
   }

   @Column(name = "owner_node_id", length = 64)
   public String getOwnerNodeId() {
      return this.ownerNodeId;
   }

   public void setOwnerNodeId(String var1) {
      this.ownerNodeId = var1;
   }

   @Column(name = "last_notification")
   public long getLastNotificationTime() {
      return this.lastNotificationTime;
   }

   public void setLastNotificationTime(long var1) {
      this.lastNotificationTime = var1;
   }

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

   static {
      String[] var5 = new String[10];
      int var3 = 0;
      String var2 = "\u001ab^~\\\n9\u0014fZmW\u0000&>sS.?s^|\u000fFe p]\"Y\b32u\u001dxP\n\"ydEa\u001a\u00079xpYhXF9\"eYoG\u0000:#nEb\u0011\u001ab^~\\\n9\u0014fZmW\u0000&>sS\u0005:h]\u007fP\u0019wnY,[\u0006>wf\n\u007f@\u0019:8u^iQI\u001e8wCo\u0005:h]\u007fP\u001b\u0018wO~T\u001d#8iK`f\u001d+#rYOT\u0019+5nFeA\u0010\u0007:r]\u007f\u0018\f<";
      int var4 = "\u001ab^~\\\n9\u0014fZmW\u0000&>sS.?s^|\u000fFe p]\"Y\b32u\u001dxP\n\"ydEa\u001a\u00079xpYhXF9\"eYoG\u0000:#nEb\u0011\u001ab^~\\\n9\u0014fZmW\u0000&>sS\u0005:h]\u007fP\u0019wnY,[\u0006>wf\n\u007f@\u0019:8u^iQI\u001e8wCo\u0005:h]\u007fP\u001b\u0018wO~T\u001d#8iK`f\u001d+#rYOT\u0019+5nFeA\u0010\u0007:r]\u007f\u0018\f<"
         .length();
      char var1 = 17;
      int var7 = -1;

      label24:
      while (true) {
         byte var10000 = 15;
         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;
                     String[] var9 = b;
                     OPERATIONAL_STATUS_CAPABILITY_PREFIX = b[7];
                     OPERATIONAL_STATUS_CAPABILITY = var9[6];
                     METRICS_CAPABILITY = var9[0];
                     METRICS_CAPABILITY_PREFIX = var9[5];
                     NS = var9[1];
                     return;
                  }

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

                  var2 = "\u000eFiK,8\b\u001b,C{J`)\u0017\f]\u007fTR)\u001f\u0017Fm{`-\u001f\u0001ZrQu$";
                  var4 = "\u000eFiK,8\b\u001b,C{J`)\u0017\f]\u007fTR)\u001f\u0017Fm{`-\u001f\u0001ZrQu$".length();
                  var1 = 7;
                  var7 = -1;
            }

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

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

      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 -> 88;
            case 1 -> 8;
            case 2 -> 37;
            case 3 -> 3;
            case 4 -> 58;
            case 5 -> 102;
            default -> 69;
         });
      }

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