| | |
| | | */ |
| | | private ConcurrentHashMap<DN, Backend<?>> subordinateBaseDNs; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new backend with the provided information. All backend |
| | | * implementations must implement a default constructor that use |
| | |
| | | userDefinedAttributes = new ArrayList<>(); |
| | | addAllUserDefinedAttrs(userDefinedAttributes, configEntry); |
| | | |
| | | |
| | | // Create the set of base DNs that we will handle. In this case, it's just |
| | | // the root DSE. |
| | | rootDSEDN = DN.rootDN(); |
| | | baseDNs = Collections.singleton(rootDSEDN); |
| | | |
| | | |
| | | // Create the set of subordinate base DNs. If this is specified in the |
| | | // configuration, then use that set. Otherwise, use the set of non-private |
| | | // backends defined in the server. |
| | |
| | | for (DN baseDN : subDNs) |
| | | { |
| | | Backend<?> backend = DirectoryServer.getBackend(baseDN); |
| | | if (backend == null) |
| | | if (backend != null) |
| | | { |
| | | logger.warn(WARN_ROOTDSE_NO_BACKEND_FOR_SUBORDINATE_BASE, baseDN); |
| | | subordinateBaseDNs.put(baseDN, backend); |
| | | } |
| | | else |
| | | { |
| | | subordinateBaseDNs.put(baseDN, backend); |
| | | logger.warn(WARN_ROOTDSE_NO_BACKEND_FOR_SUBORDINATE_BASE, baseDN); |
| | | } |
| | | } |
| | | } |
| | |
| | | throw new InitializationException(message, e); |
| | | } |
| | | |
| | | |
| | | // Determine whether all root DSE attributes should be treated as user |
| | | // attributes. |
| | | showAllAttributes = currentConfig.isShowAllAttributes(); |
| | | |
| | | |
| | | // Construct the set of "static" attributes that will always be present in |
| | | // the root DSE. |
| | | staticDSEAttributes = new ArrayList<>(); |
| | |
| | | } |
| | | dseObjectClasses.put(rootDSEOC, OC_ROOT_DSE); |
| | | |
| | | |
| | | // Set the backend ID for this backend. The identifier needs to be |
| | | // specific enough to avoid conflict with user backend identifiers. |
| | | setBackendID("__root.dse__"); |
| | | |
| | | |
| | | // Register as a change listener. |
| | | currentConfig.addChangeListener(this); |
| | | } |
| | |
| | | currentConfig.removeChangeListener(this); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided attribute is one that is used in the |
| | | * configuration of this backend. |
| | |
| | | return getRootDSE(); |
| | | } |
| | | |
| | | |
| | | // This method should never be used to get anything other than the root DSE. |
| | | // If we got here, then that appears to be the case, so log a message. |
| | | logger.warn(WARN_ROOTDSE_GET_ENTRY_NONROOT, entryDN); |
| | | |
| | | |
| | | // Go ahead and check the subordinate backends to see if we can find the |
| | | // entry there. Note that in order to avoid potential loop conditions, this |
| | | // will only work if the set of subordinate bases has been explicitly |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | // If we've gotten here, then we couldn't find the entry so return null. |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the root DSE entry for the Directory Server. |
| | | * |
| | |
| | | return getRootDSE(null); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the root DSE entry for the Directory Server. |
| | | * |
| | |
| | | ATTR_SUPPORTED_AUTH_PW_SCHEMES, DirectoryServer.getAuthPasswordStorageSchemes().keySet()); |
| | | addAttribute(supportedAuthPWSchemesAttr, dseUserAttrs, dseOperationalAttrs); |
| | | |
| | | |
| | | // Obtain TLS protocol and cipher support. |
| | | Collection<String> supportedTlsProtocols; |
| | | Collection<String> supportedTlsCiphers; |
| | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | // If it was not the null DN, then iterate through the associated |
| | | // subordinate backends to make the determination. |
| | | for (Map.Entry<DN, Backend<?>> entry : getSubordinateBaseDNs().entrySet()) |
| | |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message); |
| | | } |
| | | |
| | | |
| | | SearchFilter filter = searchOperation.getFilter(); |
| | | switch (searchOperation.getScope().asEnum()) |
| | | { |
| | |
| | | } |
| | | break; |
| | | |
| | | |
| | | case SINGLE_LEVEL: |
| | | for (Map.Entry<DN, Backend<?>> entry : getSubordinateBaseDNs().entrySet()) |
| | | { |
| | |
| | | } |
| | | break; |
| | | |
| | | |
| | | case WHOLE_SUBTREE: |
| | | case SUBORDINATES: |
| | | try |
| | |
| | | public boolean supports(BackendOperation backendOperation) |
| | | { |
| | | // We will only export the DSE entry itself. |
| | | return backendOperation.equals(BackendOperation.LDIF_EXPORT); |
| | | return BackendOperation.LDIF_EXPORT.equals(backendOperation); |
| | | } |
| | | |
| | | @Override |
| | |
| | | message); |
| | | } |
| | | |
| | | |
| | | // Write the root DSE entry itself to it. Make sure to close the LDIF |
| | | // writer when we're done. |
| | | try |
| | |
| | | { |
| | | boolean configIsAcceptable = true; |
| | | |
| | | |
| | | try |
| | | { |
| | | Set<DN> subDNs = cfg.getSubordinateBaseDN(); |
| | |
| | | configIsAcceptable = false; |
| | | } |
| | | |
| | | |
| | | return configIsAcceptable; |
| | | } |
| | | |
| | |
| | | { |
| | | final ConfigChangeResult ccr = new ConfigChangeResult(); |
| | | |
| | | |
| | | // Check to see if we should apply a new set of base DNs. |
| | | ConcurrentHashMap<DN, Backend<?>> subBases; |
| | | try |
| | |
| | | subBases = null; |
| | | } |
| | | |
| | | |
| | | boolean newShowAll = cfg.isShowAllAttributes(); |
| | | |
| | | |
| | | // Check to see if there is a new set of user-defined attributes. |
| | | ArrayList<Attribute> userAttrs = new ArrayList<>(); |
| | | try |
| | |
| | | ccr.setResultCode(DirectoryServer.getServerErrorResultCode()); |
| | | } |
| | | |
| | | |
| | | if (ccr.getResultCode() == ResultCode.SUCCESS) |
| | | { |
| | | subordinateBaseDNs = subBases; |
| | |
| | | ccr.addMessage(INFO_ROOTDSE_USING_NEW_SUBORDINATE_BASE_DNS.get(basesStr)); |
| | | } |
| | | |
| | | |
| | | if (showAllAttributes != newShowAll) |
| | | { |
| | | showAllAttributes = newShowAll; |
| | |
| | | ATTR_ROOTDSE_SHOW_ALL_ATTRIBUTES, showAllAttributes)); |
| | | } |
| | | |
| | | |
| | | userDefinedAttributes = userAttrs; |
| | | ccr.addMessage(INFO_ROOTDSE_USING_NEW_USER_ATTRS.get()); |
| | | } |
| | | |
| | | |
| | | return ccr; |
| | | } |
| | | } |