| | |
| | | import org.opends.server.core.ModifyDNOperationBasis; |
| | | import org.opends.server.core.ModifyOperation; |
| | | import org.opends.server.core.ModifyOperationBasis; |
| | | import org.opends.server.core.ServerContext; |
| | | import org.opends.server.protocols.internal.InternalClientConnection; |
| | | import org.opends.server.protocols.internal.InternalSearchListener; |
| | | import org.opends.server.protocols.internal.InternalSearchOperation; |
| | |
| | | // register as an AlertGenerator |
| | | DirectoryServer.registerAlertGenerator(this); |
| | | |
| | | DirectoryServer.getInstance().getServerContext().getBackendConfigManager() |
| | | getServerContext().getBackendConfigManager() |
| | | .registerLocalBackendInitializationListener(this); |
| | | DirectoryServer.registerShutdownListener(this); |
| | | |
| | |
| | | final SearchResultEntry resultEntry = getFirstResult(searchOperation); |
| | | if (resultEntry != null) |
| | | { |
| | | AttributeType synchronizationGenIDType = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(REPLICATION_GENERATION_ID); |
| | | List<Attribute> attrs = resultEntry.getAllAttributes(synchronizationGenIDType); |
| | | if (!attrs.isEmpty()) |
| | | Iterator<Attribute> attrs = resultEntry.getAllAttributes(REPLICATION_GENERATION_ID).iterator(); |
| | | if (attrs.hasNext()) |
| | | { |
| | | Attribute attr = attrs.get(0); |
| | | Attribute attr = attrs.next(); |
| | | if (attr.size() == 1) |
| | | { |
| | | return resultEntry; |
| | |
| | | return null; |
| | | } |
| | | |
| | | private static ServerContext getServerContext() |
| | | { |
| | | return DirectoryServer.getInstance().getServerContext(); |
| | | } |
| | | |
| | | private Iterator<ByteString> getAttributeValueIterator(SearchResultEntry resultEntry, String attrName) |
| | | { |
| | | AttributeType attrType = DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(attrName); |
| | | AttributeType attrType = getServerContext().getSchema().getAttributeType(attrName); |
| | | List<Attribute> exclAttrs = resultEntry.getAllAttributes(attrType); |
| | | if (!exclAttrs.isEmpty()) |
| | | { |
| | |
| | | } |
| | | |
| | | // Check consistency of all classes attributes |
| | | Schema schema = DirectoryServer.getInstance().getServerContext().getSchema(); |
| | | Schema schema = getServerContext().getSchema(); |
| | | /* |
| | | * For each attribute in attributes1, check there is the matching |
| | | * one in attributes2. |
| | |
| | | */ |
| | | |
| | | // Check consistency of specific classes attributes |
| | | Schema schema = DirectoryServer.getInstance().getServerContext().getSchema(); |
| | | Schema schema = getServerContext().getSchema(); |
| | | int fractionalMode = newFractionalConfig.fractionalConfigToInt(); |
| | | for (Map.Entry<String, Set<String>> entry : newFractionalSpecificClassesAttributes.entrySet()) |
| | | { |
| | |
| | | Set<AttributeType> results = new HashSet<>(); |
| | | for (String attrName : fractionalConcernedAttributes) |
| | | { |
| | | results.add(DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(attrName)); |
| | | results.add(getServerContext().getSchema().getAttributeType(attrName)); |
| | | } |
| | | return results; |
| | | } |
| | |
| | | } |
| | | |
| | | DN entryDN = addOperation.getEntryDN(); |
| | | DN parentDnFromEntryDn = DirectoryServer.getInstance().getServerContext().getBackendConfigManager() |
| | | DN parentDnFromEntryDn = getServerContext().getBackendConfigManager() |
| | | .getParentDNInSuffix(entryDN); |
| | | if (parentDnFromEntryDn != null |
| | | && !parentDnFromCtx.equals(parentDnFromEntryDn)) |
| | |
| | | final CSN csn = generateCSN(addOperation); |
| | | final String entryUUID = getEntryUUID(addOperation); |
| | | final AddContext ctx = new AddContext(csn, entryUUID, |
| | | findEntryUUID(DirectoryServer.getInstance().getServerContext().getBackendConfigManager() |
| | | findEntryUUID(getServerContext().getBackendConfigManager() |
| | | .getParentDNInSuffix(addOperation.getEntryDN()))); |
| | | addOperation.setAttachment(SYNCHROCONTEXT, ctx); |
| | | } |
| | |
| | | } |
| | | |
| | | DirectoryServer.deregisterAlertGenerator(this); |
| | | DirectoryServer.getInstance().getServerContext().getBackendConfigManager() |
| | | getServerContext().getBackendConfigManager() |
| | | .deregisterLocalBackendInitializationListener(this); |
| | | DirectoryServer.deregisterShutdownListener(this); |
| | | |
| | |
| | | Set<AttributeType> includeAttributes = new HashSet<>(); |
| | | for (String attrName : includeAttributeStrings) |
| | | { |
| | | includeAttributes.add(DirectoryServer.getInstance().getServerContext().getSchema().getAttributeType(attrName)); |
| | | includeAttributes.add(getServerContext().getSchema().getAttributeType(attrName)); |
| | | } |
| | | exportConfig.setIncludeAttributes(includeAttributes); |
| | | } |
| | |
| | | |
| | | // Process import |
| | | preBackendImport(backend); |
| | | backend.importLDIF(importConfig, DirectoryServer.getInstance().getServerContext()); |
| | | backend.importLDIF(importConfig, getServerContext()); |
| | | } |
| | | catch(Exception e) |
| | | { |
| | |
| | | */ |
| | | private LocalBackend<?> getBackend() |
| | | { |
| | | return DirectoryServer.getInstance().getServerContext().getBackendConfigManager() |
| | | return getServerContext().getBackendConfigManager() |
| | | .findLocalBackendForEntry(getBaseDN()); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | // Check that the base DN is configured as a base-dn of the directory server |
| | | if (DirectoryServer.getInstance().getServerContext().getBackendConfigManager().findLocalBackendForEntry(dn) == null) |
| | | if (getServerContext().getBackendConfigManager().findLocalBackendForEntry(dn) == null) |
| | | { |
| | | unacceptableReasons.add(ERR_UNKNOWN_DN.get(dn)); |
| | | return false; |
| | |
| | | if (name.startsWith("@")) |
| | | { |
| | | String ocName = name.substring(1); |
| | | ObjectClass objectClass = DirectoryServer.getInstance().getServerContext().getSchema().getObjectClass(ocName); |
| | | ObjectClass objectClass = getServerContext().getSchema().getObjectClass(ocName); |
| | | if (!objectClass.isPlaceHolder()) |
| | | { |
| | | for (AttributeType at : objectClass.getRequiredAttributes()) |