/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: IdRepoListener.java,v 1.16 2009/01/28 05:34:59 ww203982 Exp $
*
* Portions Copyrighted 2011-2016 ForgeRock AS.
*/
/**
* Provides methods that can be called by IdRepo plugins to notify change
* events. Used to update cache and also to send notifications to registered
* listeners. Each IdRepo plugin will be given a unique instance of this object.
*
* Additionally, this class maintains the configuration data for the IdRepo
* plugin and also to store the SMS Service attributes for the organization.
*
* @supported.all.api
*/
public final class IdRepoListener {
// Configuration data for the IdRepo plugin
// Must have "realm" key to correctly send the notifications to clients
// Listener registed by JAXRPC Impl to send notifications
// To serialize and deserialize configMap
// Configured Identity Types
// Flags to check if caching is enabled and to clear them
private static boolean cacheChecked;
private static boolean cacheEnabled;
/*
* (non-Javadoc)
*
* @see com.iplanet.am.sdk.AMObjectListener#allObjectsChanged()
*/
public void allObjectsChanged() {
if (debug.messageEnabled()) {
}
// Check if caching is enabled
if (!cacheChecked) {
if (idServices instanceof IdCachedServices) {
// If Caching was enabled - then clear the cache!!
cacheEnabled = true;
}
cacheChecked = true;
}
if (cacheEnabled) {
// If Caching was enabled - then clear the cache!!
}
// Get the list of listeners setup with idRepo
// Update any listeners registered with IdRepo
for (int j = 0; j < size; j++) {
l.allIdentitiesChanged();
}
}
if (remoteListener != null) {
}
}
/**
*
* This method has been deprecated as of OpenSSO Enterprise 8.0.
*
* @param name name of the identity that changed
* @param type change type i.e., add, delete, modify, etc.
* @param cMap configuration map that contains realm and plugin-name
*
* @deprecated As of Sun Java System Access Manager 7.1.
*/
}
/**
* Notification mechanism for IdRepo plugins to specify the identiy name
* and identity type that has been changed.
*
* @param name name of the identity that changed
* @param idType IdType i.e., user, group, etc.
* @param changeType change type i.e., add, delete, modify, etc.
* @param cMap configuration map that contains realm and plugin-name
*/
if (debug.messageEnabled()) {
"\nConfigmap = " + cMap);
}
// Get the list of listeners setup with idRepo
if (remoteListener != null) {
}
// Check if caching is enabled
if (!cacheChecked) {
if (idServices instanceof IdCachedServices) {
// If Caching was enabled - then clear the cache!!
cacheEnabled = true;
}
cacheChecked = true;
}
if (cacheEnabled) {
}
for (IdEventListener l : list) {
// Update any listeners registered with IdRepo
l.identityChanged(changed[i]);
} else if (changeType == OBJECT_REMOVED) {
l.identityDeleted(changed[i]);
} else if (changeType == OBJECT_RENAMED) {
l.identityRenamed(changed[i]);
}
}
}
} else if (debug.warningEnabled()) {
}
}
remoteListener = l;
}
/*
* Returns the configurations for the IdRepo plugins
*/
return configMap;
}
/*
* Maintains the configurations for the IdRepo plugins
*/
}
/**
* Stores service's dynamic attributes within the IdRepo plugin
* configuration. In the current implementation changes to dynamic
* attributes to LDAPv3Repo restart the plugin, since it triggers
* a configuration change notification.
*
* @param sName service name for which attributes are being set
* @param attrs service synamic attributes
* @throws com.sun.identity.idm.IdRepoException
*/
throws IdRepoException {
"IdRepoListener.setServiveAttribute: realm or plugin name"
+ " is null");
throw new IdRepoException(IdRepoBundle.BUNDLE_NAME, IdRepoErrorCode.SERVICE_ALREADY_ASSIGNED, args);
}
try {
return;
}
return;
}
}
}
} catch (SMSException smse) {
"IdRepoListener: Unable to set service attributes", smse);
throw new IdRepoException(IdRepoBundle.BUNDLE_NAME, IdRepoErrorCode.SERVICE_ALREADY_ASSIGNED, args);
} catch (SSOException ssoe) {
"IdRepoListener: Unable to set service attributes", ssoe);
throw new IdRepoException(IdRepoBundle.BUNDLE_NAME, IdRepoErrorCode.SERVICE_ALREADY_ASSIGNED, args);
}
}
// If configMap is null, then this is a "remote" cache update
// Name should be the universal id
} else {
// Default to user
}
}
return ct;
}
if (defaultIdTypes == null) {
}
} else {
}
if (isAmsdk) {
}
changedTypes[i] = id;
}
return changedTypes;
}
// Constants for change type recevied from the IdRepo plugins
/**
* Represents an object addition event type.
*/
/**
* Represents an object change event type.
*/
/**
* Represents an object removal event type.
*/
/**
* Represents an object renaming event type.
*/
}