Klasse ProseoUtil

java.lang.Object
de.dlr.proseo.model.util.ProseoUtil

public class ProseoUtil extends Object
Class to hold general utility methods
Autor:
Ernst Melchinger
  • Feldübersicht

    Felder
    Modifizierer und Typ
    Feld
    Beschreibung
    static final int
    Maximum number of retries for database concurrency issues
    static final int
    Wait interval in ms before retrying database operation
    static final int
    Maximum number of retries for Kubernetes API issues
    static final int
    Wait interval in ms before retrying Kubernetes API operation
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    static void
    Wait a slightly randomized amount of time based on database wait parameters
    static void
    dbWait(int attempt)
    Wait a slightly randomized amount of time based on database wait parameters (increasing progressively with the number of attempts)
    static String
    Escape a give String to make it safe to be printed or stored.
    static String
    Extracts the prosEO-compliant message from the "Warning" header, if any
    static void
    Wait a slightly randomized amount of time based on Kubernetes wait parameters
    static void
    kubeWait(int attempt)
    Wait a slightly randomized amount of time based on Kubernetes wait parameters (increasing progressively with the number of attempts)
    static void
    randomWait(int attempt, int waitInterval)
    Wait a slightly randomized amount of time, increasing progressively with the number of attempts

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Felddetails

    • DB_MAX_RETRY

      public static final int DB_MAX_RETRY
      Maximum number of retries for database concurrency issues
      Siehe auch:
    • DB_WAIT

      public static final int DB_WAIT
      Wait interval in ms before retrying database operation
      Siehe auch:
    • K8S_MAX_RETRY

      public static final int K8S_MAX_RETRY
      Maximum number of retries for Kubernetes API issues
      Siehe auch:
    • K8S_WAIT

      public static final int K8S_WAIT
      Wait interval in ms before retrying Kubernetes API operation
      Siehe auch:
  • Konstruktordetails

    • ProseoUtil

      public ProseoUtil()
  • Methodendetails

    • escape

      public static String escape(String s)
      Escape a give String to make it safe to be printed or stored.
      Parameter:
      s - The input String.
      Gibt zurück:
      The output String.
    • extractProseoMessage

      public static String extractProseoMessage(String warningHeader)
      Extracts the prosEO-compliant message from the "Warning" header, if any
      Parameter:
      warningHeader - the HTTP Warning header to extract the message from
      Gibt zurück:
      the prosEO-compliant message, if there is one, or the unchanged warning header, if there is one, or null otherwise
    • randomWait

      public static void randomWait(int attempt, int waitInterval)
      Wait a slightly randomized amount of time, increasing progressively with the number of attempts
      Parameter:
      attempt - the retry attempt count
      waitInterval - the base wait interval to apply
    • dbWait

      public static void dbWait()
      Wait a slightly randomized amount of time based on database wait parameters
    • dbWait

      public static void dbWait(int attempt)
      Wait a slightly randomized amount of time based on database wait parameters (increasing progressively with the number of attempts)
      Parameter:
      attempt - the retry attempt count
    • kubeWait

      public static void kubeWait()
      Wait a slightly randomized amount of time based on Kubernetes wait parameters
    • kubeWait

      public static void kubeWait(int attempt)
      Wait a slightly randomized amount of time based on Kubernetes wait parameters (increasing progressively with the number of attempts)
      Parameter:
      attempt - the retry attempt count