Search in sources :

Example 6 with IdRepoListener

use of com.sun.identity.idm.IdRepoListener in project OpenAM by OpenRock.

the class AMSDKRepo method notifyAllObjectsChangedEvent.

public static void notifyAllObjectsChangedEvent() {
    if (debug.messageEnabled()) {
        debug.message("AMSDKRepo.notifyAllObjectsChangedEvent -  Sending " + "event to listeners.");
    }
    synchronized (listeners) {
        Iterator it = listeners.iterator();
        while (it.hasNext()) {
            IdRepoListener l = (IdRepoListener) it.next();
            l.allObjectsChanged();
        }
    }
}
Also used : IdRepoListener(com.sun.identity.idm.IdRepoListener) Iterator(java.util.Iterator)

Example 7 with IdRepoListener

use of com.sun.identity.idm.IdRepoListener in project OpenAM by OpenRock.

the class IdRepoPluginsCache method getAMRepoPlugin.

protected IdRepo getAMRepoPlugin(String orgName) throws SSOException, IdRepoException {
    IdRepo pluginClass = null;
    try {
        if (debug.messageEnabled()) {
            debug.message("AMSDK repo being initialized");
        }
        Class thisClass = Thread.currentThread().getContextClassLoader().loadClass(IdConstants.AMSDK_PLUGIN);
        pluginClass = (IdRepo) thisClass.newInstance();
        Map amsdkConfig = new HashMap();
        Set vals = new HashSet();
        vals.add(DNMapper.realmNameToAMSDKName(orgName));
        amsdkConfig.put("amSDKOrgName", vals);
        pluginClass.initialize(amsdkConfig);
    } catch (Exception e) {
        debug.error("IdRepoPluginsCache.getAMRepoPlugin: " + "Unable to instantiate plugin for Org: " + orgName, e);
    }
    if (pluginClass != null) {
        // Add listener to this plugin class
        Map listenerConfig = new HashMap();
        listenerConfig.put("realm", orgName);
        listenerConfig.put("amsdk", "true");
        IdRepoListener lter = new IdRepoListener();
        lter.setConfigMap(listenerConfig);
        pluginClass.addListener(getAdminToken(), lter);
    }
    return pluginClass;
}
Also used : IdRepoListener(com.sun.identity.idm.IdRepoListener) HashSet(java.util.HashSet) Set(java.util.Set) OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) IdRepo(com.sun.identity.idm.IdRepo) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) IdRepoException(com.sun.identity.idm.IdRepoException) SMSException(com.sun.identity.sm.SMSException) SSOException(com.iplanet.sso.SSOException) HashSet(java.util.HashSet)

Example 8 with IdRepoListener

use of com.sun.identity.idm.IdRepoListener in project OpenAM by OpenRock.

the class IdRepoPluginsCache method getSpecialRepoPlugin.

// Internal repos
private IdRepo getSpecialRepoPlugin() throws SSOException, IdRepoException {
    // Valid only for root realm
    IdRepo pluginClass = null;
    try {
        if (debug.messageEnabled()) {
            debug.message("Special repo being initialized");
        }
        Class thisClass = Thread.currentThread().getContextClassLoader().loadClass(IdConstants.SPECIAL_PLUGIN);
        pluginClass = (IdRepo) thisClass.newInstance();
        HashMap config = new HashMap(2);
        config.put("realm", ServiceManager.getBaseDN());
        pluginClass.initialize(config);
        IdRepoListener lter = new IdRepoListener();
        lter.setConfigMap(config);
        pluginClass.addListener(getAdminToken(), lter);
    } catch (Exception e) {
        debug.error("IdRepoPluginsCache.getSpecialRepoPlugin: " + "Unable to init plugin: " + IdConstants.SPECIAL_PLUGIN, e);
    }
    return pluginClass;
}
Also used : IdRepoListener(com.sun.identity.idm.IdRepoListener) IdRepo(com.sun.identity.idm.IdRepo) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) IdRepoException(com.sun.identity.idm.IdRepoException) SMSException(com.sun.identity.sm.SMSException) SSOException(com.iplanet.sso.SSOException)

Aggregations

IdRepoListener (com.sun.identity.idm.IdRepoListener)8 HashMap (java.util.HashMap)6 Map (java.util.Map)5 SSOException (com.iplanet.sso.SSOException)4 IdRepo (com.sun.identity.idm.IdRepo)4 IdRepoException (com.sun.identity.idm.IdRepoException)4 LinkedHashMap (java.util.LinkedHashMap)4 SMSException (com.sun.identity.sm.SMSException)3 HashSet (java.util.HashSet)3 Set (java.util.Set)3 OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)2 Iterator (java.util.Iterator)2 CaseInsensitiveHashMap (com.sun.identity.common.CaseInsensitiveHashMap)1 AMIdentity (com.sun.identity.idm.AMIdentity)1 IdType (com.sun.identity.idm.IdType)1 GuiceModuleLoader (org.forgerock.guice.core.GuiceModuleLoader)1 DN (org.forgerock.opendj.ldap.DN)1 MemoryBackend (org.forgerock.opendj.ldap.MemoryBackend)1 LDIFEntryReader (org.forgerock.opendj.ldif.LDIFEntryReader)1 BeforeClass (org.testng.annotations.BeforeClass)1