| | |
| | | */ |
| | | package org.opends.server.config; |
| | | |
| | | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.concurrent.ConcurrentMap; |
| | | import java.util.concurrent.CopyOnWriteArrayList; |
| | | |
| | | import org.opends.messages.Message; |
| | |
| | | import org.opends.server.api.ConfigDeleteListener; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeBuilder; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.ObjectClass; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.*; |
| | | |
| | | import static org.opends.messages.ConfigMessages.*; |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class defines a configuration entry, which can hold zero or more |
| | | * attributes that may control the configuration of various components of the |
| | |
| | | |
| | | |
| | | |
| | | // The set of immediate children for this configuration entry. |
| | | private ConcurrentHashMap<DN,ConfigEntry> children; |
| | | /** The set of immediate children for this configuration entry. */ |
| | | private final ConcurrentMap<DN,ConfigEntry> children; |
| | | |
| | | // The immediate parent for this configuration entry. |
| | | /** The immediate parent for this configuration entry. */ |
| | | private ConfigEntry parent; |
| | | |
| | | // The set of add listeners that have been registered with this entry. |
| | | private CopyOnWriteArrayList<ConfigAddListener> addListeners; |
| | | /** The set of add listeners that have been registered with this entry. */ |
| | | private final CopyOnWriteArrayList<ConfigAddListener> addListeners; |
| | | |
| | | // The set of change listeners that have been registered with this entry. |
| | | private CopyOnWriteArrayList<ConfigChangeListener> changeListeners; |
| | | /** The set of change listeners that have been registered with this entry. */ |
| | | private final CopyOnWriteArrayList<ConfigChangeListener> changeListeners; |
| | | |
| | | // The set of delete listeners that have been registered with this entry. |
| | | private CopyOnWriteArrayList<ConfigDeleteListener> deleteListeners; |
| | | /** The set of delete listeners that have been registered with this entry. */ |
| | | private final CopyOnWriteArrayList<ConfigDeleteListener> deleteListeners; |
| | | |
| | | // The actual entry wrapped by this configuration entry. |
| | | /** The actual entry wrapped by this configuration entry. */ |
| | | private Entry entry; |
| | | |
| | | // The lock used to provide threadsafe access to this configuration entry. |
| | | /** The lock used to provide threadsafe access to this configuration entry. */ |
| | | private Object entryLock; |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | List<Attribute> attrList = entry.getAttribute(attrType); |
| | | if ((attrList == null) || (attrList.isEmpty())) |
| | | if (attrList != null && !attrList.isEmpty()) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | return stub.getConfigAttribute(attrList); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | DirectoryServer.getDefaultAttributeType(name, attribute.getSyntax()); |
| | | } |
| | | |
| | | ArrayList<Attribute> attrs = new ArrayList<Attribute>(2); |
| | | List<Attribute> attrs = new ArrayList<Attribute>(2); |
| | | AttributeBuilder builder = new AttributeBuilder(attrType, name); |
| | | builder.addAll(attribute.getActiveValues()); |
| | | attrs.add(builder.toAttribute()); |
| | |
| | | * |
| | | * @return The set of children associated with this configuration entry. |
| | | */ |
| | | public ConcurrentHashMap<DN,ConfigEntry> getChildren() |
| | | public ConcurrentMap<DN, ConfigEntry> getChildren() |
| | | { |
| | | return children; |
| | | } |
| | |
| | | */ |
| | | public boolean hasChildren() |
| | | { |
| | | return (! children.isEmpty()); |
| | | return !children.isEmpty(); |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | deleteListeners.remove(listener); |
| | | } |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String toString() |
| | | { |
| | | return entry.toString(); |
| | | } |
| | | } |