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

静的公開メンバ関数

static void migrate (KeycloakSession session)
 
static void migrateImport (KeycloakSession session, RealmModel realm, RealmRepresentation rep, boolean skipUserDependent)
 

静的公開変数類

static final ModelVersion RHSSO_VERSION_7_0_KEYCLOAK_VERSION = new ModelVersion("1.9.8")
 
static final ModelVersion RHSSO_VERSION_7_1_KEYCLOAK_VERSION = new ModelVersion("2.5.0")
 
static final ModelVersion RHSSO_VERSION_7_2_KEYCLOAK_VERSION = new ModelVersion("3.4.2")
 

静的非公開変数類

static Logger logger = Logger.getLogger(MigrationModelManager.class)
 
static final Migration [] migrations
 

詳解

著者
Bill Burke
バージョン
Revision
1

関数詳解

◆ migrate()

static void org.keycloak.migration.MigrationModelManager.migrate ( KeycloakSession  session)
inlinestatic
80  {
81  ModelVersion latest = migrations[migrations.length-1].getVersion();
82  MigrationModel model = session.realms().getMigrationModel();
83  ModelVersion stored = null;
84  if (model.getStoredVersion() != null) {
85  stored = new ModelVersion(model.getStoredVersion());
86  if (latest.equals(stored)) {
87  return;
88  }
89  }
90 
91  for (Migration m : migrations) {
92  if (stored == null || stored.lessThan(m.getVersion())) {
93  if (stored != null) {
94  logger.debugf("Migrating older model to %s", m.getVersion());
95  }
96  m.migrate(session);
97  }
98  }
99 
100  model.setStoredVersion(latest.toString());
101  }
static Logger logger
Definition: MigrationModelManager.java:53
static final Migration [] migrations
Definition: MigrationModelManager.java:55

◆ migrateImport()

static void org.keycloak.migration.MigrationModelManager.migrateImport ( KeycloakSession  session,
RealmModel  realm,
RealmRepresentation  rep,
boolean  skipUserDependent 
)
inlinestatic
108  {
109  ModelVersion latest = migrations[migrations.length-1].getVersion();
110  ModelVersion stored = migrations[0].getVersion();
111  if (rep.getKeycloakVersion() != null) {
112  stored = new ModelVersion(rep.getKeycloakVersion());
113  // hack for importing RH-SSO json export
114  // NOTE!!!!! We need to do something once we reach community version 7. If community version is 7 or higher, look for the GA qualifier to identify it as RH SSO
115  if (latest.getMajor() < 7 || (stored.getMajor() == 7 && stored.getQualifier().equals("GA"))) {
116  if (stored.getMajor() == 7) {
117  if (stored.getMinor() == 0) {
119  } else if (stored.getMinor() == 1) {
121  } else if (stored.getMinor() == 2) {
123  }
124  }
125  }
126  // strip out qualifier
127  stored = new ModelVersion(stored.major, stored.minor, stored.micro);
128  if (latest.equals(stored) || latest.lessThan(stored)) {
129  return;
130  }
131  }
132 
133  for (Migration m : migrations) {
134  if (stored == null || stored.lessThan(m.getVersion())) {
135  if (stored != null) {
136  logger.debugf("Migrating older json representation to %s", m.getVersion());
137  }
138  try {
139  m.migrateImport(session, realm, rep, skipUserDependent);
140  } catch (Exception e) {
141  logger.error("Failed to migrate json representation for version: " + m.getVersion(), e);
142  }
143  }
144  }
145  }
static Logger logger
Definition: MigrationModelManager.java:53
static final ModelVersion RHSSO_VERSION_7_2_KEYCLOAK_VERSION
Definition: MigrationModelManager.java:105
static final ModelVersion RHSSO_VERSION_7_1_KEYCLOAK_VERSION
Definition: MigrationModelManager.java:104
static final ModelVersion RHSSO_VERSION_7_0_KEYCLOAK_VERSION
Definition: MigrationModelManager.java:103
static final Migration [] migrations
Definition: MigrationModelManager.java:55

メンバ詳解

◆ logger

Logger org.keycloak.migration.MigrationModelManager.logger = Logger.getLogger(MigrationModelManager.class)
staticprivate

◆ migrations

final Migration [] org.keycloak.migration.MigrationModelManager.migrations
staticprivate
初期値:
= {
new MigrateTo1_2_0(),
new MigrateTo1_3_0(),
new MigrateTo1_4_0(),
new MigrateTo1_5_0(),
new MigrateTo1_6_0(),
new MigrateTo1_7_0(),
new MigrateTo1_8_0(),
new MigrateTo1_9_0(),
new MigrateTo1_9_2(),
new MigrateTo2_0_0(),
new MigrateTo2_1_0(),
new MigrateTo2_2_0(),
new MigrateTo2_3_0(),
new MigrateTo2_5_0(),
new MigrateTo3_0_0(),
new MigrateTo3_1_0(),
new MigrateTo3_2_0(),
new MigrateTo3_4_0(),
new MigrateTo3_4_1(),
new MigrateTo3_4_2(),
new MigrateTo4_0_0(),
new MigrateTo4_2_0()
}

◆ RHSSO_VERSION_7_0_KEYCLOAK_VERSION

final ModelVersion org.keycloak.migration.MigrationModelManager.RHSSO_VERSION_7_0_KEYCLOAK_VERSION = new ModelVersion("1.9.8")
static

◆ RHSSO_VERSION_7_1_KEYCLOAK_VERSION

final ModelVersion org.keycloak.migration.MigrationModelManager.RHSSO_VERSION_7_1_KEYCLOAK_VERSION = new ModelVersion("2.5.0")
static

◆ RHSSO_VERSION_7_2_KEYCLOAK_VERSION

final ModelVersion org.keycloak.migration.MigrationModelManager.RHSSO_VERSION_7_2_KEYCLOAK_VERSION = new ModelVersion("3.4.2")
static

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