PluginConfigImpl.java revision 083ce1f7c46d83d177124cf39bf2e25b15c70745
/**
* 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: PluginConfigImpl.java,v 1.5 2008/07/11 01:46:21 arviranga Exp $
*
* Portions Copyrighted 2011-2016 ForgeRock AS.
*/
/**
* The class <code>PluginConfigImpl</code> provides interfaces to read the
* plugin configuration information of a service.
*/
private PluginSchemaImpl ps;
private boolean newEntry;
private int priority;
private Map attributes;
private CachedSMSEntry smsEntry;
/**
* Private constructor
*/
smsEntry.addServiceListener(this);
// Read the attributes
} else {
update();
}
}
/**
* Returns the organization name
*/
return (orgName);
}
/**
* Returns the priority assigned to the service configuration.
*/
int getPriority() {
return (priority);
}
/**
* Returns the service configuration parameters. The keys in the
* <code>Map</code> contains the attribute names and their corresponding
* values in the <code>Map</code> is a <code>Set</code> that contains
* the values for the attribute.
*/
Map getAttributes() {
// Read the entry, since it should not be cached
}
}
/**
* Returns the DN associated with this entry
*/
}
/**
* Returns the SMSEntry associated with this object
*/
SMSEntry getSMSEntry() {
return (smsEntry.getClonedSMSEntry());
}
/**
* Updates the SMSEntry with the new changes
*/
}
/**
* Returns the PluginSchemaImpl assicated with this object
*/
return (ps);
}
/**
* Checks if the entry exists in the directory
*/
boolean isNewEntry() {
return (newEntry);
}
// Gets calls by local changes and also by notifications threads
// Hence synchronized to avoid data corruption
public synchronized void update() {
// Get the SMSEntry
// Read the attributes
// Add default values, if attribute not present
// and decrypt password attributes
.next());
}
// Read the priority
priority = 0;
if (priorities != null) {
try {
} catch (NumberFormatException nfe) {
}
}
}
boolean isValid() {
}
}
void clear() {
// Deregister from CachedSMSEntry
smsEntry.removeServiceListener(this);
}
}
// ------------------------------------------------------------------
// Static Protected method to get an instance of ServiceConfigImpl
// ------------------------------------------------------------------
if (debug.messageEnabled()) {
}
// Check in cache
// Read the entry, since it should not be cached
}
return (answer);
}
// Check if the orgName exists
if (!SMSEntry.checkIfEntryExists(
// Object [] args = { orgName };
// throw (new SMSException(IUMSConstants.UMS_BUNDLE_NAME,
// "sms-invalid-org-name", args));
return (null);
}
// Construct the PluginConfigImpl object
synchronized (configImpls) {
// Check the cache again, in case it was added by another thread
token);
}
}
if (debug.messageEnabled()) {
}
return (answer);
}
// Clears the cache
static void clearCache() {
synchronized (configImpls) {
}
configImpls.clear();
}
}
}
// CachedSMSEntry is invalid, so create a new PluginConfigImpl
// by clearing cache and setting this one to null
}
// Check if the user has permissions
// Check if Principal has permission to read the entry
}
}
return (answer);
}
static synchronized CachedSMSEntry checkAndUpdatePermission(
if (sudoPrincipals == null) {
}
return (answer);
}
new HashMap());
new HashMap());
}