null
- */
- public static String retrieveConfigProperty(String propertyName) {
- return retrieveConfigProperty(propertyName, null);
- }
-
- /**
- * Retrieve configuration property by name. If property is not defined default value will be used.
- */
- public static String retrieveConfigProperty(String propertyName, String defaultValue) {
- try {
- String value = ConfigProvider.getConfig().getValue(propertyName, String.class);
- if (Objects.isNull(value)) {
- log.warn(WARN_MESSAGE_NOT_DEFINED_PROPERTY, propertyName, defaultValue);
- return defaultValue;
- }
- return value;
- } catch (Exception e) {
- log.warn(WARN_MESSAGE_NOT_DEFINED_PROPERTY, propertyName, defaultValue);
- return defaultValue;
- }
- }
-
- public static String getRealmId(KeycloakSession keycloakSession) {
- return keycloakSession.getContext().getRealm().getId();
- }
- private Utils() {}
-
-}
diff --git a/openapi-with-quarkus/src/main/java/org/quarkus/openapi/generator/common/RealmSessionCountFunction.java b/openapi-with-quarkus/src/main/java/org/quarkus/openapi/generator/common/RealmSessionCountFunction.java
deleted file mode 100644
index 424b6ed..0000000
--- a/openapi-with-quarkus/src/main/java/org/quarkus/openapi/generator/common/RealmSessionCountFunction.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.quarkus.openapi.generator.common;
-
-import java.util.Map;
-import java.util.function.ToDoubleFunction;
-import org.keycloak.models.KeycloakSession;
-import org.keycloak.models.RealmModel;
-import org.keycloak.services.resources.KeycloakApplication;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RealmSessionCountFunction implements ToDoubleFunctionThis page is served by Quarkus.
- Visit the Dev UI -This page: src/main/resources/META-INF/resources/index.html
App configuration: src/main/resources/application.properties
Static assets: src/main/resources/META-INF/resources/
Code: src/main/java
Generated starter code:
-@Path: /hello
- Practical step-by-step guides to help you achieve a specific goal. Use them to help get your work - done.
-Everyone has a favorite IDE they like to use to code. Learn how to configure yours to maximize your - Quarkus productivity.
-