private PartitionManager createEmbeddedPartitionManager() { if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf("Creating PartitionManager."); } List<IdentityConfiguration> identityConfiguration = this.identityManagementConfiguration.getIdentityConfiguration(); PartitionManager partitionManager = new DefaultPartitionManager(identityConfiguration, this.eventBridge, getPermissionHandlers()); this.eventBridge.fireEvent(new PartitionManagerCreateEvent(partitionManager)); createDefaultPartition(partitionManager); return partitionManager; }
@Inject public void init() { if (this.partitionManager != null) { throw new RuntimeException("Identity Management Subsystem already initialized."); } if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf("Initializing Identity Management Subsystem."); } if (!this.partitionManagerInstance.isUnsatisfied()) { this.partitionManager = this.partitionManagerInstance.get(); if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf("PartitionManager provided by the application."); } } else { this.partitionManager = createEmbeddedPartitionManager(); } }
private void createDefaultPartition(PartitionManager partitionManager) { Realm defaultPartition = null; if (isPartitionSupported(partitionManager)) { if (partitionManager.getPartitions(Partition.class).isEmpty()) { if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf("Creating default partition using [%s] and name [%s].", Realm.class, Realm.DEFAULT_REALM); } defaultPartition = new Realm(Realm.DEFAULT_REALM); try { partitionManager.add(defaultPartition); } catch (Exception e) { throw new RuntimeException("Could not create default partition. If you're using the JPA identity store, check if there is an active transaction.", e); } } else { if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf("Found existing partitions. The default partition was not created."); } } } if (defaultPartition == null) { ROOT_LOGGER .warn("No default partition was created. You may want to create one before start managing your identity types."); } }
private void createDefaultPartition(PartitionManager partitionManager) { Realm defaultPartition = null; if (isPartitionSupported(partitionManager)) { if (partitionManager.getPartitions(Partition.class).isEmpty()) { if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf("Creating default partition using [%s] and name [%s].", Realm.class, Realm.DEFAULT_REALM); } defaultPartition = new Realm(Realm.DEFAULT_REALM); try { partitionManager.add(defaultPartition); } catch (Exception e) { throw new RuntimeException("Could not create default partition. If you're using the JPA identity store, check if there is an active transaction.", e); } } else { if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf("Found existing partitions. The default partition was not created."); } } } if (defaultPartition == null) { ROOT_LOGGER .warn("No default partition was created. You may want to create one before start managing your identity types."); } }
private PartitionManager createEmbeddedPartitionManager() { if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf("Creating PartitionManager."); } List<IdentityConfiguration> identityConfiguration = this.identityManagementConfiguration.getIdentityConfiguration(); PartitionManager partitionManager = new DefaultPartitionManager(identityConfiguration, this.eventBridge, getPermissionHandlers()); this.eventBridge.fireEvent(new PartitionManagerCreateEvent(partitionManager)); createDefaultPartition(partitionManager); return partitionManager; }
@Inject public void init() { if (this.partitionManager != null) { throw new RuntimeException("Identity Management Subsystem already initialized."); } if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf("Initializing Identity Management Subsystem."); } if (!this.partitionManagerInstance.isUnsatisfied()) { this.partitionManager = this.partitionManagerInstance.get(); if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf("PartitionManager provided by the application."); } } else { this.partitionManager = createEmbeddedPartitionManager(); } }
private void createDefaultPartition(PartitionManager partitionManager) { Realm defaultPartition = null; if (isPartitionSupported(partitionManager)) { if (partitionManager.getPartitions(Partition.class).isEmpty()) { if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf("Creating default partition using [%s] and name [%s].", Realm.class, Realm.DEFAULT_REALM); } defaultPartition = new Realm(Realm.DEFAULT_REALM); try { partitionManager.add(defaultPartition); } catch (Exception e) { throw new RuntimeException("Could not create default partition. If you're using the JPA identity store, check if there is an active transaction.", e); } } else { if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf("Found existing partitions. The default partition was not created."); } } } if (defaultPartition == null) { ROOT_LOGGER .warn("No default partition was created. You may want to create one before start managing your identity types."); } }
private PartitionManager createEmbeddedPartitionManager() { if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf("Creating PartitionManager."); } List<IdentityConfiguration> identityConfiguration = this.identityManagementConfiguration.getIdentityConfiguration(); PartitionManager partitionManager = new DefaultPartitionManager(identityConfiguration, this.eventBridge, getPermissionHandlers()); this.eventBridge.fireEvent(new PartitionManagerCreateEvent(partitionManager)); createDefaultPartition(partitionManager); return partitionManager; }
@Inject public void init() { if (this.partitionManager != null) { throw new RuntimeException("Identity Management Subsystem already initialized."); } if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf("Initializing Identity Management Subsystem."); } if (!this.partitionManagerInstance.isUnsatisfied()) { this.partitionManager = this.partitionManagerInstance.get(); if (ROOT_LOGGER.isDebugEnabled()) { ROOT_LOGGER.debugf("PartitionManager provided by the application."); } } else { this.partitionManager = createEmbeddedPartitionManager(); } }