forked from keycloak/keycloak
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KEYCLOAK-14540 Determine project/product name
- Loading branch information
Showing
5 changed files
with
36 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,6 @@ | |
|
||
package org.keycloak.common; | ||
|
||
import static org.keycloak.common.Profile.Type.DEPRECATED; | ||
|
||
import org.jboss.logging.Logger; | ||
|
||
import java.io.File; | ||
|
@@ -28,6 +26,8 @@ | |
import java.util.Properties; | ||
import java.util.Set; | ||
|
||
import static org.keycloak.common.Profile.Type.DEPRECATED; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Bill Burke</a> | ||
* @version $Revision: 1 $ | ||
|
@@ -36,13 +36,17 @@ public class Profile { | |
|
||
private static final Logger logger = Logger.getLogger(Profile.class); | ||
|
||
public static final String PRODUCT_NAME = ProductValue.RHSSO.getName(); | ||
public static final String PROJECT_NAME = ProductValue.KEYCLOAK.getName(); | ||
|
||
public enum Type { | ||
DEFAULT, | ||
DISABLED_BY_DEFAULT, | ||
PREVIEW, | ||
EXPERIMENTAL, | ||
DEPRECATED; | ||
} | ||
|
||
public enum Feature { | ||
AUTHORIZATION(Type.DEFAULT), | ||
ACCOUNT2(Type.DEFAULT), | ||
|
@@ -59,8 +63,8 @@ public enum Feature { | |
CIBA(Type.PREVIEW), | ||
MAP_STORAGE(Type.EXPERIMENTAL); | ||
|
||
private Type typeProject; | ||
private Type typeProduct; | ||
private final Type typeProject; | ||
private final Type typeProduct; | ||
|
||
Feature(Type type) { | ||
this(type, type); | ||
|
@@ -85,8 +89,18 @@ public boolean hasDifferentProductType() { | |
} | ||
|
||
private enum ProductValue { | ||
KEYCLOAK, | ||
RHSSO | ||
KEYCLOAK("Keycloak"), | ||
RHSSO("RH-SSO"); | ||
|
||
private final String name; | ||
|
||
ProductValue(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} | ||
|
||
private enum ProfileValue { | ||
|
@@ -112,7 +126,7 @@ public Profile(PropertyResolver resolver) { | |
this.propertyResolver = resolver; | ||
Config config = new Config(); | ||
|
||
product = "rh-sso".equals(Version.NAME) ? ProductValue.RHSSO : ProductValue.KEYCLOAK; | ||
product = PRODUCT_NAME.toLowerCase().equals(Version.NAME) ? ProductValue.RHSSO : ProductValue.KEYCLOAK; | ||
profile = ProfileValue.valueOf(config.getProfile().toUpperCase()); | ||
|
||
for (Feature f : Feature.values()) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters