Package de.dlr.proseo.model.util
Klasse ProseoUtil
java.lang.Object
de.dlr.proseo.model.util.ProseoUtil
Class to hold general utility methods
- Autor:
- Ernst Melchinger
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final intMaximum number of retries for database concurrency issuesstatic final intWait interval in ms before retrying database operationstatic final intMaximum number of retries for Kubernetes API issuesstatic final intWait interval in ms before retrying Kubernetes API operation -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic voiddbWait()Wait a slightly randomized amount of time based on database wait parametersstatic voiddbWait(int attempt) Wait a slightly randomized amount of time based on database wait parameters (increasing progressively with the number of attempts)static StringEscape a give String to make it safe to be printed or stored.static StringextractProseoMessage(String warningHeader) Extracts the prosEO-compliant message from the "Warning" header, if anystatic voidkubeWait()Wait a slightly randomized amount of time based on Kubernetes wait parametersstatic voidkubeWait(int attempt) Wait a slightly randomized amount of time based on Kubernetes wait parameters (increasing progressively with the number of attempts)static voidrandomWait(int attempt, int waitInterval) Wait a slightly randomized amount of time, increasing progressively with the number of attempts
-
Felddetails
-
DB_MAX_RETRY
public static final int DB_MAX_RETRYMaximum number of retries for database concurrency issues- Siehe auch:
-
DB_WAIT
public static final int DB_WAITWait interval in ms before retrying database operation- Siehe auch:
-
K8S_MAX_RETRY
public static final int K8S_MAX_RETRYMaximum number of retries for Kubernetes API issues- Siehe auch:
-
K8S_WAIT
public static final int K8S_WAITWait interval in ms before retrying Kubernetes API operation- Siehe auch:
-
-
Konstruktordetails
-
ProseoUtil
public ProseoUtil()
-
-
Methodendetails
-
escape
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
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 countwaitInterval- 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
-