keycloak
クラス | 静的公開メンバ関数 | 非公開メンバ関数 | 非公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.keycloak.common.Profile クラス
org.keycloak.common.Profile 連携図
Collaboration graph

クラス

enum  Feature
 
enum  ProductValue
 
enum  ProfileValue
 

静的公開メンバ関数

static String getName ()
 
static Set< FeaturegetDisabledFeatures ()
 
static boolean isFeatureEnabled (Feature feature)
 

非公開メンバ関数

 Profile ()
 

非公開変数類

final ProductValue product
 
final ProfileValue profile
 
final Set< FeaturedisabledFeatures = new HashSet<>()
 

静的非公開変数類

static final Profile CURRENT = new Profile()
 

詳解

著者
Bill Burke
バージョン
Revision
1

クラス詳解

◆ org::keycloak::common::Profile::Feature

enum org::keycloak::common::Profile::Feature
org.keycloak.common.Profile.Feature 連携図
Collaboration graph
列挙値
ACCOUNT2
ADMIN_FINE_GRAINED_AUTHZ
DOCKER
IMPERSONATION
OPENSHIFT_INTEGRATION
SCRIPTS
TOKEN_EXCHANGE

構築子と解体子

◆ Profile()

org.keycloak.common.Profile.Profile ( )
inlineprivate
76  {
77  product = "rh-sso".equals(Version.NAME) ? ProductValue.RHSSO : ProductValue.KEYCLOAK;
78 
79  try {
80  Properties props = new Properties();
81 
82  String jbossServerConfigDir = System.getProperty("jboss.server.config.dir");
83  if (jbossServerConfigDir != null) {
84  File file = new File(jbossServerConfigDir, "profile.properties");
85  if (file.isFile()) {
86  props.load(new FileInputStream(file));
87  }
88  }
89 
90  if (System.getProperties().containsKey("keycloak.profile")) {
91  props.setProperty("profile", System.getProperty("keycloak.profile"));
92  }
93 
94  for (String k : System.getProperties().stringPropertyNames()) {
95  if (k.startsWith("keycloak.profile.feature.")) {
96  props.put(k.replace("keycloak.profile.feature.", "feature."), System.getProperty(k));
97  }
98  }
99 
100  if (props.containsKey("profile")) {
101  profile = ProfileValue.valueOf(props.getProperty("profile").toUpperCase());
102  } else {
103  profile = ProfileValue.valueOf(Version.DEFAULT_PROFILE.toUpperCase());
104  }
105 
107  disabledFeatures.removeAll(product.excluded);
108 
109  for (String k : props.stringPropertyNames()) {
110  if (k.startsWith("feature.")) {
111  Feature f = Feature.valueOf(k.replace("feature.", "").toUpperCase());
112  if (props.get(k).equals("enabled")) {
113  disabledFeatures.remove(f);
114  } else if (props.get(k).equals("disabled")) {
115  disabledFeatures.add(f);
116  }
117  }
118  }
119  } catch (Exception e) {
120  throw new RuntimeException(e);
121  }
122  }
final ProfileValue profile
Definition: Profile.java:72
final Set< Feature > disabledFeatures
Definition: Profile.java:74
List< Feature > disabled
Definition: Profile.java:61
final ProductValue product
Definition: Profile.java:70
RHSSO
Definition: Profile.java:47
List< Feature > excluded
Definition: Profile.java:49

関数詳解

◆ getDisabledFeatures()

static Set<Feature> org.keycloak.common.Profile.getDisabledFeatures ( )
inlinestatic
128  {
129  return CURRENT.disabledFeatures;
130  }
final Set< Feature > disabledFeatures
Definition: Profile.java:74
static final Profile CURRENT
Definition: Profile.java:68

◆ getName()

static String org.keycloak.common.Profile.getName ( )
inlinestatic
124  {
125  return CURRENT.profile.name().toLowerCase();
126  }
final ProfileValue profile
Definition: Profile.java:72
static final Profile CURRENT
Definition: Profile.java:68

◆ isFeatureEnabled()

static boolean org.keycloak.common.Profile.isFeatureEnabled ( Feature  feature)
inlinestatic
132  {
133  if (CURRENT.product.excluded.contains(feature)) {
134  return false;
135  }
136  return !CURRENT.disabledFeatures.contains(feature);
137  }
final Set< Feature > disabledFeatures
Definition: Profile.java:74
final ProductValue product
Definition: Profile.java:70
List< Feature > excluded
Definition: Profile.java:49
static final Profile CURRENT
Definition: Profile.java:68

メンバ詳解

◆ CURRENT

final Profile org.keycloak.common.Profile.CURRENT = new Profile()
staticprivate

◆ disabledFeatures

final Set<Feature> org.keycloak.common.Profile.disabledFeatures = new HashSet<>()
private

◆ product

final ProductValue org.keycloak.common.Profile.product
private

◆ profile

final ProfileValue org.keycloak.common.Profile.profile
private

このクラス詳解は次のファイルから抽出されました: