Search in sources :

Example 1 with SynchronizationMBean

use of org.apache.jackrabbit.oak.spi.security.authentication.external.impl.jmx.SynchronizationMBean in project jackrabbit-oak by apache.

the class ListIdentitiesTest method beforeSuite.

@Override
protected void beforeSuite() throws Exception {
    super.beforeSuite();
    SynchronizationMBean bean = new SyncMBeanImpl(getContentRepository(), getSecurityProvider(), syncManager, "default", idpManager, idp.getName());
    bean.syncAllExternalUsers();
}
Also used : SynchronizationMBean(org.apache.jackrabbit.oak.spi.security.authentication.external.impl.jmx.SynchronizationMBean) SyncMBeanImpl(org.apache.jackrabbit.oak.spi.security.authentication.external.impl.jmx.SyncMBeanImpl)

Example 2 with SynchronizationMBean

use of org.apache.jackrabbit.oak.spi.security.authentication.external.impl.jmx.SynchronizationMBean in project jackrabbit-oak by apache.

the class ExternalLoginModuleFactory method mayRegisterSyncMBean.

private void mayRegisterSyncMBean() {
    log.debug("Trying to register SynchronizationMBean");
    if (mbeanRegistration != null) {
        log.debug("SynchronizationMBean already registered");
        return;
    }
    if (bundleContext == null) {
        log.debug("Cannot register SynchronizationMBean; not yet activated.");
        return;
    }
    if (contentRepository == null || securityProvider == null) {
        log.debug("Cannot register SynchronizationMBean; waiting for references to ContentRepository|SecurityProvider.");
        return;
    }
    Whiteboard whiteboard = new OsgiWhiteboard(bundleContext);
    try {
        log.debug("Registering SynchronizationMBean");
        String idpName = osgiConfig.getConfigValue(PARAM_IDP_NAME, "");
        String sncName = osgiConfig.getConfigValue(PARAM_SYNC_HANDLER_NAME, "");
        SyncMBeanImpl bean = new SyncMBeanImpl(contentRepository, securityProvider, syncManager, sncName, idpManager, idpName);
        Hashtable<String, String> table = new Hashtable();
        table.put("type", "UserManagement");
        table.put("name", "External Identity Synchronization Management");
        table.put("handler", ObjectName.quote(sncName));
        table.put("idp", ObjectName.quote(idpName));
        mbeanRegistration = whiteboard.register(SynchronizationMBean.class, bean, ImmutableMap.of("jmx.objectname", new ObjectName("org.apache.jackrabbit.oak", table)));
        log.debug("Registration of SynchronizationMBean completed");
    } catch (MalformedObjectNameException e) {
        log.error("Unable to register SynchronizationMBean", e);
    }
}
Also used : MalformedObjectNameException(javax.management.MalformedObjectNameException) OsgiWhiteboard(org.apache.jackrabbit.oak.osgi.OsgiWhiteboard) Hashtable(java.util.Hashtable) SynchronizationMBean(org.apache.jackrabbit.oak.spi.security.authentication.external.impl.jmx.SynchronizationMBean) Whiteboard(org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard) OsgiWhiteboard(org.apache.jackrabbit.oak.osgi.OsgiWhiteboard) SyncMBeanImpl(org.apache.jackrabbit.oak.spi.security.authentication.external.impl.jmx.SyncMBeanImpl) ObjectName(javax.management.ObjectName)

Aggregations

SyncMBeanImpl (org.apache.jackrabbit.oak.spi.security.authentication.external.impl.jmx.SyncMBeanImpl)2 SynchronizationMBean (org.apache.jackrabbit.oak.spi.security.authentication.external.impl.jmx.SynchronizationMBean)2 Hashtable (java.util.Hashtable)1 MalformedObjectNameException (javax.management.MalformedObjectNameException)1 ObjectName (javax.management.ObjectName)1 OsgiWhiteboard (org.apache.jackrabbit.oak.osgi.OsgiWhiteboard)1 Whiteboard (org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard)1