/**
* 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: ServiceConfigImpl.java,v 1.15 2008/10/14 04:57:20 arviranga Exp $
*
* Portions Copyrighted 2012-2016 ForgeRock AS.
* Portions Copyrighted 2012 Open Source Solution Technology Corporation
*/
/**
* The class <code>ServiceConfigImpl</code> provides interfaces to read the
* configuration information of a service configuration. It provides methods to
* get configuration parameters for this service configuration.
*/
// Static variables
// Schema manager to register for schema changes
private boolean globalConfig;
private int priority;
/**
* Private constructor
*/
// Add listener for changes to the entry
smsEntry.addServiceListener(this);
// Add this object as a listener to schema changes in this service.
// Update instance variables
this.compName = "";
serviceComponentName = "/";
} else {
}
this.globalConfig = globalConfig;
// Read the attributes
} else {
update();
}
}
/**
* Returns the component name
*/
return (serviceComponentName);
}
/**
* Returns this instance's name
*/
return compName;
}
/**
* Returns the configuration's schema ID
*/
return (configID);
}
/**
* Returns the group name
*/
return (groupName);
}
/**
* Returns the organization name
*/
return (orgName);
}
/**
* Returns the priority assigned to the service configuration.
*/
int getPriority() {
return (priority);
}
/**
* Returns the labeled uri assigned to the service configuration.
*/
return (labeledUri);
}
this.labeledUri = labeledUri;
}
/**
* Returns the names of all service's sub-configurations.
*/
if (subEntries == null) {
}
return (subEntries.getSubEntries(t));
}
/**
* Returns the names of service's sub-configurations that match the given
* pattern.
*/
if (subEntries == null) {
}
return getSubConfigNames(t);
}
}
/**
* Returns the names of service's sub-configurations that match the given
* pattern.
*/
throws SMSException, SSOException {
if (subEntries == null) {
}
}
/**
* Returns the service's sub-configuration given the service's
* sub-configuration name.
*/
throws SSOException, SMSException {
// Construct subconfig DN
// Construct ServiceConfigImpl
}
/**
* 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.
*/
if (!SMSEntry.cacheSMSEntries) {
// Read the entry, since it should not be cached
}
}
/**
* Returns the service configuration parameters for read only.
* 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.
*/
if (!SMSEntry.cacheSMSEntries) {
// Read the entry, since it should not be cached
}
return (attributes);
}
/**
* 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. attributes returned by this method are the
* ones which do not include default values from the service schema
*/
if (!SMSEntry.cacheSMSEntries) {
// Read the entry, since it should not be cached
}
}
/**
* Returns the service configuration parameters for read only.
* 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.
* attributes returned by this method are the ones which do not
* include default values from the service schema
*/
if (!SMSEntry.cacheSMSEntries) {
// Read the entry, since it should not be cached
}
return (attributesWithoutDefaults);
}
/**
* Returns the DN associated with this entry
*/
}
/**
* Returns the SMSEntry associated with this object
*/
return (smsEntry.getClonedSMSEntry());
}
/**
* Updates the SMSEntry with the new changes
*/
}
/**
* Returns the ServiceSchemaImpl assicated with this object
*/
return (ss);
}
/**
* Checks if the entry exists in the directory
*/
boolean isNewEntry() {
return (smsEntry.isNewEntry());
}
/**
* Checks if the entry is still valid
*/
boolean isValid() {
// check if ServiceSchemaImpl is stale
return false;
}
}
}
/**
* Clears the instance variables and deregisters notifications
*/
void clear() {
// Deregister from CachedSMSEntry
smsEntry.removeServiceListener(this);
// Invalidate CachedSMSEntry
}
// Deregister from ServiceSchemaManagerImpl
try {
}
}
}
// @Override
public int hashCode() {
int hash = 5;
return hash;
}
if (scio instanceof ServiceConfigImpl) {
if ((s.globalConfig == globalConfig) &&
return true;
}
}
return (false);
}
// Method gets called by local changes and also by changes from
// notification thread. Hence it synchornized to avoid data being
// corrupted
synchronized void update() {
// Check if entry is still valid
// Entry has to be removed from cache and cleared
clear();
return;
}
// Get the SMSEntry
// Read the attributes
// Add default values, if attribute not present
// and decrypt password attributes
// Remove attributes that do not exist in the schema.
// attributes.remove(tName);
// attributesWithoutDefaults.remove(tName);
}
}
origAttributes.remove(t);
}
.next());
}
} // if (validate....)
// Read the priority
priority = 0;
if (priorities != null) {
try {
} catch (NumberFormatException nfe) {
}
}
// Read the service ID
} else {
}
// Read the labeled uri
}
// Replace the class instance attribute Maps
}
// ------------------------------------------------------------------
// Static Protected method to get an instance of ServiceConfigImpl
// ------------------------------------------------------------------
// Method called by ServiceConfigManagerImpl to Global or Organization
// service configuration
globalConfig, null);
}
// Method called by ServiceConfig to get sub-service configuration
throws SSOException, SMSException {
if (debug.messageEnabled()) {
}
// Get required parameters
// Check cache for the object, if present return
// If present, Cache checks if the object is valid and if dirty
// refreshes the object
// Check if the entry has to be updated
if (!SMSEntry.cacheSMSEntries) {
// Read the entry, since it should not be cached
}
return (answer);
}
// Since entry not in cache, first check if the orgName exists
"non existant organization name: " + orgName);
// To maintain backward compatibilty return null if orgName
// is not found. Throwing exception is commented out.
// Object [] args = { orgName };
// throw (new SMSException(IUMSConstants.UMS_BUNDLE_NAME,
// "sms-invalid-org-name", args));
return (null);
}
// Not in cache and org exists, construct SMSEntry object
}
// Since entry not in cache, check if service schema exists
// Need to get the sub-schema name
} else {
// Get configId from sub config name
}
// Get the schema from the parent
}
// Return null if schema is not defined
// SMSEntry shouldn't exist in this case, but if it does, it is most
// likely to be incorrect, hence we remove it from the cache.
if (debug.messageEnabled()) {
}
return (null);
}
}
try {
}
} finally {
}
}
if (debug.messageEnabled()) {
}
return answer;
}
// Method called by ServiceConfig to delete sub-service configuration
// key from the cache when removeSubConfig is called.
throws SSOException, SMSException {
if (debug.messageEnabled()) {
+ " Component Name: "+ compName);
}
// Get required parameters
if (debug.messageEnabled()) {
}
// Delete from cache if it exists.
if (debug.messageEnabled()) {
}
}
// This function is executed after obtaining "configMutex" lock
throws SMSException, SSOException {
}
}
// Check if the user has permissions
if ((principals == null) ||
// Principal name not in cache, need to check perm
}
}
return (answer);
}
throws SMSException, SSOException {
if (sudoPrincipals == null) {
}
return (answer);
}
// Clears the cache
static void clearCache() {
}
}
}
/*
* (non-Javadoc)
*
* @see com.sun.identity.sm.ServiceListener#globalConfigChanged(
* java.lang.String,
* java.lang.String, java.lang.String, java.lang.String, int)
*/
// do nothing, the update method for this is called by the internal
// notification mechanism in CachedSMSEntry
}
/*
* (non-Javadoc)
*
* @see com.sun.identity.sm.ServiceListener#organizationConfigChanged(
* java.lang.String,
* java.lang.String, java.lang.String, java.lang.String,
* java.lang.String, int)
*/
// do nothing. Same as "globalConfigChanged"
}
/*
* (non-Javadoc)
*
* @see com.sun.identity.sm.ServiceListener#schemaChanged(java.lang.String,
* java.lang.String)
*/
update();
}
}
) throws SMSException, SSOException {
}
) throws SMSException, SSOException {
}
if (((attributesWithoutDefaults == null) ||
((serviceConfigNames == null) ||
serviceConfigNames.isEmpty()) &&
) {
return "";
}
) {
}
}
) {
if ((organizationName != null) &&
) {
}
}
}
}
if (priority > 0) {
}
}
}
}
}
.append(">\n");
.append(">\n");
}
}
}