Align server types API with SDK types API
Align Entry class : change method name
* getDN() => getName()
Modify scripts to automate changes
* replace.rb : add replacements for ByteString and associated classes
* copyrigth.rb : fix script arguments + add case for FG copyright with single date
| | |
| | | |
| | | |
| | | def update_copyright(content) |
| | | pattern = /(^\s+\*\s+)Portions Copyright (\d+)-(\d+) ForgeRock,? AS/i |
| | | # handle FG copyright with 1 date |
| | | pattern = /(^\s+\*\s+)Copyright (\d+) ForgeRock,? AS/i |
| | | mdata = content.match(pattern) |
| | | if !mdata.nil? |
| | | if mdata[2]!="2014" |
| | | replace = '\1Portions Copyright \2-2014 ForgeRock AS' |
| | | is_replaced = content.gsub!(pattern, replace) |
| | | else |
| | | is_replaced = true # no action needed |
| | | end |
| | | end |
| | | |
| | | # handle FG copyright with 2 dates |
| | | pattern = /(^\s+\*\s+)Copyright (\d+)-(\d+) ForgeRock,? AS/i |
| | | replace = '\1Portions Copyright \2-2014 ForgeRock AS' |
| | | is_replaced = content.gsub!(pattern, replace) |
| | | |
| | | if is_replaced.nil? |
| | | # handle FG portions copyright with 2 dates |
| | | pattern = /(^\s+\*\s+)Portions Copyright (\d+)-(\d+) ForgeRock,? AS/i |
| | | replace = '\1Portions Copyright \2-2014 ForgeRock AS' |
| | | is_replaced = content.gsub!(pattern, replace) |
| | | end |
| | | |
| | | if is_replaced.nil? |
| | | # handle FG portions copyright with 1 date |
| | | pattern = /(^\s+\*\s+)Portions Copyright (\d+) ForgeRock,? AS/i |
| | | mdata = content.match(pattern) |
| | | if !mdata.nil? && mdata[2]!="2014" |
| | |
| | | is_replaced = content.gsub!(pattern, replace) |
| | | end |
| | | if is_replaced.nil? |
| | | # No portions line, add it |
| | | # Handle no FG portions |
| | | pattern = /(^\s+\*)(\s+)Copyright (\d+-?\d*)\s(.*)$\n\s+\*\/$/i |
| | | replace = '\1\2Copyright \3 \4' + "\n\\1\\2Portions Copyright 2014 ForgeRock AS\n\\1/" |
| | | is_replaced = content.gsub!(pattern, replace) |
| | |
| | | if args.size==0 |
| | | files = updated_files |
| | | else |
| | | files = argv |
| | | files = args |
| | | end |
| | | files.each { |file| |
| | | puts "Processing file #{file}" |
| | |
| | | } |
| | | |
| | | # Replacement for types |
| | | # Modify 688 files, for a total of 783 replacements - leaves 7605 compilation errors |
| | | TYPES = { |
| | | :dirs => JAVA_DIRS, |
| | | :extensions => ["java"], |
| | | :replacements => |
| | | [ |
| | | /import org.opends.server.types.(DN|RDN|Attribute|ByteString|Entry|ResultCode);/, |
| | | /import org.opends.server.types.(DN|RDN|Attribute|Entry|ResultCode);/, |
| | | 'import org.forgerock.opendj.ldap.\1;', |
| | | |
| | | /import org.opends.server.(types|api).(AttributeType|MatchingRule);/, |
| | |
| | | ] |
| | | } |
| | | |
| | | BYTESTRING_TYPE = { |
| | | :dirs => JAVA_DIRS, |
| | | :extensions => ["java"], |
| | | :replacements => |
| | | [ |
| | | /package org.opends.server.types;/, |
| | | "package org.opends.server.types;\n\n" + |
| | | "import org.forgerock.opendj.ldap.ByteString;\n" + |
| | | "import org.forgerock.opendj.ldap.ByteStringBuilder;\n" + |
| | | "import org.forgerock.opendj.ldap.ByteSequence;\n" + |
| | | "import org.forgerock.opendj.ldap.ByteSequenceReader;", |
| | | |
| | | /import org.opends.server.types.\*;/, |
| | | "import org.opends.server.types.*;\n" + |
| | | "import org.forgerock.opendj.ldap.ByteString;\n" + |
| | | "import org.forgerock.opendj.ldap.ByteStringBuilder;\n" + |
| | | "import org.forgerock.opendj.ldap.ByteSequence;\n" + |
| | | "import org.forgerock.opendj.ldap.ByteSequenceReader;", |
| | | |
| | | /import org.opends.server.types.(ByteString|ByteStringBuilder|ByteSequence|ByteSequenceReader);/, |
| | | 'import org.forgerock.opendj.ldap.\1;', |
| | | |
| | | /package org.opends.server.protocols.asn1;/, |
| | | "package org.opends.server.protocols.asn1;\n\n" + |
| | | "import com.forgerock.opendj.util.ByteSequenceOutputStream;", |
| | | |
| | | /import org.opends.server.protocols.asn1.ByteSequenceOutputStream;/, |
| | | "import com.forgerock.opendj.util.ByteSequenceOutputStream;", |
| | | |
| | | ] |
| | | } |
| | | |
| | | # Replacement for exceptions |
| | | # Modify 36 files, for a total of 134 replacements - leaves 1277 compilation errors but mostly from generated config |
| | | EXCEPTIONS = { |
| | |
| | | } |
| | | |
| | | # List of replacements to run |
| | | REPLACEMENTS = [ I18N_LOGGERS ] |
| | | #REPLACEMENTS = [ VALIDATOR, MESSAGES, TYPES, EXCEPTIONS, LOGGERS ] |
| | | REPLACEMENTS = [ BYTESTRING_TYPE ] |
| | | #REPLACEMENTS = [ VALIDATOR, MESSAGES, TYPES, EXCEPTIONS, LOGGERS, I18N_LOGGERS ] |
| | | |
| | | # Run replacements |
| | | def run |
| | |
| | | this.newEntry = newEntry; |
| | | this.controller = controller; |
| | | this.treePath = path; |
| | | DN newDn = newEntry.getDN(); |
| | | DN newDn = newEntry.getName(); |
| | | try |
| | | { |
| | | oldDn = DN.valueOf(oldEntry.getDN()); |
| | |
| | | modifications.remove(passwordModification); |
| | | } |
| | | hasModifications = modifications.size() > 0 || |
| | | !oldDn.equals(newEntry.getDN()) || |
| | | !oldDn.equals(newEntry.getName()) || |
| | | (passwordModification != null); |
| | | } |
| | | |
| | |
| | | { |
| | | public void run() |
| | | { |
| | | printEquivalentCommandToModify(newEntry.getDN(), modifications, |
| | | printEquivalentCommandToModify(newEntry.getName(), modifications, |
| | | useAdminCtx); |
| | | getProgressDialog().appendProgressHtml( |
| | | Utilities.getProgressWithPoints( |
| | |
| | | throws CannotRenameException, NamingException |
| | | { |
| | | RDN oldRDN = oldDN.rdn(); |
| | | RDN newRDN = newEntry.getDN().rdn(); |
| | | RDN newRDN = newEntry.getName().rdn(); |
| | | |
| | | boolean rdnTypeChanged = |
| | | newRDN.getNumValues() != oldRDN.getNumValues(); |
| | |
| | | { |
| | | public void run() |
| | | { |
| | | printEquivalentRenameCommand(oldDN, newEntry.getDN(), useAdminCtx); |
| | | printEquivalentRenameCommand(oldDN, newEntry.getName(), useAdminCtx); |
| | | getProgressDialog().appendProgressHtml( |
| | | Utilities.getProgressWithPoints( |
| | | INFO_CTRL_PANEL_RENAMING_ENTRY.get(oldDN.toString(), |
| | | newEntry.getDN().toString()), |
| | | newEntry.getName().toString()), |
| | | ColorAndFontConstants.progressFont)); |
| | | } |
| | | }); |
| | | |
| | | ctx.rename(Utilities.getJNDIName(oldDn.toString()), |
| | | Utilities.getJNDIName(newEntry.getDN().toString())); |
| | | Utilities.getJNDIName(newEntry.getName().toString())); |
| | | |
| | | final TreePath[] newPath = {null}; |
| | | |
| | |
| | | controller.getNodeInfoFromPath(treePath)); |
| | | newPath[0] = controller.notifyEntryAdded( |
| | | controller.getNodeInfoFromPath(parentPath), |
| | | newEntry.getDN().toString()); |
| | | newEntry.getName().toString()); |
| | | } |
| | | }); |
| | | |
| | |
| | | { |
| | | public void run() |
| | | { |
| | | DN dn = newEntry.getDN(); |
| | | DN dn = newEntry.getName(); |
| | | printEquivalentCommandToModify(dn, originalMods, useAdminCtx); |
| | | getProgressDialog().appendProgressHtml( |
| | | Utilities.getProgressWithPoints( |
| | |
| | | } |
| | | }); |
| | | |
| | | ctx.modifyAttributes(Utilities.getJNDIName(newEntry.getDN().toString()), |
| | | ctx.modifyAttributes(Utilities.getJNDIName(newEntry.getName().toString()), |
| | | mods); |
| | | |
| | | SwingUtilities.invokeLater(new Runnable() |
| | |
| | | |
| | | boolean isAttributeInNewRdn = false; |
| | | AttributeValue rdnValue = null; |
| | | RDN rdn = newEntry.getDN().rdn(); |
| | | RDN rdn = newEntry.getName().rdn(); |
| | | for (int i=0; i<rdn.getNumValues() && !isAttributeInNewRdn; i++) |
| | | { |
| | | isAttributeInNewRdn = |
| | |
| | | this.ldif = ldif; |
| | | this.parentNode = parentNode; |
| | | this.controller = controller; |
| | | dn = newEntry.getDN(); |
| | | dn = newEntry.getName(); |
| | | for (BackendDescriptor backend : info.getServerDescriptor().getBackends()) |
| | | { |
| | | for (BaseDNDescriptor baseDN : backend.getBaseDns()) |
| | |
| | | } |
| | | }); |
| | | |
| | | ctx.createSubcontext(Utilities.getJNDIName(newEntry.getDN().toString()), |
| | | ctx.createSubcontext(Utilities.getJNDIName(newEntry.getName().toString()), |
| | | attrs); |
| | | |
| | | SwingUtilities.invokeLater(new Runnable() |
| | |
| | | { |
| | | DN parentDN = DN.valueOf(parentNode.getDN()); |
| | | isReallyParentNode = |
| | | parentDN.equals(newEntry.getDN().parent()); |
| | | parentDN.equals(newEntry.getName().parent()); |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | |
| | | } |
| | | if (isReallyParentNode) |
| | | { |
| | | insertNode(parentNode, newEntry.getDN(), |
| | | isBaseDN(newEntry.getDN())); |
| | | insertNode(parentNode, newEntry.getName(), |
| | | isBaseDN(newEntry.getName())); |
| | | entryInserted = true; |
| | | } |
| | | } |
| | | if (!entryInserted) |
| | | { |
| | | BasicNode root = (BasicNode)controller.getTreeModel().getRoot(); |
| | | BasicNode realParentNode = findParentNode(newEntry.getDN(), root); |
| | | BasicNode realParentNode = findParentNode(newEntry.getName(), root); |
| | | if (realParentNode != null) |
| | | { |
| | | insertNode(realParentNode, newEntry.getDN(), false); |
| | | insertNode(realParentNode, newEntry.getName(), false); |
| | | } |
| | | else |
| | | { |
| | | if (isBaseDN(newEntry.getDN())) |
| | | if (isBaseDN(newEntry.getName())) |
| | | { |
| | | int nRootChildren = controller.getTreeModel().getChildCount( |
| | | controller.getTreeModel().getRoot()); |
| | | if (nRootChildren > 1) |
| | | { |
| | | // Insert in the root. |
| | | insertNode(root, newEntry.getDN(), true); |
| | | insertNode(root, newEntry.getName(), true); |
| | | } |
| | | } |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | // Unexpected error: getEntry() should work after calling checkSyntax |
| | | throw new RuntimeException("Unexpected error: "+t, t); |
| | | } |
| | | String dn = entry.getDN().toString(); |
| | | String dn = entry.getName().toString(); |
| | | // Checking for the existence of an entry is fast enough so we can do |
| | | // it on the event thread. |
| | | if (entryExists(dn)) |
| | |
| | | LDIFReader reader = new LDIFReader(ldifImportConfig); |
| | | Entry newConfigEntry = reader.readEntry(); |
| | | Entry oldEntry = DirectoryServer.getConfigEntry( |
| | | newConfigEntry.getDN()).getEntry(); |
| | | newConfigEntry.getName()).getEntry(); |
| | | DirectoryServer.getConfigHandler().replaceEntry(oldEntry, |
| | | newConfigEntry, |
| | | null); |
| | |
| | | else |
| | | { |
| | | boolean modified = |
| | | !Utilities.areDnsEqual(ev.getEntry().getDN().toString(), |
| | | !Utilities.areDnsEqual(ev.getEntry().getName().toString(), |
| | | searchResult.getDN()) || |
| | | !ModifyEntryTask.getModifications(ev.getEntry(), searchResult, |
| | | getInfo()).isEmpty(); |
| | |
| | | } |
| | | if ((errors.size() == 0) && newTask.hasModifications()) |
| | | { |
| | | String dn = entry.getDN().toString(); |
| | | String dn = entry.getName().toString(); |
| | | launchOperation(newTask, |
| | | INFO_CTRL_PANEL_MODIFYING_ENTRY_SUMMARY.get(dn), |
| | | INFO_CTRL_PANEL_MODIFYING_ENTRY_COMPLETE.get(), |
| | |
| | | args.add(getNoPropertiesFileArgument()); |
| | | args.add("--no-prompt"); |
| | | |
| | | dns.add(indexEntry.getDN().toString()); |
| | | dns.add(indexEntry.getName().toString()); |
| | | attributes.add(attrs); |
| | | } |
| | | |
| | |
| | | sb.append(" "+CommandBuilder.escapeValue(arg)); |
| | | } |
| | | |
| | | ctx.createSubcontext(indexEntry.getDN().toString(), attrs); |
| | | ctx.createSubcontext(indexEntry.getName().toString(), attrs); |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | |
| | | LDIFReader reader = new LDIFReader(ldifImportConfig); |
| | | Entry newConfigEntry = reader.readEntry(); |
| | | Entry oldEntry = DirectoryServer.getConfigEntry( |
| | | newConfigEntry.getDN()).getEntry(); |
| | | newConfigEntry.getName()).getEntry(); |
| | | DirectoryServer.getConfigHandler().replaceEntry(oldEntry, |
| | | newConfigEntry, |
| | | null); |
| | |
| | | protected void addValuesInRDN(Entry entry) |
| | | { |
| | | // Add the values in the RDN if they are not there |
| | | RDN rdn = entry.getDN().rdn(); |
| | | RDN rdn = entry.getName().rdn(); |
| | | for (int i=0; i<rdn.getNumValues(); i++) |
| | | { |
| | | String attrName = rdn.getAttributeName(i); |
| | |
| | | |
| | | baseDNs = new DN[] { configRootEntry.getDN() }; |
| | | |
| | | configEntries.put(entry.getDN(), configRootEntry); |
| | | configEntries.put(entry.getName(), configRootEntry); |
| | | // Iterate through the rest of the configuration file and process the |
| | | // remaining entries. |
| | | while (entry != null) |
| | |
| | | entry = reader.readEntry(checkSchema); |
| | | if (entry != null) |
| | | { |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | DN parentDN = entryDN.parent(); |
| | | ConfigEntry parentEntry = null; |
| | | if (parentDN != null) |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | * Portions Copyright 2012-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin; |
| | | |
| | |
| | | |
| | | if (entry != null) |
| | | { |
| | | returnDN = entry.getDN(); |
| | | returnDN = entry.getName(); |
| | | } |
| | | } |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2011 ForgeRock AS. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.api; |
| | |
| | | boolean useDefaultOnError) throws DirectoryException |
| | | { |
| | | // First check to see if the ds-pwp-password-policy-dn is present. |
| | | String userDNString = userEntry.getDN().toString(); |
| | | String userDNString = userEntry.getName().toString(); |
| | | AttributeType type = DirectoryServer.getAttributeType( |
| | | OP_ATTR_PWPOLICY_POLICY_DN, true); |
| | | List<Attribute> attrList = userEntry.getAttribute(type); |
| | |
| | | * |
| | | * |
| | | * Copyright 2011 ForgeRock AS. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.api; |
| | |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugInfo("Attribute %s resolves to true for user entry " |
| | | + "%s", attributeType.getNameOrOID(), entry.getDN().toString()); |
| | | + "%s", attributeType.getNameOrOID(), |
| | | entry.getName().toString()); |
| | | } |
| | | |
| | | return ConditionResult.TRUE; |
| | |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugInfo("Attribute %s resolves to false for user " |
| | | + "entry %s", attributeType.getNameOrOID(), entry.getDN() |
| | | + "entry %s", attributeType.getNameOrOID(), entry.getName() |
| | | .toString()); |
| | | } |
| | | |
| | |
| | | { |
| | | TRACER.debugError("Unable to resolve value %s for attribute %s " |
| | | + "in user entry %s as a Boolean.", valueString, |
| | | attributeType.getNameOrOID(), entry.getDN().toString()); |
| | | attributeType.getNameOrOID(), entry.getName().toString()); |
| | | } |
| | | |
| | | final Message message = ERR_PWPSTATE_CANNOT_DECODE_BOOLEAN |
| | | .get(valueString, attributeType.getNameOrOID(), entry.getDN() |
| | | .get(valueString, attributeType.getNameOrOID(), entry.getName() |
| | | .toString()); |
| | | throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, |
| | | message); |
| | |
| | | { |
| | | TRACER.debugInfo("Returning %s because attribute %s does not exist " |
| | | + "in user entry %s", ConditionResult.UNDEFINED.toString(), |
| | | attributeType.getNameOrOID(), entry.getDN().toString()); |
| | | attributeType.getNameOrOID(), entry.getName().toString()); |
| | | } |
| | | |
| | | return ConditionResult.UNDEFINED; |
| | |
| | | |
| | | TRACER.debugWarning("Unable to decode value %s for attribute %s " |
| | | + "in user entry %s: %s", v.getValue().toString(), |
| | | attributeType.getNameOrOID(), entry.getDN().toString(), |
| | | attributeType.getNameOrOID(), entry.getName().toString(), |
| | | stackTraceToSingleLineString(e)); |
| | | } |
| | | |
| | | final Message message = ERR_PWPSTATE_CANNOT_DECODE_GENERALIZED_TIME |
| | | .get(v.getValue().toString(), attributeType.getNameOrOID(), entry |
| | | .getDN().toString(), String.valueOf(e)); |
| | | .getName().toString(), String.valueOf(e)); |
| | | throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, |
| | | message, e); |
| | | } |
| | |
| | | { |
| | | TRACER.debugInfo("Returning -1 because attribute %s does not " |
| | | + "exist in user entry %s", attributeType.getNameOrOID(), entry |
| | | .getDN().toString()); |
| | | .getName().toString()); |
| | | } |
| | | } |
| | | // FIXME: else to be consistent... |
| | |
| | | { |
| | | TRACER.debugWarning("User %s is considered administratively " |
| | | + "disabled because an error occurred while " |
| | | + "attempting to make the determination: %s.", userEntry.getDN() |
| | | + "attempting to make the determination: %s.", userEntry.getName() |
| | | .toString(), stackTraceToSingleLineString(e)); |
| | | } |
| | | |
| | |
| | | { |
| | | TRACER.debugInfo("User %s is not administratively disabled since " |
| | | + "the attribute \"%s\" is not present in the entry.", userEntry |
| | | .getDN().toString(), OP_ATTR_ACCOUNT_DISABLED); |
| | | .getName().toString(), OP_ATTR_ACCOUNT_DISABLED); |
| | | } |
| | | return false; |
| | | } |
| | |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugInfo("User %s %s administratively disabled.", userEntry |
| | | .getDN().toString(), ((isDisabled == ConditionResult.TRUE) ? " is" |
| | | .getName().toString(), ((isDisabled == ConditionResult.TRUE) ? " is" |
| | | : " is not")); |
| | | } |
| | | |
| | |
| | | if (authNEntry != null) |
| | | { |
| | | if ((authZEntry == null) || |
| | | authZEntry.getDN().equals(authNEntry.getDN())) |
| | | authZEntry.getName().equals(authNEntry.getName())) |
| | | { |
| | | DirectoryServer.getAuthenticatedUsers().remove( |
| | | authNEntry.getDN(), this); |
| | | authNEntry.getName(), this); |
| | | } |
| | | else |
| | | { |
| | | DirectoryServer.getAuthenticatedUsers().remove( |
| | | authNEntry.getDN(), this); |
| | | authNEntry.getName(), this); |
| | | DirectoryServer.getAuthenticatedUsers().remove( |
| | | authZEntry.getDN(), this); |
| | | authZEntry.getName(), this); |
| | | } |
| | | } |
| | | else if (authZEntry != null) |
| | | { |
| | | DirectoryServer.getAuthenticatedUsers().remove( |
| | | authZEntry.getDN(), this); |
| | | authZEntry.getName(), this); |
| | | } |
| | | |
| | | networkGroup.removeConnection(this); |
| | |
| | | if (authNEntry != null) |
| | | { |
| | | if ((authZEntry == null) || |
| | | authZEntry.getDN().equals(authNEntry.getDN())) |
| | | authZEntry.getName().equals(authNEntry.getName())) |
| | | { |
| | | DirectoryServer.getAuthenticatedUsers().remove( |
| | | authNEntry.getDN(), this); |
| | | authNEntry.getName(), this); |
| | | } |
| | | else |
| | | { |
| | | DirectoryServer.getAuthenticatedUsers().remove( |
| | | authNEntry.getDN(), this); |
| | | authNEntry.getName(), this); |
| | | DirectoryServer.getAuthenticatedUsers().remove( |
| | | authZEntry.getDN(), this); |
| | | authZEntry.getName(), this); |
| | | } |
| | | } |
| | | else if (authZEntry != null) |
| | | { |
| | | DirectoryServer.getAuthenticatedUsers().remove( |
| | | authZEntry.getDN(), this); |
| | | authZEntry.getName(), this); |
| | | } |
| | | } |
| | | |
| | |
| | | if (authNEntry != null) |
| | | { |
| | | if ((authZEntry == null) || |
| | | authZEntry.getDN().equals(authNEntry.getDN())) |
| | | authZEntry.getName().equals(authNEntry.getName())) |
| | | { |
| | | DirectoryServer.getAuthenticatedUsers().put( |
| | | authNEntry.getDN(), this); |
| | | authNEntry.getName(), this); |
| | | } |
| | | else |
| | | { |
| | | DirectoryServer.getAuthenticatedUsers().put( |
| | | authNEntry.getDN(), this); |
| | | authNEntry.getName(), this); |
| | | DirectoryServer.getAuthenticatedUsers().put( |
| | | authZEntry.getDN(), this); |
| | | authZEntry.getName(), this); |
| | | } |
| | | } |
| | | else |
| | |
| | | if (authZEntry != null) |
| | | { |
| | | DirectoryServer.getAuthenticatedUsers().put( |
| | | authZEntry.getDN(), this); |
| | | authZEntry.getName(), this); |
| | | } |
| | | } |
| | | |
| | |
| | | Entry authZEntry = authenticationInfo.getAuthorizationEntry(); |
| | | |
| | | if ((authNEntry != null) && |
| | | authNEntry.getDN().equals(oldEntry.getDN())) |
| | | authNEntry.getName().equals(oldEntry.getName())) |
| | | { |
| | | if ((authZEntry == null) || |
| | | (! authZEntry.getDN().equals(authNEntry.getDN()))) |
| | | (! authZEntry.getName().equals(authNEntry.getName()))) |
| | | { |
| | | setAuthenticationInfo( |
| | | authenticationInfo.duplicate(newEntry, authZEntry)); |
| | |
| | | } |
| | | } |
| | | else if ((authZEntry != null) && |
| | | (authZEntry.getDN().equals(oldEntry.getDN()))) |
| | | (authZEntry.getName().equals(oldEntry.getName()))) |
| | | { |
| | | setAuthenticationInfo( |
| | | authenticationInfo.duplicate(authNEntry, newEntry)); |
| | |
| | | public static boolean hasPrivilege(Entry authorizationEntry, |
| | | Privilege privilege) { |
| | | boolean isRoot = |
| | | DirectoryServer.isRootDN(authorizationEntry.getDN()); |
| | | DirectoryServer.isRootDN(authorizationEntry.getName()); |
| | | return getPrivileges(authorizationEntry, |
| | | isRoot).contains(privilege) || |
| | | DirectoryServer.isDisabled(privilege); |
| | |
| | | else |
| | | { |
| | | boolean isRoot = |
| | | DirectoryServer.isRootDN(authorizationEntry.getDN()); |
| | | DirectoryServer.isRootDN(authorizationEntry.getName()); |
| | | result = getPrivileges(authorizationEntry, |
| | | isRoot).contains(privilege) || |
| | | DirectoryServer.isDisabled(privilege); |
| | |
| | | * @return True if the authZid is equal to the authorization entry's DN. |
| | | */ |
| | | public boolean isAuthzidAuthorizationDN() { |
| | | return this.authzid.equals(this.authorizationEntry.getDN()); |
| | | return this.authzid.equals(this.authorizationEntry.getName()); |
| | | } |
| | | |
| | | /** |
| | |
| | | if(this.useAuthzid) |
| | | return this.authzid; |
| | | else if (this.authorizationEntry != null) |
| | | return this.authorizationEntry.getDN(); |
| | | return this.authorizationEntry.getName(); |
| | | return DN.rootDN(); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public DN getResourceDN() { |
| | | return resourceEntry.getDN(); |
| | | return resourceEntry.getName(); |
| | | } |
| | | |
| | | /** |
| | |
| | | return true; |
| | | } |
| | | |
| | | final RDN oldRDN = operation.getOriginalEntry().getDN().rdn(); |
| | | final RDN oldRDN = operation.getOriginalEntry().getName().rdn(); |
| | | final RDN newRDN = operation.getNewRDN(); |
| | | final DN newSuperiorDN = operation.getNewSuperior(); |
| | | |
| | |
| | | |
| | | final AuthenticationInfo authInfo = |
| | | new AuthenticationInfo(proxyUser, DirectoryServer.isRootDN(proxyUser |
| | | .getDN())); |
| | | .getName())); |
| | | final AciContainer container = |
| | | new AciLDAPOperationContainer(op, proxiedUser, authInfo, ACI_PROXY); |
| | | return accessAllowedEntry(container); |
| | |
| | | throws DirectoryException |
| | | { |
| | | Entry resourceEntry = container.getResourceEntry(); |
| | | DN dn = resourceEntry.getDN(); |
| | | DN dn = resourceEntry.getName(); |
| | | List<Modification> modifications = operation.getModifications(); |
| | | |
| | | for (Modification m : modifications) |
| | |
| | | Privilege.MODIFY_ACL, operation)) |
| | | { |
| | | Message message = INFO_ACI_ADD_FAILED_PRIVILEGE.get( |
| | | String.valueOf(entry.getDN()), String.valueOf(clientDN)); |
| | | String.valueOf(entry.getName()), String.valueOf(clientDN)); |
| | | logError(message); |
| | | return false; |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | Aci.decode(value.getValue(), entry.getDN()); |
| | | Aci.decode(value.getValue(), entry.getName()); |
| | | } |
| | | catch (AciException ex) |
| | | { |
| | | Message message = WARN_ACI_ADD_FAILED_DECODE.get( |
| | | String.valueOf(entry.getDN()), ex.getMessage()); |
| | | String.valueOf(entry.getName()), ex.getMessage()); |
| | | throw new DirectoryException( |
| | | ResultCode.INVALID_ATTRIBUTE_SYNTAX, message); |
| | | } |
| | |
| | | try |
| | | { |
| | | for (Entry entry : entries) { |
| | | DN dn=entry.getDN(); |
| | | DN dn=entry.getName(); |
| | | List<Attribute> attributeList = |
| | | entry.getOperationalAttribute(AciHandler.aciType); |
| | | validAcis += addAciAttributeList(aciList, dn, configDN, |
| | |
| | | //Process global "ds-cfg-global-aci" attribute type. The oldentry |
| | | //DN is checked to verify it is equal to the config DN. If not those |
| | | //attributes are skipped. |
| | | if(hasGlobalAci && entry.getDN().equals(configDN)) { |
| | | if(hasGlobalAci && entry.getName().equals(configDN)) { |
| | | List<Attribute> attributeList = entry.getAttribute(globalAciType); |
| | | validAcis = addAciAttributeList(aciList, DN.rootDN(), configDN, |
| | | attributeList, failedACIMsgs); |
| | |
| | | |
| | | if(hasAci) { |
| | | List<Attribute> attributeList = entry.getAttribute(aciType); |
| | | validAcis += addAciAttributeList(aciList, entry.getDN(), configDN, |
| | | validAcis += addAciAttributeList(aciList, entry.getName(), configDN, |
| | | attributeList, failedACIMsgs); |
| | | } |
| | | } |
| | |
| | | LinkedList<Message>failedACIMsgs=new LinkedList<Message>(); |
| | | //Process "aci" attribute types. |
| | | if(hasAci) { |
| | | aciList.remove(oldEntry.getDN()); |
| | | aciList.remove(oldEntry.getName()); |
| | | List<Attribute> attributeList = |
| | | newEntry.getOperationalAttribute(aciType); |
| | | addAciAttributeList(aciList,newEntry.getDN(), configDN, |
| | | addAciAttributeList(aciList,newEntry.getName(), configDN, |
| | | attributeList, failedACIMsgs); |
| | | } |
| | | //Process global "ds-cfg-global-aci" attribute type. The oldentry |
| | | //DN is checked to verify it is equal to the config DN. If not those |
| | | //attributes are skipped. |
| | | if(hasGlobalAci && oldEntry.getDN().equals(configDN)) { |
| | | if(hasGlobalAci && oldEntry.getName().equals(configDN)) { |
| | | aciList.remove(DN.rootDN()); |
| | | List<Attribute> attributeList = |
| | | newEntry.getAttribute(globalAciType); |
| | |
| | | */ |
| | | public boolean removeAci(Entry entry, boolean hasAci, |
| | | boolean hasGlobalAci) { |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | |
| | | lock.writeLock().lock(); |
| | | try |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.authorization.dseecompat; |
| | |
| | | Entry entry = modifyDNOperation.getUpdatedEntry(); |
| | | if (entry != null) |
| | | { |
| | | doPostModifyDN(entry.getDN(), entry.getDN()); |
| | | doPostModifyDN(entry.getName(), entry.getName()); |
| | | } |
| | | } |
| | | |
| | |
| | | // has been a change. |
| | | if (modifyDNOperation.getResultCode() == ResultCode.SUCCESS) |
| | | { |
| | | doPostModifyDN(modifyDNOperation.getOriginalEntry().getDN(), |
| | | modifyDNOperation.getUpdatedEntry().getDN()); |
| | | doPostModifyDN(modifyDNOperation.getOriginalEntry().getName(), |
| | | modifyDNOperation.getUpdatedEntry().getName()); |
| | | } |
| | | |
| | | // If we've gotten here, then everything is acceptable. |
| | |
| | | public static boolean isTargetApplicable(Aci aci, |
| | | AciTargetMatchContext matchCtx) { |
| | | return isTargetApplicable(aci, aci.getTargets(), |
| | | matchCtx.getResourceEntry().getDN()); |
| | | matchCtx.getResourceEntry().getName()); |
| | | } |
| | | |
| | | /* |
| | |
| | | { |
| | | // Make sure that the target entry does not already exist, but that its |
| | | // parent does exist (or that the entry being added is the base DN). |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | if (entryMap.containsKey(entryDN)) |
| | | { |
| | | Message m = ERR_LDIF_BACKEND_ADD_ALREADY_EXISTS.get(entryDN.toString()); |
| | |
| | | try |
| | | { |
| | | // Make sure that the target entry exists. If not, then fail. |
| | | DN entryDN = newEntry.getDN(); |
| | | DN entryDN = newEntry.getName(); |
| | | if (! entryMap.containsKey(entryDN)) |
| | | { |
| | | DN matchedDN = null; |
| | |
| | | { |
| | | // Make sure that the original entry exists and that the new entry doesn't |
| | | // exist but its parent does. |
| | | DN newDN = entry.getDN(); |
| | | DN newDN = entry.getName(); |
| | | if (! entryMap.containsKey(currentDN)) |
| | | { |
| | | DN matchedDN = null; |
| | |
| | | { |
| | | for (Entry entry : entryMap.values()) |
| | | { |
| | | entryDN = entry.getDN(); |
| | | entryDN = entry.getName(); |
| | | ldifWriter.writeEntry(entry); |
| | | } |
| | | } |
| | |
| | | |
| | | // Make sure that we don't already have an entry with the same DN. If |
| | | // a duplicate is encountered, then log a message and continue. |
| | | DN entryDN = e.getDN(); |
| | | DN entryDN = e.getName(); |
| | | if (entryMap.containsKey(entryDN)) |
| | | { |
| | | Message m = ERR_LDIF_BACKEND_DUPLICATE_ENTRY.get(ldifFilePath, |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends; |
| | | |
| | |
| | | Entry e = entry.duplicate(false); |
| | | |
| | | // See if the target entry already exists. If so, then fail. |
| | | DN entryDN = e.getDN(); |
| | | DN entryDN = e.getName(); |
| | | if (entryMap.containsKey(entryDN)) |
| | | { |
| | | Message message = |
| | |
| | | Entry e = newEntry.duplicate(false); |
| | | |
| | | // Make sure the entry exists. If not, then throw an exception. |
| | | DN entryDN = e.getDN(); |
| | | DN entryDN = e.getName(); |
| | | if (! entryMap.containsKey(entryDN)) |
| | | { |
| | | Message message = |
| | |
| | | |
| | | |
| | | // Make sure that no entry exists with the new DN. |
| | | if (entryMap.containsKey(e.getDN())) |
| | | if (entryMap.containsKey(e.getName())) |
| | | { |
| | | Message message = |
| | | ERR_MEMORYBACKEND_ENTRY_ALREADY_EXISTS.get(String.valueOf(e.getDN())); |
| | | Message message = ERR_MEMORYBACKEND_ENTRY_ALREADY_EXISTS.get( |
| | | String.valueOf(e.getName())); |
| | | throw new DirectoryException(ResultCode.ENTRY_ALREADY_EXISTS, message); |
| | | } |
| | | |
| | |
| | | boolean matchFound = false; |
| | | for (DN dn : baseDNs) |
| | | { |
| | | if (dn.isAncestorOf(e.getDN())) |
| | | if (dn.isAncestorOf(e.getName())) |
| | | { |
| | | matchFound = true; |
| | | break; |
| | |
| | | |
| | | |
| | | // Make sure that the parent of the new entry exists. |
| | | DN parentDN = e.getDN().getParentDNInSuffix(); |
| | | DN parentDN = e.getName().getParentDNInSuffix(); |
| | | if ((parentDN == null) || (! entryMap.containsKey(parentDN))) |
| | | { |
| | | Message message = ERR_MEMORYBACKEND_RENAME_PARENT_DOESNT_EXIST.get( |
| | |
| | | { |
| | | for (Entry entry : entryMap.values()) |
| | | { |
| | | entryDN = entry.getDN(); |
| | | entryDN = entry.getName(); |
| | | ldifWriter.writeEntry(entry); |
| | | } |
| | | } |
| | |
| | | throws DirectoryException |
| | | { |
| | | final Message message = ERR_MONITOR_ADD_NOT_SUPPORTED.get(String |
| | | .valueOf(entry.getDN())); |
| | | .valueOf(entry.getName())); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message); |
| | | } |
| | | |
| | |
| | | final ModifyOperation modifyOperation) throws DirectoryException |
| | | { |
| | | final Message message = ERR_MONITOR_MODIFY_NOT_SUPPORTED.get( |
| | | String.valueOf(newEntry.getDN()), String.valueOf(configEntryDN)); |
| | | String.valueOf(newEntry.getName()), String.valueOf(configEntryDN)); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message); |
| | | } |
| | | |
| | |
| | | throws DirectoryException |
| | | { |
| | | Message message = |
| | | ERR_ROOTDSE_ADD_NOT_SUPPORTED.get(String.valueOf(entry.getDN())); |
| | | ERR_ROOTDSE_ADD_NOT_SUPPORTED.get(String.valueOf(entry.getName())); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message); |
| | | } |
| | | |
| | |
| | | ModifyOperation modifyOperation) throws DirectoryException |
| | | { |
| | | Message message = ERR_ROOTDSE_MODIFY_NOT_SUPPORTED.get( |
| | | String.valueOf(newEntry.getDN()), String.valueOf(configEntryDN)); |
| | | String.valueOf(newEntry.getName()), String.valueOf(configEntryDN)); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message); |
| | | } |
| | | |
| | |
| | | throws DirectoryException |
| | | { |
| | | Message message = |
| | | ERR_SCHEMA_ADD_NOT_SUPPORTED.get(String.valueOf(entry.getDN())); |
| | | ERR_SCHEMA_ADD_NOT_SUPPORTED.get(String.valueOf(entry.getName())); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message); |
| | | } |
| | | |
| | |
| | | public void addEntry(Entry entry, AddOperation addOperation) |
| | | throws DirectoryException |
| | | { |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | |
| | | if (entryDN.equals(baseDN)) |
| | | { |
| | |
| | | private void addCertificate(Entry entry) |
| | | throws DirectoryException |
| | | { |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | |
| | | // Make sure that the DN specifies a certificate alias. |
| | | AttributeType t = |
| | |
| | | { |
| | | checkDiskSpace(addOperation); |
| | | writerBegin(); |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | |
| | | EntryContainer ec; |
| | | if (rootContainer != null) |
| | |
| | | checkDiskSpace(modifyOperation); |
| | | writerBegin(); |
| | | |
| | | DN entryDN = newEntry.getDN(); |
| | | DN entryDN = newEntry.getName(); |
| | | EntryContainer ec; |
| | | if (rootContainer != null) |
| | | { |
| | |
| | | message); |
| | | } |
| | | |
| | | EntryContainer container = rootContainer.getEntryContainer(entry.getDN()); |
| | | EntryContainer container = rootContainer.getEntryContainer(entry.getName()); |
| | | |
| | | if (currentContainer != container) |
| | | { |
| | |
| | | List<Modification> mods) |
| | | throws DatabaseException |
| | | { |
| | | DN entryDN = before.getDN(); |
| | | DN entryDN = before.getName(); |
| | | for (Modification mod : mods) |
| | | { |
| | | Attribute modAttr = mod.getAttribute(); |
| | |
| | | Set<String> labeledURIs = entry.getReferralURLs(); |
| | | if (labeledURIs != null) |
| | | { |
| | | DN dn = entry.getDN(); |
| | | DN dn = entry.getName(); |
| | | for (String labeledURI : labeledURIs) |
| | | { |
| | | if(!insert(txn, dn, labeledURI)) |
| | |
| | | Set<String> labeledURIs = entry.getReferralURLs(); |
| | | if (labeledURIs != null) |
| | | { |
| | | delete(txn, entry.getDN()); |
| | | delete(txn, entry.getName()); |
| | | } |
| | | } |
| | | |
| | |
| | | Set<String> referralURLs = entry.getReferralURLs(); |
| | | if (referralURLs != null) |
| | | { |
| | | throwReferralException(entry.getDN(), entry.getDN(), referralURLs, |
| | | throwReferralException(entry.getName(), entry.getName(), referralURLs, |
| | | searchScope); |
| | | } |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.backends.jeb; |
| | |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, ex); |
| | | } |
| | | Message message = ERR_CACHE_PRELOAD_ENTRY_FAILED.get( |
| | | entry.getDN().toNormalizedString(), |
| | | entry.getName().toNormalizedString(), |
| | | (ex.getCause() != null ? ex.getCause().getMessage() : |
| | | stackTraceToSingleLineString(ex))); |
| | | logError(message); |
| | |
| | | if (entry != null) |
| | | { |
| | | boolean isInScope = false; |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | |
| | | if (candidatesAreInScope) |
| | | { |
| | |
| | | throws DatabaseException, DirectoryException, CanceledOperationException |
| | | { |
| | | Transaction txn = beginTransaction(); |
| | | DN parentDN = getParentWithinBase(entry.getDN()); |
| | | DN parentDN = getParentWithinBase(entry.getName()); |
| | | |
| | | try |
| | | { |
| | | // Check whether the entry already exists. |
| | | if (dn2id.get(txn, entry.getDN(), LockMode.DEFAULT) != null) |
| | | if (dn2id.get(txn, entry.getName(), LockMode.DEFAULT) != null) |
| | | { |
| | | Message message = |
| | | ERR_JEB_ADD_ENTRY_ALREADY_EXISTS.get(entry.getDN().toString()); |
| | | ERR_JEB_ADD_ENTRY_ALREADY_EXISTS.get(entry.getName().toString()); |
| | | throw new DirectoryException(ResultCode.ENTRY_ALREADY_EXISTS, |
| | | message); |
| | | } |
| | |
| | | if (parentDN != null) |
| | | { |
| | | // Check for referral entries above the target. |
| | | dn2uri.targetEntryReferrals(entry.getDN(), null); |
| | | dn2uri.targetEntryReferrals(entry.getName(), null); |
| | | |
| | | // Read the parent ID from dn2id. |
| | | parentID = dn2id.get(txn, parentDN, LockMode.DEFAULT); |
| | | if (parentID == null) |
| | | { |
| | | Message message = ERR_JEB_ADD_NO_SUCH_OBJECT.get( |
| | | entry.getDN().toString()); |
| | | entry.getName().toString()); |
| | | DN matchedDN = getMatchedDN(baseDN); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, |
| | | message, matchedDN, null); |
| | |
| | | EntryID entryID = rootContainer.getNextEntryID(); |
| | | |
| | | // Insert into dn2id. |
| | | if (!dn2id.insert(txn, entry.getDN(), entryID)) |
| | | if (!dn2id.insert(txn, entry.getName(), entryID)) |
| | | { |
| | | // Do not ever expect to come through here. |
| | | Message message = |
| | | ERR_JEB_ADD_ENTRY_ALREADY_EXISTS.get(entry.getDN().toString()); |
| | | ERR_JEB_ADD_ENTRY_ALREADY_EXISTS.get(entry.getName().toString()); |
| | | throw new DirectoryException(ResultCode.ENTRY_ALREADY_EXISTS, |
| | | message); |
| | | } |
| | |
| | | { |
| | | // Do not ever expect to come through here. |
| | | Message message = |
| | | ERR_JEB_ADD_ENTRY_ALREADY_EXISTS.get(entry.getDN().toString()); |
| | | ERR_JEB_ADD_ENTRY_ALREADY_EXISTS.get(entry.getName().toString()); |
| | | throw new DirectoryException(ResultCode.ENTRY_ALREADY_EXISTS, |
| | | message); |
| | | } |
| | |
| | | { |
| | | // Do not ever expect to come through here. |
| | | Message message = |
| | | ERR_JEB_ADD_ENTRY_ALREADY_EXISTS.get(entry.getDN().toString()); |
| | | ERR_JEB_ADD_ENTRY_ALREADY_EXISTS.get(entry.getName().toString()); |
| | | throw new DirectoryException(ResultCode.ENTRY_ALREADY_EXISTS, |
| | | message); |
| | | } |
| | |
| | | EntryCache<?> entryCache = DirectoryServer.getEntryCache(); |
| | | if (entryCache != null) |
| | | { |
| | | entryCache.removeEntry(entry.getDN()); |
| | | entryCache.removeEntry(entry.getName()); |
| | | } |
| | | } |
| | | |
| | |
| | | try |
| | | { |
| | | // Read dn2id. |
| | | EntryID entryID = dn2id.get(txn, newEntry.getDN(), LockMode.RMW); |
| | | EntryID entryID = dn2id.get(txn, newEntry.getName(), LockMode.RMW); |
| | | if (entryID == null) |
| | | { |
| | | // The entry does not exist. |
| | | Message message = |
| | | ERR_JEB_MODIFY_NO_SUCH_OBJECT.get(newEntry.getDN().toString()); |
| | | ERR_JEB_MODIFY_NO_SUCH_OBJECT.get(newEntry.getName().toString()); |
| | | DN matchedDN = getMatchedDN(baseDN); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, |
| | | message, matchedDN, null); |
| | |
| | | { |
| | | Transaction txn = beginTransaction(); |
| | | DN oldSuperiorDN = getParentWithinBase(currentDN); |
| | | DN newSuperiorDN = getParentWithinBase(entry.getDN()); |
| | | DN newSuperiorDN = getParentWithinBase(entry.getName()); |
| | | boolean isApexEntryMoved; |
| | | |
| | | if(oldSuperiorDN != null) |
| | |
| | | try |
| | | { |
| | | // Check whether the renamed entry already exists. |
| | | if (!currentDN.equals(entry.getDN()) && |
| | | dn2id.get(txn, entry.getDN(), LockMode.DEFAULT) != null) |
| | | if (!currentDN.equals(entry.getName()) && |
| | | dn2id.get(txn, entry.getName(), LockMode.DEFAULT) != null) |
| | | { |
| | | Message message = ERR_JEB_MODIFYDN_ALREADY_EXISTS.get( |
| | | entry.getDN().toString()); |
| | | entry.getName().toString()); |
| | | throw new DirectoryException(ResultCode.ENTRY_ALREADY_EXISTS, |
| | | message); |
| | | } |
| | |
| | | "Old entry ID: %d " + |
| | | "New entry ID: %d " + |
| | | "New Superior ID: %d" + |
| | | oldApexEntry.getDN(), entry.getDN(), |
| | | oldApexEntry.getName(), entry.getName(), |
| | | oldApexID.longValue(), newApexID.longValue(), |
| | | newSuperiorID.longValue()); |
| | | } |
| | |
| | | Entry oldEntry = id2entry.get(txn, oldID, LockMode.DEFAULT); |
| | | |
| | | // Construct the new DN of the entry. |
| | | DN newDN = modDN(oldEntry.getDN(), |
| | | DN newDN = modDN(oldEntry.getName(), |
| | | currentDN.size(), |
| | | entry.getDN()); |
| | | entry.getName()); |
| | | |
| | | // Assign a new entry ID if we are renumbering. |
| | | EntryID newID = oldID; |
| | |
| | | "New DN: %s " + |
| | | "Old entry ID: %d " + |
| | | "New entry ID: %d", |
| | | oldEntry.getDN(), newDN, oldID.longValue(), |
| | | oldEntry.getName(), newDN, oldID.longValue(), |
| | | newID.longValue()); |
| | | } |
| | | } |
| | |
| | | ModifyDNOperation modifyDNOperation) |
| | | throws DirectoryException, DatabaseException |
| | | { |
| | | if (!dn2id.insert(txn, newEntry.getDN(), newID)) |
| | | if (!dn2id.insert(txn, newEntry.getName(), newID)) |
| | | { |
| | | Message message = ERR_JEB_MODIFYDN_ALREADY_EXISTS.get( |
| | | newEntry.getDN().toString()); |
| | | newEntry.getName().toString()); |
| | | throw new DirectoryException(ResultCode.ENTRY_ALREADY_EXISTS, |
| | | message); |
| | | } |
| | |
| | | EntryID parentID; |
| | | byte[] parentIDKeyBytes; |
| | | boolean isParent = true; |
| | | for (DN dn = getParentWithinBase(newEntry.getDN()); dn != null; |
| | | for (DN dn = getParentWithinBase(newEntry.getName()); dn != null; |
| | | dn = getParentWithinBase(dn)) |
| | | { |
| | | parentID = dn2id.get(txn, dn, LockMode.DEFAULT); |
| | |
| | | MovedEntry tail) |
| | | throws DirectoryException, DatabaseException |
| | | { |
| | | DN oldDN = oldEntry.getDN(); |
| | | DN oldDN = oldEntry.getName(); |
| | | |
| | | // Remove the old DN from dn2id. |
| | | dn2id.remove(txn, oldDN); |
| | |
| | | MovedEntry tail) |
| | | throws DirectoryException, DatabaseException |
| | | { |
| | | DN oldDN = oldEntry.getDN(); |
| | | DN oldDN = oldEntry.getName(); |
| | | Entry newEntry = oldEntry.duplicate(false); |
| | | newEntry.setDN(newDN); |
| | | List<Modification> modifications = |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends.jeb; |
| | | import org.opends.messages.Message; |
| | |
| | | public boolean addEntry(Transaction txn, EntryID entryID, Entry entry) |
| | | throws DatabaseException, DirectoryException, JebException |
| | | { |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | if(entryDN.matchesBaseAndScope(baseDN, scope) && filter.matchesEntry(entry)) |
| | | { |
| | | return insertValues(txn, entryID.longValue(), entry); |
| | |
| | | public boolean addEntry(IndexBuffer buffer, EntryID entryID, Entry entry) |
| | | throws DirectoryException |
| | | { |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | if(entryDN.matchesBaseAndScope(baseDN, scope) && filter.matchesEntry(entry)) |
| | | { |
| | | SortValues sortValues = new SortValues(entryID, entry, sortOrder); |
| | |
| | | public boolean removeEntry(Transaction txn, EntryID entryID, Entry entry) |
| | | throws DatabaseException, DirectoryException, JebException |
| | | { |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | if(entryDN.matchesBaseAndScope(baseDN, scope) && filter.matchesEntry(entry)) |
| | | { |
| | | return removeValues(txn, entryID.longValue(), entry); |
| | |
| | | public boolean removeEntry(IndexBuffer buffer, EntryID entryID, Entry entry) |
| | | throws DirectoryException |
| | | { |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | if(entryDN.matchesBaseAndScope(baseDN, scope) && filter.matchesEntry(entry)) |
| | | { |
| | | SortValues sortValues = new SortValues(entryID, entry, sortOrder); |
| | |
| | | List<Modification> mods) |
| | | throws DatabaseException, DirectoryException, JebException |
| | | { |
| | | DN oldEntryDN = oldEntry.getDN(); |
| | | DN newEntryDN = newEntry.getDN(); |
| | | DN oldEntryDN = oldEntry.getName(); |
| | | DN newEntryDN = newEntry.getName(); |
| | | if(oldEntryDN.matchesBaseAndScope(baseDN, scope) && |
| | | filter.matchesEntry(oldEntry)) |
| | | { |
| | |
| | | List<Modification> mods) |
| | | throws DatabaseException, DirectoryException |
| | | { |
| | | DN oldEntryDN = oldEntry.getDN(); |
| | | DN newEntryDN = newEntry.getDN(); |
| | | DN oldEntryDN = oldEntry.getName(); |
| | | DN newEntryDN = newEntry.getName(); |
| | | if(oldEntryDN.matchesBaseAndScope(baseDN, scope) && |
| | | filter.matchesEntry(oldEntry)) |
| | | { |
| | |
| | | */ |
| | | public boolean shouldInclude(Entry entry) throws DirectoryException |
| | | { |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | if(entryDN.matchesBaseAndScope(baseDN, scope) && filter.matchesEntry(entry)) |
| | | { |
| | | return true; |
| | |
| | | else |
| | | { |
| | | if (!Arrays.equals(JebFormat.dnToDNKey( |
| | | entry.getDN(), verifyConfig.getBaseDN().size()), |
| | | entry.getName(), verifyConfig.getBaseDN().size()), |
| | | key.getData())) |
| | | { |
| | | errorCount++; |
| | |
| | | { |
| | | TRACER.debugError("File dn2id has DN <%s> referencing entry " + |
| | | "with wrong DN <%s>%n", new String(key.getData()), |
| | | entry.getDN().toNormalizedString()); |
| | | entry.getName().toNormalizedString()); |
| | | } |
| | | } |
| | | } |
| | |
| | | continue; |
| | | } |
| | | |
| | | if (!childEntry.getDN().isDescendantOf(entry.getDN()) || |
| | | childEntry.getDN().size() != |
| | | entry.getDN().size() + 1) |
| | | if (!childEntry.getName().isDescendantOf(entry.getName()) || |
| | | childEntry.getName().size() != |
| | | entry.getName().size() + 1) |
| | | { |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugError("File id2children has ID %d with DN <%s> " + |
| | | "referencing ID %d with non-child DN <%s>%n", |
| | | entryID.longValue(), entry.getDN().toString(), |
| | | id.longValue(), childEntry.getDN().toString()); |
| | | entryID.longValue(), entry.getName().toString(), |
| | | id.longValue(), childEntry.getName().toString()); |
| | | } |
| | | } |
| | | } |
| | |
| | | continue; |
| | | } |
| | | |
| | | if (!subordEntry.getDN().isDescendantOf(entry.getDN())) |
| | | if (!subordEntry.getName().isDescendantOf(entry.getName())) |
| | | { |
| | | errorCount++; |
| | | if (debugEnabled()) |
| | |
| | | TRACER.debugError("File id2subtree has ID %d with DN <%s> " + |
| | | "referencing ID %d with non-subordinate " + |
| | | "DN <%s>%n", |
| | | entryID.longValue(), entry.getDN().toString(), |
| | | id.longValue(), subordEntry.getDN().toString()); |
| | | entryID.longValue(), entry.getName().toString(), |
| | | id.longValue(), subordEntry.getName().toString()); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugError("Reference to entry " |
| | | + "<%s> which does not match the value%n%s", entry.getDN(), |
| | | + "<%s> which does not match the value%n%s", |
| | | entry.getName(), |
| | | keyDump(index, value)); |
| | | } |
| | | } |
| | |
| | | */ |
| | | private void verifyDN2ID(EntryID entryID, Entry entry) |
| | | { |
| | | DN dn = entry.getDN(); |
| | | DN dn = entry.getName(); |
| | | |
| | | // Check the ID is in dn2id with the correct DN. |
| | | try |
| | |
| | | */ |
| | | private void verifyID2Children(EntryID entryID, Entry entry) |
| | | { |
| | | DN dn = entry.getDN(); |
| | | DN dn = entry.getName(); |
| | | |
| | | DN parentDN = getParent(dn); |
| | | if (parentDN != null) |
| | |
| | | */ |
| | | private void verifyID2Subtree(EntryID entryID, Entry entry) |
| | | { |
| | | for (DN dn = getParent(entry.getDN()); dn != null; dn = getParent(dn)) |
| | | for (DN dn = getParent(entry.getName()); dn != null; dn = getParent(dn)) |
| | | { |
| | | EntryID id = null; |
| | | try |
| | |
| | | TRACER.debugError("Error normalizing values of attribute %s in " + |
| | | "entry <%s>: %s.%n", |
| | | attrIndex.getAttributeType().toString(), |
| | | entry.getDN().toString(), |
| | | entry.getName().toString(), |
| | | String.valueOf(e.getMessageObject())); |
| | | } |
| | | } |
| | |
| | | if(debugEnabled()) |
| | | { |
| | | TRACER.debugError("Missing entry %s in VLV index %s", |
| | | entry.getDN().toString(), |
| | | entry.getName().toString(), |
| | | vlvIndex.getName()); |
| | | } |
| | | errorCount++; |
| | |
| | | |
| | | TRACER.debugError("Error checking entry %s against filter or " + |
| | | "base DN for VLV index %s: %s", |
| | | entry.getDN().toString(), |
| | | entry.getName().toString(), |
| | | vlvIndex.getName(), |
| | | String.valueOf(e.getMessageObject())); |
| | | } |
| | |
| | | |
| | | TRACER.debugError("Error reading VLV index %s for entry %s: %s", |
| | | vlvIndex.getName(), |
| | | entry.getDN().toString(), |
| | | entry.getName().toString(), |
| | | StaticUtils.getBacktrace(e)); |
| | | } |
| | | errorCount++; |
| | |
| | | |
| | | TRACER.debugError("Error reading VLV index %s for entry %s: %s", |
| | | vlvIndex.getName(), |
| | | entry.getDN().toString(), |
| | | entry.getName().toString(), |
| | | StaticUtils.getBacktrace(e)); |
| | | } |
| | | errorCount++; |
| | |
| | | DirectoryException, JebException, InterruptedException |
| | | |
| | | { |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | DN2ID dn2id = suffix.getDN2ID(); |
| | | EntryID oldID = dn2id.get(null, entryDN, LockMode.DEFAULT); |
| | | if (oldID != null) |
| | |
| | | InterruptedException |
| | | |
| | | { |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | if (!skipDNValidation) |
| | | { |
| | | if (!dnSanityCheck(entryDN, entry, suffix)) |
| | |
| | | { |
| | | if (dn2id != null) |
| | | { |
| | | processDN2ID(suffix, entry.getDN(), entryID); |
| | | processDN2ID(suffix, entry.getName(), entryID); |
| | | } |
| | | if (dn2uri != null) |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends.task; |
| | | import java.text.SimpleDateFormat; |
| | |
| | | { |
| | | this.taskScheduler = taskScheduler; |
| | | this.recurringTaskEntry = recurringTaskEntry; |
| | | this.recurringTaskEntryDN = recurringTaskEntry.getDN(); |
| | | this.recurringTaskEntryDN = recurringTaskEntry.getName(); |
| | | |
| | | // Get the recurring task ID from the entry. If there isn't one, then fail. |
| | | AttributeType attrType = DirectoryServer.getAttributeType( |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends.task; |
| | | |
| | |
| | | { |
| | | this.taskScheduler = taskScheduler; |
| | | this.taskEntry = taskEntry; |
| | | this.taskEntryDN = taskEntry.getDN(); |
| | | this.taskEntryDN = taskEntry.getName(); |
| | | |
| | | String taskDN = taskEntryDN.toString(); |
| | | |
| | |
| | | if (recurringTaskID == null) |
| | | { |
| | | Message message = ERR_TASK_MISSING_ATTR.get( |
| | | String.valueOf(taskEntry.getDN()), ATTR_TASK_ID); |
| | | String.valueOf(taskEntry.getName()), ATTR_TASK_ID); |
| | | throw new InitializationException(message); |
| | | } |
| | | else |
| | |
| | | if (isRequired) |
| | | { |
| | | Message message = ERR_TASK_MISSING_ATTR.get( |
| | | String.valueOf(taskEntry.getDN()), attributeName); |
| | | String.valueOf(taskEntry.getName()), attributeName); |
| | | throw new InitializationException(message); |
| | | } |
| | | else |
| | |
| | | if (attrList.size() > 1) |
| | | { |
| | | Message message = ERR_TASK_MULTIPLE_ATTRS_FOR_TYPE.get( |
| | | attributeName, String.valueOf(taskEntry.getDN())); |
| | | attributeName, String.valueOf(taskEntry.getName())); |
| | | throw new InitializationException(message); |
| | | } |
| | | |
| | |
| | | if (isRequired) |
| | | { |
| | | Message message = ERR_TASK_NO_VALUES_FOR_ATTR.get( |
| | | attributeName, String.valueOf(taskEntry.getDN())); |
| | | attributeName, String.valueOf(taskEntry.getName())); |
| | | throw new InitializationException(message); |
| | | } |
| | | else |
| | |
| | | if (iterator.hasNext()) |
| | | { |
| | | Message message = ERR_TASK_MULTIPLE_VALUES_FOR_ATTR.get( |
| | | attributeName, String.valueOf(taskEntry.getDN())); |
| | | attributeName, String.valueOf(taskEntry.getName())); |
| | | throw new InitializationException(message); |
| | | } |
| | | |
| | |
| | | if (attrList.size() > 1) |
| | | { |
| | | Message message = ERR_TASK_MULTIPLE_ATTRS_FOR_TYPE.get( |
| | | attributeName, String.valueOf(taskEntry.getDN())); |
| | | attributeName, String.valueOf(taskEntry.getName())); |
| | | throw new InitializationException(message); |
| | | } |
| | | |
| | |
| | | taskState = TaskState.STOPPED_BY_ERROR; |
| | | |
| | | Message message = ERR_TASK_EXECUTE_FAILED.get( |
| | | String.valueOf(taskEntry.getDN()), stackTraceToSingleLineString(e)); |
| | | String.valueOf(taskEntry.getName()), stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | |
| | | Entry e = entry.duplicate(false); |
| | | |
| | | // Get the DN for the entry and then get its parent. |
| | | DN entryDN = e.getDN(); |
| | | DN entryDN = e.getName(); |
| | | DN parentDN = entryDN.getParentDNInSuffix(); |
| | | |
| | | if (parentDN == null) |
| | |
| | | public void replaceEntry(Entry oldEntry, Entry newEntry, |
| | | ModifyOperation modifyOperation) throws DirectoryException |
| | | { |
| | | DN entryDN = newEntry.getDN(); |
| | | DN entryDN = newEntry.getName(); |
| | | |
| | | Lock entryLock = null; |
| | | if (! taskScheduler.holdsSchedulerLock()) |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013 ForgeRock AS |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends.task; |
| | | |
| | |
| | | break; |
| | | } |
| | | |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | if (entryDN.equals(taskBackend.getTaskRootDN())) |
| | | { |
| | | taskRootEntry = entry; |
| | |
| | | { |
| | | for (Task t : tasks.values()) |
| | | { |
| | | if (taskEntryDN.equals(t.getTaskEntry().getDN())) |
| | | if (taskEntryDN.equals(t.getTaskEntry().getName())) |
| | | { |
| | | return t; |
| | | } |
| | |
| | | { |
| | | Entry taskEntry = task.getTaskEntry(); |
| | | |
| | | if (scheduledTaskEntryDN.equals(taskEntry.getDN())) |
| | | if (scheduledTaskEntryDN.equals(taskEntry.getName())) |
| | | { |
| | | return taskEntry.duplicate(true); |
| | | } |
| | |
| | | { |
| | | for (RecurringTask rt : recurringTasks.values()) |
| | | { |
| | | if (recurringTaskEntryDN.equals(rt.getRecurringTaskEntry().getDN())) |
| | | if (recurringTaskEntryDN.equals(rt.getRecurringTaskEntry().getName())) |
| | | { |
| | | return rt; |
| | | } |
| | |
| | | { |
| | | Entry recurringTaskEntry = recurringTask.getRecurringTaskEntry(); |
| | | |
| | | if (recurringTaskEntryDN.equals(recurringTaskEntry.getDN())) |
| | | if (recurringTaskEntryDN.equals(recurringTaskEntry.getName())) |
| | | { |
| | | return recurringTaskEntry.duplicate(true); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions copyright 2013 ForgeRock AS |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends.task; |
| | | |
| | |
| | | Task task = getAssociatedTask(); |
| | | |
| | | Message message = ERR_TASK_EXECUTE_FAILED. |
| | | get(String.valueOf(task.getTaskEntry().getDN()), |
| | | get(String.valueOf(task.getTaskEntry().getName()), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | task.setTaskState(TaskState.STOPPED_BY_ERROR); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.config; |
| | | |
| | |
| | | */ |
| | | public DN getDN() |
| | | { |
| | | return entry.getDN(); |
| | | return entry.getName(); |
| | | } |
| | | |
| | | |
| | |
| | | if (conflictingChild != null) |
| | | { |
| | | Message message = ERR_CONFIG_ENTRY_CONFLICTING_CHILD.get( |
| | | conflictingChild.getDN().toString(), entry.getDN().toString()); |
| | | conflictingChild.getDN().toString(), entry.getName().toString()); |
| | | throw new ConfigException(message); |
| | | } |
| | | } |
| | |
| | | if (childEntry == null) |
| | | { |
| | | Message message = ERR_CONFIG_ENTRY_NO_SUCH_CHILD.get( |
| | | childDN.toString(), entry.getDN().toString()); |
| | | childDN.toString(), entry.getName().toString()); |
| | | throw new ConfigException(message); |
| | | } |
| | | |
| | | if (childEntry.hasChildren()) |
| | | { |
| | | Message message = ERR_CONFIG_ENTRY_CANNOT_REMOVE_NONLEAF.get( |
| | | childDN.toString(), entry.getDN().toString()); |
| | | childDN.toString(), entry.getName().toString()); |
| | | throw new ConfigException(message); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | Message message = ERR_CONFIG_ENTRY_CANNOT_REMOVE_CHILD. |
| | | get(String.valueOf(childDN), String.valueOf(entry.getDN()), |
| | | get(String.valueOf(childDN), String.valueOf(entry.getName()), |
| | | stackTraceToSingleLineString(e)); |
| | | throw new ConfigException(message, e); |
| | | } |
| | |
| | | @Override |
| | | public String toString() |
| | | { |
| | | return entry.getDN().toNormalizedString(); |
| | | return entry.getName().toNormalizedString(); |
| | | } |
| | | } |
| | |
| | | if (state.isDisabled()) |
| | | { |
| | | Message message = ERR_PROXYAUTH1_UNUSABLE_ACCOUNT.get(String |
| | | .valueOf(userEntry.getDN())); |
| | | .valueOf(userEntry.getName())); |
| | | throw new DirectoryException(ResultCode.AUTHORIZATION_DENIED, message); |
| | | } |
| | | |
| | |
| | | if (state.isDisabled()) |
| | | { |
| | | Message message = ERR_PROXYAUTH2_UNUSABLE_ACCOUNT.get(String |
| | | .valueOf(userEntry.getDN())); |
| | | .valueOf(userEntry.getName())); |
| | | throw new DirectoryException(ResultCode.AUTHORIZATION_DENIED, message); |
| | | } |
| | | |
| | |
| | | pwpState.isPasswordExpired()) |
| | | { |
| | | Message message = ERR_PROXYAUTH2_UNUSABLE_ACCOUNT.get(String |
| | | .valueOf(userEntry.getDN())); |
| | | .valueOf(userEntry.getName())); |
| | | throw new DirectoryException(ResultCode.AUTHORIZATION_DENIED, |
| | | message); |
| | | } |
| | |
| | | lock.writeLock().lock(); |
| | | try |
| | | { |
| | | userMap.removeSubtree(entry.getDN(), arraySet); |
| | | userMap.removeSubtree(entry.getName(), arraySet); |
| | | } |
| | | finally |
| | | { |
| | |
| | | for (ClientConnection conn : connectionSet) |
| | | { |
| | | Message message = WARN_CLIENTCONNECTION_DISCONNECT_DUE_TO_DELETE.get( |
| | | String.valueOf(entry.getDN())); |
| | | String.valueOf(entry.getName())); |
| | | |
| | | conn.disconnect(DisconnectReason.INVALID_CREDENTIALS, true, message); |
| | | } |
| | |
| | | try |
| | | { |
| | | CopyOnWriteArraySet<ClientConnection> connectionSet = |
| | | userMap.get(oldEntry.getDN()); |
| | | userMap.get(oldEntry.getName()); |
| | | if (connectionSet != null) |
| | | { |
| | | for (ClientConnection conn : connectionSet) |
| | |
| | | PostResponseModifyDNOperation modifyDNOperation, |
| | | Entry oldEntry, Entry newEntry) |
| | | { |
| | | String oldDNString = oldEntry.getDN().toNormalizedString(); |
| | | String newDNString = newEntry.getDN().toNormalizedString(); |
| | | String oldDNString = oldEntry.getName().toNormalizedString(); |
| | | String newDNString = newEntry.getName().toNormalizedString(); |
| | | |
| | | // Identify any client connections that may be authenticated |
| | | // or authorized as the user whose entry has been modified |
| | |
| | | { |
| | | Set<CopyOnWriteArraySet<ClientConnection>> arraySet = |
| | | new HashSet<CopyOnWriteArraySet<ClientConnection>>(); |
| | | userMap.removeSubtree(oldEntry.getDN(), arraySet); |
| | | userMap.removeSubtree(oldEntry.getName(), arraySet); |
| | | for (CopyOnWriteArraySet<ClientConnection> |
| | | connectionSet : arraySet) |
| | | { |
| | |
| | | } |
| | | } |
| | | if ((newAuthNDN != null) && (authNDN != null) && |
| | | authNDN.isDescendantOf(oldEntry.getDN())) |
| | | authNDN.isDescendantOf(oldEntry.getName())) |
| | | { |
| | | if (newAuthNSet == null) |
| | | { |
| | |
| | | newAuthNSet.add(conn); |
| | | } |
| | | if ((newAuthZDN != null) && (authZDN != null) && |
| | | authZDN.isDescendantOf(oldEntry.getDN())) |
| | | authZDN.isDescendantOf(oldEntry.getName())) |
| | | { |
| | | if (newAuthZSet == null) |
| | | { |
| | |
| | | try |
| | | { |
| | | Group groupInstance = groupImplementation.newInstance(entry); |
| | | groupInstances.put(entry.getDN(), groupInstance); |
| | | groupInstances.put(entry.getName(), groupInstance); |
| | | refreshToken++; |
| | | } |
| | | catch (DirectoryException e) |
| | |
| | | lock.writeLock().lock(); |
| | | try |
| | | { |
| | | if (groupInstances.removeSubtree(entry.getDN(), null)) |
| | | if (groupInstances.removeSubtree(entry.getName(), null)) |
| | | { |
| | | refreshToken++; |
| | | } |
| | |
| | | lock.readLock().lock(); |
| | | try |
| | | { |
| | | if (!groupInstances.containsKey(oldEntry.getDN())) |
| | | if (!groupInstances.containsKey(oldEntry.getName())) |
| | | { |
| | | // If the modified entry is not in any group instance, it's probably |
| | | // not a group, exit fast |
| | |
| | | lock.writeLock().lock(); |
| | | try |
| | | { |
| | | if (groupInstances.containsKey(oldEntry.getDN())) |
| | | if (groupInstances.containsKey(oldEntry.getName())) |
| | | { |
| | | if (! oldEntry.getDN().equals(newEntry.getDN())) |
| | | if (! oldEntry.getName().equals(newEntry.getName())) |
| | | { |
| | | // This should never happen, but check for it anyway. |
| | | groupInstances.remove(oldEntry.getDN()); |
| | | groupInstances.remove(oldEntry.getName()); |
| | | } |
| | | createAndRegisterGroup(newEntry); |
| | | } |
| | |
| | | try |
| | | { |
| | | Set<Group> groupSet = new HashSet<Group>(); |
| | | groupInstances.removeSubtree(oldEntry.getDN(), groupSet); |
| | | String oldDNString = oldEntry.getDN().toNormalizedString(); |
| | | String newDNString = newEntry.getDN().toNormalizedString(); |
| | | groupInstances.removeSubtree(oldEntry.getName(), groupSet); |
| | | String oldDNString = oldEntry.getName().toNormalizedString(); |
| | | String newDNString = newEntry.getName().toNormalizedString(); |
| | | for (Group group : groupSet) |
| | | { |
| | | StringBuilder builder = new StringBuilder( |
| | |
| | | lock.writeLock().lock(); |
| | | try |
| | | { |
| | | groupInstances.put(entry.getDN(), groupInstance); |
| | | groupInstances.put(entry.getName(), groupInstance); |
| | | refreshToken++; |
| | | } |
| | | finally |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2011 ForgeRock AS. |
| | | * Portions Copyright 2011-2014 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.core; |
| | | |
| | |
| | | try |
| | | { |
| | | PasswordPolicy policy = new SubentryPasswordPolicy(new SubEntry(entry)); |
| | | DirectoryServer.registerAuthenticationPolicy(entry.getDN(), policy); |
| | | DirectoryServer.registerAuthenticationPolicy(entry.getName(), policy); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugError("Could not create password policy subentry " |
| | | + "DN %s: %s", entry.getDN().toString(), |
| | | + "DN %s: %s", entry.getName().toString(), |
| | | stackTraceToSingleLineString(e)); |
| | | } |
| | | } |
| | |
| | | { |
| | | if (entry.isPasswordPolicySubentry()) |
| | | { |
| | | DirectoryServer.deregisterAuthenticationPolicy(entry.getDN()); |
| | | DirectoryServer.deregisterAuthenticationPolicy(entry.getName()); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | if (oldEntry.isPasswordPolicySubentry()) |
| | | { |
| | | DirectoryServer.deregisterAuthenticationPolicy(oldEntry.getDN()); |
| | | DirectoryServer.deregisterAuthenticationPolicy(oldEntry.getName()); |
| | | } |
| | | |
| | | if (newEntry.isPasswordPolicySubentry()) |
| | |
| | | { |
| | | PasswordPolicy policy = new SubentryPasswordPolicy(new SubEntry( |
| | | newEntry)); |
| | | DirectoryServer.registerAuthenticationPolicy(newEntry.getDN(), policy); |
| | | DirectoryServer.registerAuthenticationPolicy(newEntry.getName(), |
| | | policy); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugError("Could not create password policy subentry " |
| | | + "DN %s: %s", newEntry.getDN().toString(), |
| | | + "DN %s: %s", newEntry.getName().toString(), |
| | | stackTraceToSingleLineString(e)); |
| | | } |
| | | } |
| | |
| | | { |
| | | if (oldEntry.isPasswordPolicySubentry()) |
| | | { |
| | | DirectoryServer.deregisterAuthenticationPolicy(oldEntry.getDN()); |
| | | DirectoryServer.deregisterAuthenticationPolicy(oldEntry.getName()); |
| | | } |
| | | |
| | | if (newEntry.isPasswordPolicySubentry()) |
| | |
| | | { |
| | | PasswordPolicy policy = new SubentryPasswordPolicy(new SubEntry( |
| | | newEntry)); |
| | | DirectoryServer.registerAuthenticationPolicy(newEntry.getDN(), policy); |
| | | DirectoryServer.registerAuthenticationPolicy(newEntry.getName(), |
| | | policy); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugError("Could not create password policy subentry " |
| | | + "DN %s: %s", newEntry.getDN().toString(), |
| | | + "DN %s: %s", newEntry.getName().toString(), |
| | | stackTraceToSingleLineString(e)); |
| | | } |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2013 ForgeRock AS |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.core; |
| | | |
| | |
| | | { |
| | | super(userEntry); |
| | | this.currentTime = currentTime; |
| | | this.userDNString = userEntry.getDN().toString(); |
| | | this.userDNString = userEntry.getName().toString(); |
| | | this.passwordPolicy = policy; |
| | | } |
| | | |
| | |
| | | // If this is a root user, or if the password policy says that we should |
| | | // ignore these problems, then log a warning message. Otherwise, cause |
| | | // the bind to fail. |
| | | if ((DirectoryServer.isRootDN(userEntry.getDN()) || |
| | | if ((DirectoryServer.isRootDN(userEntry.getName()) || |
| | | (passwordPolicy.getStateUpdateFailurePolicy() == |
| | | PasswordPolicyCfgDefn.StateUpdateFailurePolicy.IGNORE))) |
| | | { |
| | |
| | | switch (scope) |
| | | { |
| | | case BASE_OBJECT: |
| | | if (!baseDN.equals(entry.getDN())) |
| | | if (!baseDN.equals(entry.getName())) |
| | | { |
| | | return; |
| | | } |
| | | break; |
| | | case SINGLE_LEVEL: |
| | | if (!baseDN.equals(entry.getDN().getParentDNInSuffix())) |
| | | if (!baseDN.equals(entry.getName().getParentDNInSuffix())) |
| | | { |
| | | return; |
| | | } |
| | | break; |
| | | case WHOLE_SUBTREE: |
| | | if (!baseDN.isAncestorOf(entry.getDN())) |
| | | if (!baseDN.isAncestorOf(entry.getName())) |
| | | { |
| | | return; |
| | | } |
| | | break; |
| | | case SUBORDINATE_SUBTREE: |
| | | if (baseDN.equals(entry.getDN()) || (!baseDN.isAncestorOf(entry.getDN()))) |
| | | if (baseDN.equals(entry.getName()) || (!baseDN.isAncestorOf( |
| | | entry.getName()))) |
| | | { |
| | | return; |
| | | } |
| | |
| | | switch (scope) |
| | | { |
| | | case BASE_OBJECT: |
| | | if (!baseDN.equals(entry.getDN())) |
| | | if (!baseDN.equals(entry.getName())) |
| | | { |
| | | return; |
| | | } |
| | | break; |
| | | case SINGLE_LEVEL: |
| | | if (!baseDN.equals(entry.getDN().getParentDNInSuffix())) |
| | | if (!baseDN.equals(entry.getName().getParentDNInSuffix())) |
| | | { |
| | | return; |
| | | } |
| | | break; |
| | | case WHOLE_SUBTREE: |
| | | if (!baseDN.isAncestorOf(entry.getDN())) |
| | | if (!baseDN.isAncestorOf(entry.getName())) |
| | | { |
| | | return; |
| | | } |
| | | break; |
| | | case SUBORDINATE_SUBTREE: |
| | | if (baseDN.equals(entry.getDN()) || (!baseDN.isAncestorOf(entry.getDN()))) |
| | | if (baseDN.equals(entry.getName()) || (!baseDN.isAncestorOf( |
| | | entry.getName()))) |
| | | { |
| | | return; |
| | | } |
| | |
| | | switch (scope) |
| | | { |
| | | case BASE_OBJECT: |
| | | if (!baseDN.equals(oldEntry.getDN())) |
| | | if (!baseDN.equals(oldEntry.getName())) |
| | | { |
| | | return; |
| | | } |
| | | break; |
| | | case SINGLE_LEVEL: |
| | | if (!baseDN.equals(oldEntry.getDN().parent())) |
| | | if (!baseDN.equals(oldEntry.getName().parent())) |
| | | { |
| | | return; |
| | | } |
| | | break; |
| | | case WHOLE_SUBTREE: |
| | | if (!baseDN.isAncestorOf(oldEntry.getDN())) |
| | | if (!baseDN.isAncestorOf(oldEntry.getName())) |
| | | { |
| | | return; |
| | | } |
| | | break; |
| | | case SUBORDINATE_SUBTREE: |
| | | if (baseDN.equals(oldEntry.getDN()) |
| | | || (!baseDN.isAncestorOf(oldEntry.getDN()))) |
| | | if (baseDN.equals(oldEntry.getName()) |
| | | || (!baseDN.isAncestorOf(oldEntry.getName()))) |
| | | { |
| | | return; |
| | | } |
| | |
| | | { |
| | | case BASE_OBJECT: |
| | | oldMatches = baseDN.equals(oldDN); |
| | | newMatches = baseDN.equals(entry.getDN()); |
| | | newMatches = baseDN.equals(entry.getName()); |
| | | |
| | | if (!(oldMatches || newMatches)) |
| | | { |
| | |
| | | break; |
| | | case SINGLE_LEVEL: |
| | | oldMatches = baseDN.equals(oldDN.parent()); |
| | | newMatches = baseDN.equals(entry.getDN().parent()); |
| | | newMatches = baseDN.equals(entry.getName().parent()); |
| | | |
| | | if (!(oldMatches || newMatches)) |
| | | { |
| | |
| | | break; |
| | | case WHOLE_SUBTREE: |
| | | oldMatches = baseDN.isAncestorOf(oldDN); |
| | | newMatches = baseDN.isAncestorOf(entry.getDN()); |
| | | newMatches = baseDN.isAncestorOf(entry.getName()); |
| | | |
| | | if (!(oldMatches || newMatches)) |
| | | { |
| | |
| | | break; |
| | | case SUBORDINATE_SUBTREE: |
| | | oldMatches = ((!baseDN.equals(oldDN)) && baseDN.isAncestorOf(oldDN)); |
| | | newMatches = ((!baseDN.equals(entry.getDN())) && baseDN |
| | | .isAncestorOf(entry.getDN())); |
| | | newMatches = ((!baseDN.equals(entry.getName())) && baseDN |
| | | .isAncestorOf(entry.getName())); |
| | | |
| | | if (!(oldMatches || newMatches)) |
| | | { |
| | |
| | | |
| | | Message message = ERR_PLUGIN_LDIF_IMPORT_PLUGIN_EXCEPTION. |
| | | get(String.valueOf(p.getPluginEntryDN()), |
| | | String.valueOf(entry.getDN()), stackTraceToSingleLineString(e)); |
| | | String.valueOf(entry.getName()), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | return PluginResult.ImportLDIF.stopEntryProcessing(message); |
| | |
| | | { |
| | | Message message = ERR_PLUGIN_LDIF_IMPORT_PLUGIN_RETURNED_NULL. |
| | | get(String.valueOf(p.getPluginEntryDN()), |
| | | String.valueOf(entry.getDN())); |
| | | String.valueOf(entry.getName())); |
| | | logError(message); |
| | | |
| | | return PluginResult.ImportLDIF.stopEntryProcessing(message); |
| | |
| | | |
| | | Message message = ERR_PLUGIN_LDIF_EXPORT_PLUGIN_EXCEPTION. |
| | | get(String.valueOf(p.getPluginEntryDN()), |
| | | String.valueOf(entry.getDN()), stackTraceToSingleLineString(e)); |
| | | String.valueOf(entry.getName()), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | | return PluginResult.ImportLDIF.stopEntryProcessing(message); |
| | |
| | | { |
| | | Message message = ERR_PLUGIN_LDIF_EXPORT_PLUGIN_RETURNED_NULL. |
| | | get(String.valueOf(p.getPluginEntryDN()), |
| | | String.valueOf(entry.getDN())); |
| | | String.valueOf(entry.getName())); |
| | | logError(message); |
| | | |
| | | return PluginResult.ImportLDIF.stopEntryProcessing(message); |
| | |
| | | get(String.valueOf(p.getPluginEntryDN()), |
| | | searchOperation.getConnectionID(), |
| | | searchOperation.getOperationID(), |
| | | String.valueOf(searchEntry.getDN()), |
| | | String.valueOf(searchEntry.getName()), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | |
| | | get(String.valueOf(p.getPluginEntryDN()), |
| | | searchOperation.getConnectionID(), |
| | | searchOperation.getOperationID(), |
| | | String.valueOf(searchEntry.getDN())); |
| | | String.valueOf(searchEntry.getName())); |
| | | logError(message); |
| | | |
| | | return PluginResult.IntermediateResponse.stopProcessing(false, |
| | |
| | | get(String.valueOf(p.getPluginEntryDN()), |
| | | searchOperation.getConnectionID(), |
| | | searchOperation.getOperationID(), |
| | | String.valueOf(searchEntry.getDN()), |
| | | String.valueOf(searchEntry.getName()), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | |
| | |
| | | get(String.valueOf(p.getPluginEntryDN()), |
| | | searchOperation.getConnectionID(), |
| | | searchOperation.getOperationID(), |
| | | String.valueOf(searchEntry.getDN())); |
| | | String.valueOf(searchEntry.getName())); |
| | | logError(message); |
| | | |
| | | return PluginResult.IntermediateResponse.stopProcessing(false, |
| | |
| | | dn2SubEntry.put(subDN, subList); |
| | | } |
| | | } |
| | | dit2SubEntry.put(entry.getDN(), subEntry); |
| | | dit2SubEntry.put(entry.getName(), subEntry); |
| | | subList.add(subEntry); |
| | | } |
| | | finally |
| | |
| | | while (listIterator.hasNext()) |
| | | { |
| | | SubEntry subEntry = listIterator.next(); |
| | | if (subEntry.getDN().equals(entry.getDN())) |
| | | if (subEntry.getDN().equals(entry.getName())) |
| | | { |
| | | dit2SubEntry.remove(entry.getDN()); |
| | | dit2SubEntry.remove(entry.getName()); |
| | | listIterator.remove(); |
| | | removed = true; |
| | | break; |
| | |
| | | while (listIterator.hasNext()) |
| | | { |
| | | SubEntry subEntry = listIterator.next(); |
| | | if (subEntry.getDN().equals(entry.getDN())) |
| | | if (subEntry.getDN().equals(entry.getName())) |
| | | { |
| | | dit2SubEntry.remove(entry.getDN()); |
| | | dit2SubEntry.remove(entry.getName()); |
| | | listIterator.remove(); |
| | | removed = true; |
| | | break; |
| | |
| | | lock.readLock().lock(); |
| | | try |
| | | { |
| | | for (DN subDN = entry.getDN(); subDN != null; |
| | | for (DN subDN = entry.getName(); subDN != null; |
| | | subDN = subDN.parent()) |
| | | { |
| | | List<SubEntry> subList = dn2SubEntry.get(subDN); |
| | |
| | | lock.readLock().lock(); |
| | | try |
| | | { |
| | | for (DN subDN = entry.getDN(); subDN != null; |
| | | for (DN subDN = entry.getName(); subDN != null; |
| | | subDN = subDN.parent()) |
| | | { |
| | | List<SubEntry> subList = dn2CollectiveSubEntry.get(subDN); |
| | |
| | | lock.writeLock().lock(); |
| | | try |
| | | { |
| | | for (SubEntry subEntry : dit2SubEntry.getSubtree(entry.getDN())) |
| | | for (SubEntry subEntry : dit2SubEntry.getSubtree(entry.getName())) |
| | | { |
| | | removeSubEntry(subEntry.getEntry()); |
| | | |
| | |
| | | |
| | | private void doPostModifyDN(Entry oldEntry, Entry newEntry) |
| | | { |
| | | String oldDNString = oldEntry.getDN().toNormalizedString(); |
| | | String newDNString = newEntry.getDN().toNormalizedString(); |
| | | String oldDNString = oldEntry.getName().toNormalizedString(); |
| | | String newDNString = newEntry.getName().toNormalizedString(); |
| | | |
| | | lock.writeLock().lock(); |
| | | try |
| | | { |
| | | Collection<SubEntry> setToDelete = |
| | | dit2SubEntry.getSubtree(oldEntry.getDN()); |
| | | dit2SubEntry.getSubtree(oldEntry.getName()); |
| | | for (SubEntry subentry : setToDelete) |
| | | { |
| | | removeSubEntry(subentry.getEntry()); |
| | |
| | | try |
| | | { |
| | | StringBuilder builder = new StringBuilder( |
| | | subentry.getEntry().getDN().toNormalizedString()); |
| | | subentry.getEntry().getName().toNormalizedString()); |
| | | int oldDNIndex = builder.lastIndexOf(oldDNString); |
| | | builder.replace(oldDNIndex, builder.length(), |
| | | newDNString); |
| | |
| | | lock.readLock().lock(); |
| | | try |
| | | { |
| | | for (SubEntry subEntry : dit2SubEntry.getSubtree(entry.getDN())) |
| | | for (SubEntry subEntry : dit2SubEntry.getSubtree(entry.getName())) |
| | | { |
| | | if (!hasSubentryWritePrivilege) |
| | | { |
| | |
| | | { |
| | | Entry oldEntry = modifyDNOperation.getOriginalEntry(); |
| | | Entry newEntry = modifyDNOperation.getUpdatedEntry(); |
| | | String oldDNString = oldEntry.getDN().toNormalizedString(); |
| | | String newDNString = newEntry.getDN().toNormalizedString(); |
| | | String oldDNString = oldEntry.getName().toNormalizedString(); |
| | | String newDNString = newEntry.getName().toNormalizedString(); |
| | | boolean hasSubentryWritePrivilege = false; |
| | | |
| | | lock.readLock().lock(); |
| | | try |
| | | { |
| | | Collection<SubEntry> setToDelete = |
| | | dit2SubEntry.getSubtree(oldEntry.getDN()); |
| | | dit2SubEntry.getSubtree(oldEntry.getName()); |
| | | for (SubEntry subentry : setToDelete) |
| | | { |
| | | if (!hasSubentryWritePrivilege) |
| | |
| | | try |
| | | { |
| | | StringBuilder builder = new StringBuilder( |
| | | subentry.getEntry().getDN().toNormalizedString()); |
| | | subentry.getEntry().getName().toNormalizedString()); |
| | | int oldDNIndex = builder.lastIndexOf(oldDNString); |
| | | builder.replace(oldDNIndex, builder.length(), |
| | | newDNString); |
| | |
| | | final Entry entry = new Entry(entryDN, null, null, null); |
| | | entry.addObjectClass(DirectoryServer.getTopObjectClass()); |
| | | entry.addObjectClass(ocCertRequest); |
| | | AddOperation addOperation = icc.processAdd(entry.getDN(), |
| | | AddOperation addOperation = icc.processAdd(entry.getName(), |
| | | entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | |
| | | throw new DirectoryException( |
| | | addOperation.getResultCode(), |
| | | ERR_CRYPTOMGR_FAILED_TO_INITIATE_INSTANCE_KEY_GENERATION.get( |
| | | entry.getDN().toString())); |
| | | entry.getName().toString())); |
| | | } |
| | | } |
| | | else { |
| | |
| | | entry.addAttribute(certificateAttr, |
| | | new ArrayList<AttributeValue>(0)); |
| | | |
| | | AddOperation addOperation = icc.processAdd(entry.getDN(), |
| | | AddOperation addOperation = icc.processAdd(entry.getName(), |
| | | entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | |
| | | throw new DirectoryException( |
| | | addOperation.getResultCode(), |
| | | ERR_CRYPTOMGR_FAILED_TO_ADD_INSTANCE_KEY_ENTRY_TO_ADS.get( |
| | | entry.getDN().toString())); |
| | | entry.getName().toString())); |
| | | } |
| | | } |
| | | } catch (DirectoryException ex) { |
| | |
| | | { |
| | | throw new CryptoManagerException( |
| | | ERR_CRYPTOMGR_IMPORT_KEY_ENTRY_FAILED_TO_DECODE.get( |
| | | entry.getDN().toString())); |
| | | entry.getName().toString())); |
| | | } |
| | | secretKey = decodeSymmetricKeyAttribute(symmetricKey); |
| | | CipherKeyEntry.importCipherKeyEntry(this, keyID, transformation, |
| | |
| | | new Modification(ModificationType.ADD, attribute, |
| | | false)); |
| | | ModifyOperation internalModify = |
| | | internalConnection.processModify(entry.getDN(), |
| | | internalConnection.processModify(entry.getName(), |
| | | modifications); |
| | | if (internalModify.getResultCode() != ResultCode.SUCCESS) |
| | | { |
| | | throw new CryptoManagerException( |
| | | ERR_CRYPTOMGR_IMPORT_KEY_ENTRY_FAILED_TO_ADD_KEY.get( |
| | | entry.getDN().toString())); |
| | | entry.getName().toString())); |
| | | } |
| | | } |
| | | catch (DirectoryException ex) |
| | |
| | | } |
| | | throw new CryptoManagerException( |
| | | ERR_CRYPTOMGR_IMPORT_KEY_ENTRY_FAILED_OTHER.get( |
| | | entry.getDN().toString(), ex.getMessage()), ex); |
| | | entry.getName().toString(), ex.getMessage()), ex); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | throw new CryptoManagerException( |
| | | ERR_CRYPTOMGR_IMPORT_KEY_ENTRY_FAILED_TO_DECODE.get( |
| | | entry.getDN().toString())); |
| | | entry.getName().toString())); |
| | | } |
| | | secretKey = decodeSymmetricKeyAttribute(symmetricKey); |
| | | MacKeyEntry.importMacKeyEntry(this, keyID, algorithm, |
| | |
| | | new Modification(ModificationType.ADD, attribute, |
| | | false)); |
| | | ModifyOperation internalModify = |
| | | internalConnection.processModify(entry.getDN(), |
| | | internalConnection.processModify(entry.getName(), |
| | | modifications); |
| | | if (internalModify.getResultCode() != ResultCode.SUCCESS) |
| | | { |
| | | throw new CryptoManagerException( |
| | | ERR_CRYPTOMGR_IMPORT_KEY_ENTRY_FAILED_TO_ADD_KEY.get( |
| | | entry.getDN().toString())); |
| | | entry.getName().toString())); |
| | | } |
| | | } |
| | | else |
| | |
| | | } |
| | | throw new CryptoManagerException( |
| | | ERR_CRYPTOMGR_IMPORT_KEY_ENTRY_FAILED_OTHER.get( |
| | | entry.getDN().toString(), ex.getMessage()), ex); |
| | | entry.getName().toString(), ex.getMessage()), ex); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | throw new CryptoManagerException( |
| | | ERR_CRYPTOMGR_SYMMETRIC_KEY_ENTRY_ADD_FAILED.get( |
| | | entry.getDN().toString(), |
| | | entry.getName().toString(), |
| | | addOperation.getErrorMessage())); |
| | | } |
| | | } |
| | |
| | | { |
| | | throw new CryptoManagerException( |
| | | ERR_CRYPTOMGR_SYMMETRIC_KEY_ENTRY_ADD_FAILED.get( |
| | | entry.getDN().toString(), |
| | | entry.getName().toString(), |
| | | addOperation.getErrorMessage())); |
| | | } |
| | | } |
| | |
| | | private void handleInstanceKeySearchEntry(SearchResultEntry searchEntry) |
| | | throws DirectoryException |
| | | { |
| | | RDN srcRDN = searchEntry.getDN().rdn(); |
| | | RDN srcRDN = searchEntry.getName().rdn(); |
| | | |
| | | // Only process the entry if it has the expected form of RDN. |
| | | if (!srcRDN.isMultiValued() && |
| | |
| | | { |
| | | // The trust store backend does not implement modify so we need to |
| | | // delete then add. |
| | | DN dstDN = dstEntry.getDN(); |
| | | DN dstDN = dstEntry.getName(); |
| | | deleteEntry(dstDN); |
| | | addEntry(srcEntry, dstDN); |
| | | } |
| | |
| | | |
| | | private void handleInstanceKeyAddOperation(Entry entry) |
| | | { |
| | | RDN srcRDN = entry.getDN().rdn(); |
| | | RDN srcRDN = entry.getName().rdn(); |
| | | |
| | | // Only process the entry if it has the expected form of RDN. |
| | | if (!srcRDN.isMultiValued() && |
| | |
| | | return; |
| | | } |
| | | |
| | | RDN srcRDN = entry.getDN().rdn(); |
| | | RDN srcRDN = entry.getName().rdn(); |
| | | |
| | | // Only process the entry if it has the expected form of RDN. |
| | | // FIXME: Technically it is possible to perform a subtree in |
| | |
| | | |
| | | private void handleInstanceKeyModifyOperation(Entry newEntry) |
| | | { |
| | | RDN srcRDN = newEntry.getDN().rdn(); |
| | | RDN srcRDN = newEntry.getName().rdn(); |
| | | |
| | | // Only process the entry if it has the expected form of RDN. |
| | | if (!srcRDN.isMultiValued() && |
| | |
| | | { |
| | | bindOperation.setResultCode(ResultCode.INAPPROPRIATE_AUTHENTICATION); |
| | | Message message = ERR_SASL_ACCOUNT_NOT_LOCAL |
| | | .get(SASL_MECHANISM_CRAM_MD5, String.valueOf(userEntry.getDN())); |
| | | .get(SASL_MECHANISM_CRAM_MD5, String.valueOf(userEntry.getName())); |
| | | bindOperation.setAuthFailureReason(message); |
| | | return; |
| | | } |
| | |
| | | bindOperation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | Message message = ERR_SASLCRAMMD5_NO_REVERSIBLE_PASSWORDS.get( |
| | | String.valueOf(userEntry.getDN())); |
| | | String.valueOf(userEntry.getName())); |
| | | bindOperation.setAuthFailureReason(message); |
| | | return; |
| | | } |
| | |
| | | bindOperation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | Message message = ERR_SASLCRAMMD5_CANNOT_GET_REVERSIBLE_PASSWORDS.get( |
| | | String.valueOf(userEntry.getDN()), |
| | | String.valueOf(userEntry.getName()), |
| | | String.valueOf(e)); |
| | | bindOperation.setAuthFailureReason(message); |
| | | return; |
| | |
| | | bindOperation.setResultCode(ResultCode.SUCCESS); |
| | | |
| | | AuthenticationInfo authInfo = new AuthenticationInfo(userEntry, |
| | | SASL_MECHANISM_CRAM_MD5, DirectoryServer.isRootDN(userEntry.getDN())); |
| | | SASL_MECHANISM_CRAM_MD5, DirectoryServer.isRootDN(userEntry.getName())); |
| | | bindOperation.setAuthenticationInfo(authInfo); |
| | | } |
| | | |
| | |
| | | try |
| | | { |
| | | DN configRootDN = DN.valueOf(DN_CONFIG_ROOT); |
| | | if (! entry.getDN().equals(configRootDN)) |
| | | if (! entry.getName().equals(configRootDN)) |
| | | { |
| | | Message message = ERR_CONFIG_FILE_INVALID_BASE_DN.get( |
| | | f.getAbsolutePath(), entry.getDN().toString(), |
| | | f.getAbsolutePath(), entry.getName().toString(), |
| | | DN_CONFIG_ROOT); |
| | | throw new InitializationException(message); |
| | | } |
| | |
| | | // hash. |
| | | configEntries = new ConcurrentHashMap<DN,ConfigEntry>(); |
| | | configRootEntry = new ConfigEntry(entry, null); |
| | | configEntries.put(entry.getDN(), configRootEntry); |
| | | configEntries.put(entry.getName(), configRootEntry); |
| | | |
| | | |
| | | // Iterate through the rest of the configuration file and process the |
| | |
| | | |
| | | |
| | | // Make sure that the DN of the entry read doesn't already exist. |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | if (configEntries.containsKey(entryDN)) |
| | | { |
| | | close(reader); |
| | |
| | | { |
| | | // Make sure that the target DN does not already exist. If it does, then |
| | | // fail. |
| | | DN entryDN = e.getDN(); |
| | | DN entryDN = e.getName(); |
| | | if (configEntries.containsKey(entryDN)) |
| | | { |
| | | Message message = |
| | |
| | | synchronized (configLock) |
| | | { |
| | | // Get the DN of the target entry for future reference. |
| | | DN entryDN = e.getDN(); |
| | | DN entryDN = e.getName(); |
| | | |
| | | |
| | | // Get the target entry. If it does not exist, then fail. |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | } |
| | | |
| | | Message message = ERR_DYNAMICGROUP_CANNOT_DECODE_MEMBERURL. |
| | | get(v.getValue().toString(), String.valueOf(groupEntry.getDN()), |
| | | get(v.getValue().toString(), |
| | | String.valueOf(groupEntry.getName()), |
| | | de.getMessageObject()); |
| | | ErrorLogger.logError(message); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | return new DynamicGroup(groupEntry.getDN(), memberURLs); |
| | | return new DynamicGroup(groupEntry.getName(), memberURLs); |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | import org.opends.messages.Message; |
| | |
| | | if (! memberList.addResult(searchEntry)) |
| | | { |
| | | Message message = ERR_DYNAMICGROUP_CANNOT_RETURN_ENTRY. |
| | | get(String.valueOf(searchEntry.getDN()), |
| | | get(String.valueOf(searchEntry.getName()), |
| | | String.valueOf(memberList.getDynamicGroupDN())); |
| | | throw new DirectoryException( |
| | | DirectoryServer.getServerErrorResultCode(), message); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012-2013 ForgeRock AS |
| | | * Portions Copyright 2012-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | public Set<AttributeValue> getValues(Entry entry, |
| | | VirtualAttributeRule rule) |
| | | { |
| | | String normDNString = entry.getDN().toNormalizedString(); |
| | | String normDNString = entry.getName().toNormalizedString(); |
| | | AttributeValue value = AttributeValues.create( |
| | | ByteString.valueOf(normDNString), |
| | | ByteString.valueOf(normDNString)); |
| | |
| | | { |
| | | try |
| | | { |
| | | String normalizedDN = entry.getDN().toNormalizedString(); |
| | | String normalizedDN = entry.getName().toNormalizedString(); |
| | | String normalizedValue = value.getNormalizedValue().toString(); |
| | | return normalizedDN.equals(normalizedValue); |
| | | } |
| | |
| | | public boolean hasAnyValue(Entry entry, VirtualAttributeRule rule, |
| | | Collection<AttributeValue> values) |
| | | { |
| | | String ndnString = entry.getDN().toNormalizedString(); |
| | | String ndnString = entry.getName().toNormalizedString(); |
| | | |
| | | AttributeValue v = AttributeValues.create(ByteString.valueOf(ndnString), |
| | | ByteString.valueOf(ndnString)); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012-2013 ForgeRock AS |
| | | * Portions Copyright 2012-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | public Set<AttributeValue> getValues(Entry entry, |
| | | VirtualAttributeRule rule) |
| | | { |
| | | String normDNString = entry.getDN().toNormalizedString(); |
| | | String normDNString = entry.getName().toNormalizedString(); |
| | | String uuidString = |
| | | UUID.nameUUIDFromBytes(getBytes(normDNString)).toString(); |
| | | AttributeValue value = AttributeValues.create( |
| | |
| | | { |
| | | try |
| | | { |
| | | String normalizedDN = entry.getDN().toNormalizedString(); |
| | | String normalizedDN = entry.getName().toNormalizedString(); |
| | | String uuidString = |
| | | UUID.nameUUIDFromBytes(getBytes(normalizedDN)).toString(); |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions copyright 2013 ForgeRock AS |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | bindOperation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | Message message = ERR_SASLEXTERNAL_NO_CERT_IN_ENTRY.get( |
| | | String.valueOf(userEntry.getDN())); |
| | | String.valueOf(userEntry.getName())); |
| | | bindOperation.setAuthFailureReason(message); |
| | | return; |
| | | } |
| | |
| | | bindOperation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | Message message = ERR_SASLEXTERNAL_PEER_CERT_NOT_FOUND.get( |
| | | String.valueOf(userEntry.getDN())); |
| | | String.valueOf(userEntry.getName())); |
| | | bindOperation.setAuthFailureReason(message); |
| | | return; |
| | | } |
| | |
| | | bindOperation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | Message message = ERR_SASLEXTERNAL_CANNOT_VALIDATE_CERT.get( |
| | | String.valueOf(userEntry.getDN()), |
| | | String.valueOf(userEntry.getName()), |
| | | getExceptionMessage(e)); |
| | | bindOperation.setAuthFailureReason(message); |
| | | return; |
| | |
| | | bindOperation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | Message message = ERR_SASLEXTERNAL_PEER_CERT_NOT_FOUND.get( |
| | | String.valueOf(userEntry.getDN())); |
| | | String.valueOf(userEntry.getName())); |
| | | bindOperation.setAuthFailureReason(message); |
| | | return; |
| | | } |
| | |
| | | bindOperation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | Message message = ERR_SASLEXTERNAL_CANNOT_VALIDATE_CERT.get( |
| | | String.valueOf(userEntry.getDN()), |
| | | String.valueOf(userEntry.getName()), |
| | | getExceptionMessage(e)); |
| | | bindOperation.setAuthFailureReason(message); |
| | | return; |
| | |
| | | |
| | | |
| | | AuthenticationInfo authInfo = new AuthenticationInfo(userEntry, |
| | | SASL_MECHANISM_EXTERNAL, DirectoryServer.isRootDN(userEntry.getDN())); |
| | | SASL_MECHANISM_EXTERNAL, DirectoryServer.isRootDN(userEntry.getName())); |
| | | bindOperation.setAuthenticationInfo(authInfo); |
| | | bindOperation.setResultCode(ResultCode.SUCCESS); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2013 ForgeRock AS |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | long usedMemory = runtime.totalMemory() - runtime.freeMemory(); |
| | | if (usedMemory > maxAllowedMemory) |
| | | { |
| | | CacheEntry cachedEntry = dnMap.remove(entry.getDN()); |
| | | CacheEntry cachedEntry = dnMap.remove(entry.getName()); |
| | | if (cachedEntry == null) |
| | | { |
| | | // The current entry wasn't there, let's remove an existing entry. |
| | |
| | | { |
| | | // Add the entry to the cache. This will replace it if it is already |
| | | // present and add it if it isn't. |
| | | dnMap.put(entry.getDN(), cacheEntry); |
| | | dnMap.put(entry.getName(), cacheEntry); |
| | | |
| | | HashMap<Long,CacheEntry> map = idMap.get(backend); |
| | | if (map == null) |
| | |
| | | { |
| | | // See if the entry already exists in the cache. If it does, then we will |
| | | // fail and not actually store the entry. |
| | | if (dnMap.containsKey(entry.getDN())) |
| | | if (dnMap.containsKey(entry.getName())) |
| | | { |
| | | return false; |
| | | } |
| | |
| | | { |
| | | // Add the entry to the cache. This will replace it if it is already |
| | | // present and add it if it isn't. |
| | | dnMap.put(entry.getDN(), cacheEntry); |
| | | dnMap.put(entry.getName(), cacheEntry); |
| | | |
| | | HashMap<Long,CacheEntry> map = idMap.get(backend); |
| | | if (map == null) |
| | |
| | | int entriesDeleted = 0; |
| | | for (CacheEntry e : map.values()) |
| | | { |
| | | dnMap.remove(e.getEntry().getDN()); |
| | | dnMap.remove(e.getEntry().getName()); |
| | | entriesDeleted++; |
| | | |
| | | if ((entriesDeleted % 1000) == 0) |
| | |
| | | while (iterator.hasNext()) |
| | | { |
| | | CacheEntry e = iterator.next(); |
| | | DN entryDN = e.getEntry().getDN(); |
| | | DN entryDN = e.getEntry().getName(); |
| | | if (entryDN.isDescendantOf(baseDN)) |
| | | { |
| | | iterator.remove(); |
| | |
| | | // TODO: Cache the buffer? |
| | | ByteStringBuilder buffer = new ByteStringBuilder(); |
| | | entry.encode(buffer, encodeConfig); |
| | | putEntryToDB(entry.getDN().toNormalizedString(), |
| | | putEntryToDB(entry.getName().toNormalizedString(), |
| | | backend, entryID, buffer); |
| | | } catch (Exception e) { |
| | | if (debugEnabled()) { |
| | |
| | | // See if the entry already exists in the cache. If it does, then we |
| | | // will fail and not actually store the entry. |
| | | if (entryCacheIndex.dnMap.containsKey( |
| | | entry.getDN().toNormalizedString())) { |
| | | entry.getName().toNormalizedString())) { |
| | | return false; |
| | | } |
| | | } finally { |
| | |
| | | // TODO: Cache the buffer? |
| | | ByteStringBuilder buffer = new ByteStringBuilder(); |
| | | entry.encode(buffer, encodeConfig); |
| | | return putEntryToDB(entry.getDN().toNormalizedString(), |
| | | return putEntryToDB(entry.getName().toNormalizedString(), |
| | | backend, entryID, buffer); |
| | | } catch (Exception e) { |
| | | if (debugEnabled()) { |
| | |
| | | } |
| | | else |
| | | { |
| | | return e.getDN(); |
| | | return e.getName(); |
| | | } |
| | | } |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2007-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | * Portions Copyright 2012-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | else |
| | | { |
| | | Message message = ERR_FCM_MULTIPLE_MATCHING_ENTRIES. |
| | | get(fingerprintString, String.valueOf(userEntry.getDN()), |
| | | String.valueOf(entry.getDN())); |
| | | get(fingerprintString, String.valueOf(userEntry.getName()), |
| | | String.valueOf(entry.getName())); |
| | | throw new DirectoryException(ResultCode.INVALID_CREDENTIALS, message); |
| | | } |
| | | } |
| | |
| | | AcceptRejectWarn structuralPolicy, |
| | | Entry entry) |
| | | { |
| | | RDN rdn = entry.getDN().rdn(); |
| | | RDN rdn = entry.getName().rdn(); |
| | | if (rdn != null) |
| | | { |
| | | // Make sure that all the required attributes are present. |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012-2013 ForgeRock AS |
| | | * Portions Copyright 2012-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | public Set<AttributeValue> getValues(Entry entry, |
| | | VirtualAttributeRule rule) |
| | | { |
| | | Backend backend = DirectoryServer.getBackend(entry.getDN()); |
| | | Backend backend = DirectoryServer.getBackend(entry.getName()); |
| | | |
| | | try |
| | | { |
| | | ConditionResult ret = backend.hasSubordinates(entry.getDN()); |
| | | ConditionResult ret = backend.hasSubordinates(entry.getName()); |
| | | if(ret != null && ret != ConditionResult.UNDEFINED) |
| | | { |
| | | AttributeValue value = |
| | |
| | | @Override() |
| | | public boolean hasValue(Entry entry, VirtualAttributeRule rule) |
| | | { |
| | | Backend backend = DirectoryServer.getBackend(entry.getDN()); |
| | | Backend backend = DirectoryServer.getBackend(entry.getName()); |
| | | |
| | | try |
| | | { |
| | | ConditionResult ret = backend.hasSubordinates(entry.getDN()); |
| | | ConditionResult ret = backend.hasSubordinates(entry.getName()); |
| | | return ret != null && ret != ConditionResult.UNDEFINED; |
| | | } |
| | | catch(DirectoryException de) |
| | |
| | | public boolean hasValue(Entry entry, VirtualAttributeRule rule, |
| | | AttributeValue value) |
| | | { |
| | | Backend backend = DirectoryServer.getBackend(entry.getDN()); |
| | | Backend backend = DirectoryServer.getBackend(entry.getName()); |
| | | |
| | | try |
| | | { |
| | | ConditionResult ret = backend.hasSubordinates(entry.getDN()); |
| | | ConditionResult ret = backend.hasSubordinates(entry.getName()); |
| | | return ret != null |
| | | && ret != ConditionResult.UNDEFINED |
| | | && ConditionResult.valueOf(value.getNormalizedValue().toString()) |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2011-2013 ForgeRock AS. |
| | | * Portions Copyright 2011-2014 ForgeRock AS. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | |
| | | InternalClientConnection conn = InternalClientConnection |
| | | .getRootConnection(); |
| | | ModifyOperation internalModify = conn.processModify(userEntry |
| | | .getDN().toString(), modifications); |
| | | .getName().toString(), modifications); |
| | | |
| | | ResultCode resultCode = internalModify.getResultCode(); |
| | | if (resultCode != ResultCode.SUCCESS) |
| | |
| | | { |
| | | TRACER.debugWarning( |
| | | "An error occurred while trying to update the LDAP PTA " |
| | | + "cached password for user %s: %s", userEntry.getDN() |
| | | + "cached password for user %s: %s", userEntry.getName() |
| | | .toString(), String.valueOf(internalModify |
| | | .getErrorMessage())); |
| | | } |
| | |
| | | { |
| | | case UNMAPPED: |
| | | // The bind DN is the name of the user's entry. |
| | | username = ByteString.valueOf(userEntry.getDN().toString()); |
| | | username = ByteString.valueOf(userEntry.getName().toString()); |
| | | break; |
| | | case MAPPED_BIND: |
| | | // The bind DN is contained in an attribute in the user's entry. |
| | |
| | | */ |
| | | throw new DirectoryException(ResultCode.INVALID_CREDENTIALS, |
| | | ERR_LDAP_PTA_MAPPING_ATTRIBUTE_NOT_FOUND.get( |
| | | String.valueOf(userEntry.getDN()), |
| | | String.valueOf(userEntry.getName()), |
| | | String.valueOf(cfg.dn()), |
| | | mappedAttributesAsString(cfg.getMappedAttribute()))); |
| | | } |
| | |
| | | */ |
| | | throw new DirectoryException(ResultCode.INVALID_CREDENTIALS, |
| | | ERR_LDAP_PTA_MAPPING_ATTRIBUTE_NOT_FOUND.get( |
| | | String.valueOf(userEntry.getDN()), |
| | | String.valueOf(userEntry.getName()), |
| | | String.valueOf(cfg.dn()), |
| | | mappedAttributesAsString(cfg.getMappedAttribute()))); |
| | | } |
| | |
| | | // More than one matching entry was returned. |
| | | throw new DirectoryException(ResultCode.INVALID_CREDENTIALS, |
| | | ERR_LDAP_PTA_MAPPED_SEARCH_TOO_MANY_CANDIDATES.get( |
| | | String.valueOf(userEntry.getDN()), |
| | | String.valueOf(userEntry.getName()), |
| | | String.valueOf(cfg.dn()), String.valueOf(baseDN), |
| | | String.valueOf(filter))); |
| | | default: |
| | |
| | | // error. |
| | | throw new DirectoryException(ResultCode.INVALID_CREDENTIALS, |
| | | ERR_LDAP_PTA_MAPPED_SEARCH_FAILED.get( |
| | | String.valueOf(userEntry.getDN()), |
| | | String.valueOf(userEntry.getName()), |
| | | String.valueOf(cfg.dn()), e.getMessageObject()), e); |
| | | } |
| | | } |
| | |
| | | */ |
| | | throw new DirectoryException(ResultCode.INVALID_CREDENTIALS, |
| | | ERR_LDAP_PTA_MAPPED_SEARCH_NO_CANDIDATES.get( |
| | | String.valueOf(userEntry.getDN()), |
| | | String.valueOf(userEntry.getName()), |
| | | String.valueOf(cfg.dn()), String.valueOf(filter))); |
| | | } |
| | | |
| | |
| | | // error. |
| | | throw new DirectoryException(ResultCode.INVALID_CREDENTIALS, |
| | | ERR_LDAP_PTA_MAPPED_BIND_FAILED.get( |
| | | String.valueOf(userEntry.getDN()), |
| | | String.valueOf(userEntry.getName()), |
| | | String.valueOf(cfg.dn()), e.getMessageObject()), e); |
| | | } |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions copyright 2011-2012 ForgeRock AS |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | import org.opends.messages.Message; |
| | |
| | | } |
| | | |
| | | Group<?> g = |
| | | DirectoryServer.getGroupManager().getGroupInstance(entry.getDN()); |
| | | DirectoryServer.getGroupManager().getGroupInstance(entry.getName()); |
| | | if (g == null) |
| | | { |
| | | return Collections.emptySet(); |
| | |
| | | public boolean hasValue(Entry entry, VirtualAttributeRule rule) |
| | | { |
| | | Group<?> g = |
| | | DirectoryServer.getGroupManager().getGroupInstance(entry.getDN()); |
| | | DirectoryServer.getGroupManager().getGroupInstance(entry.getName()); |
| | | if (g == null) |
| | | { |
| | | return false; |
| | |
| | | AttributeValue value) |
| | | { |
| | | Group<?> g = |
| | | DirectoryServer.getGroupManager().getGroupInstance(entry.getDN()); |
| | | DirectoryServer.getGroupManager().getGroupInstance(entry.getName()); |
| | | if (g == null) |
| | | { |
| | | return false; |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012-2013 ForgeRock AS |
| | | * Portions Copyright 2012-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | public Set<AttributeValue> getValues(Entry entry, |
| | | VirtualAttributeRule rule) |
| | | { |
| | | Backend backend = DirectoryServer.getBackend(entry.getDN()); |
| | | Backend backend = DirectoryServer.getBackend(entry.getName()); |
| | | |
| | | try |
| | | { |
| | | long count = backend.numSubordinates(entry.getDN(), false); |
| | | long count = backend.numSubordinates(entry.getName(), false); |
| | | if(count >= 0) |
| | | { |
| | | AttributeValue value = |
| | |
| | | @Override() |
| | | public boolean hasValue(Entry entry, VirtualAttributeRule rule) |
| | | { |
| | | Backend backend = DirectoryServer.getBackend(entry.getDN()); |
| | | Backend backend = DirectoryServer.getBackend(entry.getName()); |
| | | |
| | | try |
| | | { |
| | | return backend.numSubordinates(entry.getDN(), false) >= 0; |
| | | return backend.numSubordinates(entry.getName(), false) >= 0; |
| | | } |
| | | catch(DirectoryException de) |
| | | { |
| | |
| | | public boolean hasValue(Entry entry, VirtualAttributeRule rule, |
| | | AttributeValue value) |
| | | { |
| | | Backend backend = DirectoryServer.getBackend(entry.getDN()); |
| | | Backend backend = DirectoryServer.getBackend(entry.getName()); |
| | | |
| | | try |
| | | { |
| | | long count = backend.numSubordinates(entry.getDN(), false); |
| | | long count = backend.numSubordinates(entry.getName(), false); |
| | | return count >= 0 |
| | | && Long.parseLong(value.getNormalizedValue().toString()) == count; |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2012 profiq s.r.o. |
| | | * Portions Copyright 2012-2013 ForgeRock AS |
| | | * Portions Copyright 2012-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | { |
| | | TRACER.debugError("Failed to retrieve password " + |
| | | "policy for user %s: %s", |
| | | entry.getDN().toString(), |
| | | entry.getName().toString(), |
| | | stackTraceToSingleLineString(de)); |
| | | } |
| | | } |
| | |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugError("No applicable password policy for user %s", entry |
| | | .getDN().toString()); |
| | | .getName().toString()); |
| | | } |
| | | } |
| | | else if (policy.isPasswordPolicy()) |
| | |
| | | { |
| | | TRACER.debugError("Failed to retrieve password " + |
| | | "policy state for user %s: %s", |
| | | entry.getDN().toString(), |
| | | entry.getName().toString(), |
| | | stackTraceToSingleLineString(de)); |
| | | } |
| | | } |
| | |
| | | { |
| | | TRACER.debugVerbose("Authentication policy %s found for user %s is " |
| | | + "not a password policy", policy.getDN().toString(), entry |
| | | .getDN().toString()); |
| | | .getName().toString()); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | // Retrieve a write lock on that user's entry. |
| | | userDN = requestorEntry.getDN(); |
| | | userDN = requestorEntry.getName(); |
| | | |
| | | userLock = LockManager.lockWrite(userDN); |
| | | if (userLock == null) |
| | |
| | | return; |
| | | } |
| | | |
| | | userDN = userEntry.getDN(); |
| | | userDN = userEntry.getName(); |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | |
| | | return; |
| | | } |
| | | |
| | | userDN = userEntry.getDN(); |
| | | userDN = userEntry.getName(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | selfChange = userDN.equals(requestorEntry.getDN()); |
| | | selfChange = userDN.equals(requestorEntry.getName()); |
| | | } |
| | | |
| | | if (! selfChange) |
| | |
| | | } |
| | | |
| | | // Get an internal connection and use it to perform the modification. |
| | | boolean isRoot = DirectoryServer.isRootDN(requestorEntry.getDN()); |
| | | boolean isRoot = DirectoryServer.isRootDN(requestorEntry.getName()); |
| | | AuthenticationInfo authInfo = new AuthenticationInfo(requestorEntry, |
| | | isRoot); |
| | | InternalClientConnection internalConnection = new |
| | |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2011-2013 ForgeRock AS. |
| | | * Portions Copyright 2011-2014 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | { |
| | | TRACER.debugError("Failed to retrieve password " + |
| | | "policy for user %s: %s", |
| | | entry.getDN().toString(), |
| | | entry.getName().toString(), |
| | | stackTraceToSingleLineString(de)); |
| | | } |
| | | } |
| | |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugError("No applicable password policy for user %s", entry |
| | | .getDN().toString()); |
| | | .getName().toString()); |
| | | } |
| | | } |
| | | else if (policy.isPasswordPolicy()) |
| | |
| | | { |
| | | TRACER.debugVerbose("Authentication policy %s found for user %s is " |
| | | + "not a password policy", policy.getDN().toString(), entry |
| | | .getDN().toString()); |
| | | .getName().toString()); |
| | | } |
| | | } |
| | | } |
| | |
| | | authzDN = actualAuthzDN; |
| | | } |
| | | |
| | | if (! authzDN.equals(userEntry.getDN())) |
| | | if (! authzDN.equals(userEntry.getName())) |
| | | { |
| | | AuthenticationInfo tempAuthInfo = |
| | | new AuthenticationInfo(userEntry, |
| | | DirectoryServer.isRootDN(userEntry.getDN())); |
| | | DirectoryServer.isRootDN(userEntry.getName())); |
| | | InternalClientConnection tempConn = |
| | | new InternalClientConnection(tempAuthInfo); |
| | | if (! tempConn.hasPrivilege(Privilege.PROXIED_AUTH, bindOperation)) |
| | |
| | | bindOperation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | Message message = ERR_SASLPLAIN_AUTHZID_INSUFFICIENT_PRIVILEGES.get( |
| | | String.valueOf(userEntry.getDN())); |
| | | String.valueOf(userEntry.getName())); |
| | | bindOperation.setAuthFailureReason(message); |
| | | return; |
| | | } |
| | |
| | | } |
| | | |
| | | if ((authZEntry == null) || |
| | | (! authZEntry.getDN().equals(userEntry.getDN()))) |
| | | (! authZEntry.getName().equals(userEntry.getName()))) |
| | | { |
| | | AuthenticationInfo tempAuthInfo = |
| | | new AuthenticationInfo(userEntry, |
| | | DirectoryServer.isRootDN(userEntry.getDN())); |
| | | DirectoryServer.isRootDN(userEntry.getName())); |
| | | InternalClientConnection tempConn = |
| | | new InternalClientConnection(tempAuthInfo); |
| | | if (! tempConn.hasPrivilege(Privilege.PROXIED_AUTH, bindOperation)) |
| | |
| | | bindOperation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | Message message = ERR_SASLPLAIN_AUTHZID_INSUFFICIENT_PRIVILEGES.get( |
| | | String.valueOf(userEntry.getDN())); |
| | | String.valueOf(userEntry.getName())); |
| | | bindOperation.setAuthFailureReason(message); |
| | | return; |
| | | } |
| | |
| | | bindOperation.setResultCode(ResultCode.INVALID_CREDENTIALS); |
| | | |
| | | Message message = ERR_SASLPLAIN_CANNOT_CHECK_PASSWORD_VALIDITY.get( |
| | | String.valueOf(userEntry.getDN()), |
| | | String.valueOf(userEntry.getName()), |
| | | String.valueOf(e)); |
| | | bindOperation.setAuthFailureReason(message); |
| | | return; |
| | |
| | | AuthenticationInfo authInfo = |
| | | new AuthenticationInfo(userEntry, authZEntry, SASL_MECHANISM_PLAIN, |
| | | bindOperation.getSASLCredentials(), |
| | | DirectoryServer.isRootDN(userEntry.getDN())); |
| | | DirectoryServer.isRootDN(userEntry.getName())); |
| | | bindOperation.setAuthenticationInfo(authInfo); |
| | | return; |
| | | } |
| | |
| | | bindOp.setSASLAuthUserEntry(authEntry); |
| | | final AuthenticationInfo authInfo = new AuthenticationInfo(authEntry, |
| | | authzEntry, mechanism, clientCredentials, |
| | | DirectoryServer.isRootDN(authEntry.getDN())); |
| | | DirectoryServer.isRootDN(authEntry.getName())); |
| | | bindOp.setAuthenticationInfo(authInfo); |
| | | |
| | | // If confidentiality/integrity has been negotiated then |
| | |
| | | bindOp.setSASLAuthUserEntry(authEntry); |
| | | final AuthenticationInfo authInfo = new AuthenticationInfo(authEntry, |
| | | authzEntry, mechanism, clientCredentials, |
| | | DirectoryServer.isRootDN(authEntry.getDN())); |
| | | DirectoryServer.isRootDN(authEntry.getName())); |
| | | bindOp.setAuthenticationInfo(authInfo); |
| | | |
| | | // If confidentiality/integrity has been negotiated, then create a |
| | |
| | | authzDN = actualAuthzDN; |
| | | } |
| | | |
| | | if (!authzDN.equals(authEntry.getDN())) |
| | | if (!authzDN.equals(authEntry.getName())) |
| | | { |
| | | if (authzDN.isRootDN()) |
| | | { |
| | |
| | | } |
| | | } |
| | | final AuthenticationInfo authInfo = new AuthenticationInfo(authEntry, |
| | | DirectoryServer.isRootDN(authEntry.getDN())); |
| | | DirectoryServer.isRootDN(authEntry.getName())); |
| | | if (!hasPrivilege(authInfo)) |
| | | { |
| | | callback.setAuthorized(false); |
| | |
| | | } |
| | | } |
| | | |
| | | if ((authzEntry == null) || (!authzEntry.getDN().equals(authEntry.getDN()))) |
| | | if ((authzEntry == null) || (!authzEntry.getName(). |
| | | equals(authEntry.getName()))) |
| | | { |
| | | // Create temporary authorization information and run it both |
| | | // through the privilege and then the access control subsystems. |
| | | final AuthenticationInfo authInfo = new AuthenticationInfo(authEntry, |
| | | DirectoryServer.isRootDN(authEntry.getDN())); |
| | | DirectoryServer.isRootDN(authEntry.getName())); |
| | | if (!hasPrivilege(authInfo)) |
| | | { |
| | | callback.setAuthorized(false); |
| | |
| | | .mayProxy(authInfo.getAuthenticationEntry(), e, bindOp)) |
| | | { |
| | | setCallbackMsg(ERR_SASL_AUTHZID_INSUFFICIENT_ACCESS.get(String |
| | | .valueOf(authEntry.getDN()))); |
| | | .valueOf(authEntry.getName()))); |
| | | ret = false; |
| | | } |
| | | |
| | |
| | | if (!tempConn.hasPrivilege(Privilege.PROXIED_AUTH, bindOp)) |
| | | { |
| | | setCallbackMsg(ERR_SASL_AUTHZID_INSUFFICIENT_PRIVILEGES.get(String |
| | | .valueOf(authEntry.getDN()))); |
| | | .valueOf(authEntry.getName()))); |
| | | ret = false; |
| | | } |
| | | return ret; |
| | |
| | | if (!authState.isPasswordPolicy()) |
| | | { |
| | | final Message message = ERR_SASL_ACCOUNT_NOT_LOCAL.get(mechanism, |
| | | String.valueOf(authEntry.getDN())); |
| | | String.valueOf(authEntry.getName())); |
| | | setCallbackMsg(ResultCode.INAPPROPRIATE_AUTHENTICATION, message); |
| | | return; |
| | | } |
| | |
| | | if ((clearPasswords == null) || clearPasswords.isEmpty()) |
| | | { |
| | | setCallbackMsg(ERR_SASL_NO_REVERSIBLE_PASSWORDS.get(mechanism, |
| | | String.valueOf(authEntry.getDN()))); |
| | | String.valueOf(authEntry.getName()))); |
| | | return; |
| | | } |
| | | } |
| | |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | setCallbackMsg(ERR_SASL_CANNOT_GET_REVERSIBLE_PASSWORDS.get( |
| | | String.valueOf(authEntry.getDN()), mechanism, String.valueOf(e))); |
| | | String.valueOf(authEntry.getName()), mechanism, String.valueOf(e))); |
| | | return; |
| | | } |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2013 ForgeRock AS |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | SoftReference<CacheEntry> ref = |
| | | new SoftReference<CacheEntry>(cacheEntry, referenceQueue); |
| | | |
| | | SoftReference<CacheEntry> oldRef = dnMap.put(entry.getDN(), ref); |
| | | SoftReference<CacheEntry> oldRef = dnMap.put(entry.getName(), ref); |
| | | if (oldRef != null) |
| | | { |
| | | oldRef.clear(); |
| | |
| | | long entryID) |
| | | { |
| | | // See if the entry already exists. If so, then return false. |
| | | if (dnMap.containsKey(entry.getDN())) |
| | | if (dnMap.containsKey(entry.getName())) |
| | | { |
| | | return false; |
| | | } |
| | |
| | | SoftReference<CacheEntry> ref = |
| | | new SoftReference<CacheEntry>(cacheEntry, referenceQueue); |
| | | |
| | | dnMap.put(entry.getDN(), ref); |
| | | dnMap.put(entry.getName(), ref); |
| | | |
| | | ConcurrentHashMap<Long,SoftReference<CacheEntry>> map = idMap.get(backend); |
| | | if (map == null) |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | if (groupEntry.hasObjectClass(groupOfNamesClass)) |
| | | { |
| | | Message message = ERR_STATICGROUP_INVALID_OC_COMBINATION. |
| | | get(String.valueOf(groupEntry.getDN()), OC_GROUP_OF_ENTRIES, |
| | | get(String.valueOf(groupEntry.getName()), OC_GROUP_OF_ENTRIES, |
| | | OC_GROUP_OF_NAMES); |
| | | throw new DirectoryException(ResultCode.OBJECTCLASS_VIOLATION, message); |
| | | } |
| | | else if (groupEntry.hasObjectClass(groupOfUniqueNamesClass)) |
| | | { |
| | | Message message = ERR_STATICGROUP_INVALID_OC_COMBINATION. |
| | | get(String.valueOf(groupEntry.getDN()), OC_GROUP_OF_ENTRIES, |
| | | get(String.valueOf(groupEntry.getName()), OC_GROUP_OF_ENTRIES, |
| | | OC_GROUP_OF_UNIQUE_NAMES); |
| | | throw new DirectoryException(ResultCode.OBJECTCLASS_VIOLATION, message); |
| | | } |
| | |
| | | if (groupEntry.hasObjectClass(groupOfUniqueNamesClass)) |
| | | { |
| | | Message message = ERR_STATICGROUP_INVALID_OC_COMBINATION. |
| | | get(String.valueOf(groupEntry.getDN()), OC_GROUP_OF_NAMES, |
| | | get(String.valueOf(groupEntry.getName()), OC_GROUP_OF_NAMES, |
| | | OC_GROUP_OF_UNIQUE_NAMES); |
| | | throw new DirectoryException(ResultCode.OBJECTCLASS_VIOLATION, message); |
| | | } |
| | |
| | | else |
| | | { |
| | | Message message = ERR_STATICGROUP_NO_VALID_OC. |
| | | get(String.valueOf(groupEntry.getDN()), OC_GROUP_OF_NAMES, |
| | | get(String.valueOf(groupEntry.getName()), OC_GROUP_OF_NAMES, |
| | | OC_GROUP_OF_UNIQUE_NAMES); |
| | | throw new DirectoryException(ResultCode.OBJECTCLASS_VIOLATION, message); |
| | | } |
| | |
| | | Message message = ERR_STATICGROUP_CANNOT_DECODE_MEMBER_VALUE_AS_DN. |
| | | get(v.getValue().toString(), |
| | | someMemberAttributeType.getNameOrOID(), |
| | | String.valueOf(groupEntry.getDN()), de.getMessageObject()); |
| | | String.valueOf(groupEntry.getName()), |
| | | de.getMessageObject()); |
| | | ErrorLogger.logError(message); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | return new StaticGroup(groupEntry.getDN(), |
| | | return new StaticGroup(groupEntry.getName(), |
| | | someMemberAttributeType, someMemberDNs); |
| | | } |
| | | |
| | |
| | | public boolean isMember(Entry userEntry, Set<DN> examinedGroups) |
| | | throws DirectoryException |
| | | { |
| | | return isMember(userEntry.getDN(), examinedGroups); |
| | | return isMember(userEntry.getName(), examinedGroups); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | synchronized (this) |
| | | { |
| | | DN userDN = userEntry.getDN(); |
| | | DN userDN = userEntry.getName(); |
| | | ByteString userDNString = ByteString.valueOf(userDN.toNormalizedString()); |
| | | |
| | | if (memberDNs.contains(userDNString)) |
| | |
| | | else |
| | | { |
| | | Message message = ERR_SATUACM_MULTIPLE_MATCHING_ENTRIES. |
| | | get(String.valueOf(peerDN), String.valueOf(userEntry.getDN()), |
| | | String.valueOf(entry.getDN())); |
| | | get(String.valueOf(peerDN), String.valueOf(userEntry.getName()), |
| | | String.valueOf(entry.getName())); |
| | | throw new DirectoryException(ResultCode.INVALID_CREDENTIALS, message); |
| | | } |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2007-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | * Portions Copyright 2012-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | else |
| | | { |
| | | Message message = ERR_SDTUACM_MULTIPLE_MATCHING_ENTRIES. |
| | | get(peerName, String.valueOf(userEntry.getDN()), |
| | | String.valueOf(entry.getDN())); |
| | | get(peerName, String.valueOf(userEntry.getName()), |
| | | String.valueOf(entry.getName())); |
| | | throw new DirectoryException(ResultCode.INVALID_CREDENTIALS, message); |
| | | } |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | if (targetDN != null) |
| | | { |
| | | Message message = ERR_VIRTUAL_STATIC_GROUP_MULTIPLE_TARGETS.get( |
| | | String.valueOf(groupEntry.getDN())); |
| | | String.valueOf(groupEntry.getName())); |
| | | throw new DirectoryException(ResultCode.OBJECTCLASS_VIOLATION, |
| | | message); |
| | | } |
| | |
| | | } |
| | | |
| | | Message message = ERR_VIRTUAL_STATIC_GROUP_CANNOT_DECODE_TARGET. |
| | | get(v.getValue().toString(), String.valueOf(groupEntry.getDN()), |
| | | get(v.getValue().toString(), |
| | | String.valueOf(groupEntry.getName()), |
| | | de.getMessageObject()); |
| | | throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, |
| | | message, de); |
| | |
| | | if (targetDN == null) |
| | | { |
| | | Message message = ERR_VIRTUAL_STATIC_GROUP_NO_TARGET.get( |
| | | String.valueOf(groupEntry.getDN())); |
| | | String.valueOf(groupEntry.getName())); |
| | | throw new DirectoryException(ResultCode.OBJECTCLASS_VIOLATION, message); |
| | | } |
| | | |
| | | return new VirtualStaticGroup(groupEntry.getDN(), targetDN); |
| | | return new VirtualStaticGroup(groupEntry.getName(), targetDN); |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2013 ForgeRock AS |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.loggers; |
| | | |
| | |
| | | && bindOperation.getSASLAuthUserEntry() != null) |
| | | { // SASL bind and we have successfully found a user entry for auth |
| | | appendLabel(buffer, "authDN", bindOperation.getSASLAuthUserEntry() |
| | | .getDN()); |
| | | .getName()); |
| | | } |
| | | else |
| | | { // SASL bind failed to find user entry for auth or simple bind |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.plugins; |
| | | |
| | |
| | | // Construct a new UUID. In order to make sure that UUIDs are consistent |
| | | // when the same LDIF is generated on multiple servers, we'll base the UUID |
| | | // on the byte representation of the normalized DN. |
| | | byte[] dnBytes = getBytes(entry.getDN().toNormalizedString()); |
| | | byte[] dnBytes = getBytes(entry.getName().toNormalizedString()); |
| | | UUID uuid = UUID.nameUUIDFromBytes(dnBytes); |
| | | |
| | | Attribute uuidAttr = Attributes.create(entryUUIDType, |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2011-2012 ForgeRock AS. |
| | | * Portions Copyright 2011-2014 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.plugins; |
| | | |
| | |
| | | if (authPolicy == null) |
| | | { |
| | | Message message = WARN_PLUGIN_PWIMPORT_NO_SUCH_POLICY.get( |
| | | String.valueOf(entry.getDN()), String.valueOf(policyDN)); |
| | | String.valueOf(entry.getName()), String.valueOf(policyDN)); |
| | | logError(message); |
| | | } |
| | | else if (authPolicy.isPasswordPolicy()) |
| | |
| | | catch (DirectoryException de) |
| | | { |
| | | Message message = WARN_PLUGIN_PWIMPORT_CANNOT_DECODE_POLICY_DN.get( |
| | | String.valueOf(entry.getDN()), de.getMessageObject()); |
| | | String.valueOf(entry.getName()), de.getMessageObject()); |
| | | logError(message); |
| | | break policyLoop; |
| | | } |
| | |
| | | Message message = |
| | | ERR_PLUGIN_PWPIMPORT_ERROR_ENCODING_PASSWORD |
| | | .get(policy.getPasswordAttribute().getNameOrOID(), |
| | | String.valueOf(entry.getDN()), |
| | | String.valueOf(entry.getName()), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | gotError = true; |
| | |
| | | Message message = |
| | | ERR_PLUGIN_PWPIMPORT_ERROR_ENCODING_PASSWORD |
| | | .get(policy.getPasswordAttribute().getNameOrOID(), |
| | | String.valueOf(entry.getDN()), |
| | | String.valueOf(entry.getName()), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | gotError = true; |
| | |
| | | } |
| | | |
| | | Message message = ERR_PLUGIN_PWPIMPORT_ERROR_ENCODING_PASSWORD |
| | | .get(t.getNameOrOID(), String.valueOf(entry.getDN()), |
| | | .get(t.getNameOrOID(), String.valueOf(entry.getName()), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | gotError = true; |
| | |
| | | } |
| | | |
| | | Message message = ERR_PLUGIN_PWPIMPORT_ERROR_ENCODING_PASSWORD |
| | | .get(t.getNameOrOID(), String.valueOf(entry.getDN()), |
| | | .get(t.getNameOrOID(), String.valueOf(entry.getName()), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | gotError = true; |
| | |
| | | modDNmap=new LinkedHashMap<DN,DN>(); |
| | | modifyDNOperation.setAttachment(MODIFYDN_DNS, modDNmap); |
| | | } |
| | | DN oldEntryDN=modifyDNOperation.getOriginalEntry().getDN(); |
| | | DN newEntryDN=modifyDNOperation.getUpdatedEntry().getDN(); |
| | | DN oldEntryDN=modifyDNOperation.getOriginalEntry().getName(); |
| | | DN newEntryDN=modifyDNOperation.getUpdatedEntry().getName(); |
| | | modDNmap.put(oldEntryDN, newEntryDN); |
| | | |
| | | processModifyDN(modDNmap, (interval != 0)); |
| | |
| | | modDNmap=new LinkedHashMap<DN,DN>(); |
| | | modifyDNOperation.setAttachment(MODIFYDN_DNS, modDNmap); |
| | | } |
| | | modDNmap.put(oldEntry.getDN(), newEntry.getDN()); |
| | | modDNmap.put(oldEntry.getName(), newEntry.getName()); |
| | | return PluginResult.SubordinateModifyDN.continueOperationProcessing(); |
| | | } |
| | | |
| | |
| | | deleteDNset = new HashSet<DN>(); |
| | | deleteOperation.setAttachment(DELETE_DNS, deleteDNset); |
| | | } |
| | | deleteDNset.add(entry.getDN()); |
| | | deleteDNset.add(entry.getName()); |
| | | return PluginResult.SubordinateDelete.continueOperationProcessing(); |
| | | } |
| | | |
| | |
| | | private void deleteAddAttributesEntry(Entry e, DN oldEntryDN, DN newEntryDN) |
| | | { |
| | | LinkedList<Modification> mods = new LinkedList<Modification>(); |
| | | DN entryDN=e.getDN(); |
| | | DN entryDN=e.getName(); |
| | | for(AttributeType type : attributeTypes) |
| | | { |
| | | if(e.hasAttribute(type)) |
| | |
| | | /* Make sure the entry belongs to one of the configured naming |
| | | * contexts. |
| | | */ |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | DN entryBaseDN = getEntryBaseDN(entryDN); |
| | | if (entryBaseDN == null) |
| | | { |
| | |
| | | /* Make sure the entry belongs to one of the configured naming |
| | | * contexts. |
| | | */ |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | DN entryBaseDN = getEntryBaseDN(entryDN); |
| | | if (entryBaseDN == null) |
| | | { |
| | |
| | | return PluginResult.PreOperation.stopProcessing( |
| | | ResultCode.CONSTRAINT_VIOLATION, |
| | | ERR_PLUGIN_REFERENT_FILTER_MISMATCH.get( |
| | | valueEntry.getDN().toString(), |
| | | valueEntry.getName().toString(), |
| | | attr.getName(), |
| | | entryDN.toString(), |
| | | filter.toString()) |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.plugins; |
| | | |
| | |
| | | boolean found = true; |
| | | for (DN baseDN : baseDNs) |
| | | { |
| | | if (baseDN.isAncestorOf(entry.getDN())) |
| | | if (baseDN.isAncestorOf(entry.getName())) |
| | | { |
| | | found = true; |
| | | break; |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2013 ForgeRock AS |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.plugins; |
| | | |
| | |
| | | UniqueAttributePluginCfg config = currentConfiguration; |
| | | Entry entry = addOperation.getEntryToAdd(); |
| | | |
| | | Set<DN> baseDNs = getBaseDNs(config, entry.getDN()); |
| | | Set<DN> baseDNs = getBaseDNs(config, entry.getName()); |
| | | if (baseDNs == null) |
| | | { |
| | | // The entry is outside the scope of this plugin. |
| | | return PluginResult.PreOperation.continueOperationProcessing(); |
| | | } |
| | | |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | List<AttributeValue> recordedValues = new LinkedList<AttributeValue>(); |
| | | for (AttributeType t : config.getType()) |
| | | { |
| | |
| | | UniqueAttributePluginCfg config = currentConfiguration; |
| | | |
| | | Set<DN> baseDNs = getBaseDNs(config, |
| | | modifyDNOperation.getUpdatedEntry().getDN()); |
| | | modifyDNOperation.getUpdatedEntry().getName()); |
| | | if (baseDNs == null) |
| | | { |
| | | // The entry is outside the scope of this plugin. |
| | |
| | | UniqueAttributePluginCfg config = currentConfiguration; |
| | | Entry entry = addOperation.getEntryToAdd(); |
| | | |
| | | Set<DN> baseDNs = getBaseDNs(config, entry.getDN()); |
| | | Set<DN> baseDNs = getBaseDNs(config, entry.getName()); |
| | | if (baseDNs == null) |
| | | { |
| | | // The entry is outside the scope of this plugin. |
| | | return; |
| | | } |
| | | |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | for (AttributeType t : config.getType()) |
| | | { |
| | | List<Attribute> attrList = entry.getAttribute(t); |
| | |
| | | UniqueAttributePluginCfg config = currentConfiguration; |
| | | |
| | | Set<DN> baseDNs = getBaseDNs(config, |
| | | modifyDNOperation.getUpdatedEntry().getDN()); |
| | | modifyDNOperation.getUpdatedEntry().getName()); |
| | | if (baseDNs == null) |
| | | { |
| | | // The entry is outside the scope of this plugin. |
| | |
| | | } |
| | | |
| | | DN entryDN = modifyDNOperation.getEntryDN(); |
| | | DN updatedEntryDN = modifyDNOperation.getUpdatedEntry().getDN(); |
| | | DN updatedEntryDN = modifyDNOperation.getUpdatedEntry().getName(); |
| | | RDN newRDN = modifyDNOperation.getNewRDN(); |
| | | for (int i=0; i < newRDN.getNumValues(); i++) |
| | | { |
| | |
| | | false, filter, SEARCH_ATTRS); |
| | | for (SearchResultEntry e : searchOperation.getSearchEntries()) |
| | | { |
| | | if (! e.getDN().equals(targetDN)) |
| | | if (! e.getName().equals(targetDN)) |
| | | { |
| | | return e.getDN(); |
| | | return e.getName(); |
| | | } |
| | | } |
| | | |
| | |
| | | UniqueAttributePluginCfg config = currentConfiguration; |
| | | Entry entry = addOperation.getEntryToAdd(); |
| | | |
| | | Set<DN> baseDNs = getBaseDNs(config, entry.getDN()); |
| | | Set<DN> baseDNs = getBaseDNs(config, entry.getName()); |
| | | if (baseDNs == null) |
| | | { |
| | | // The entry is outside the scope of this plugin. |
| | |
| | | { |
| | | UniqueAttributePluginCfg config = currentConfiguration; |
| | | Set<DN> baseDNs = getBaseDNs(config, |
| | | modifyDNOperation.getUpdatedEntry().getDN()); |
| | | modifyDNOperation.getUpdatedEntry().getName()); |
| | | if (baseDNs == null) |
| | | { |
| | | // The entry is outside the scope of this plugin. |
| | |
| | | */ |
| | | public AddOperation processAdd(Entry entry, List<Control> controls) |
| | | { |
| | | return processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | return processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes(), |
| | | controls); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.protocols.ldap; |
| | | |
| | |
| | | */ |
| | | public SearchResultEntryProtocolOp(SearchResultEntry searchEntry) |
| | | { |
| | | this(searchEntry.getDN(), null, searchEntry, 3); |
| | | this(searchEntry.getName(), null, searchEntry, 3); |
| | | } |
| | | |
| | | |
| | |
| | | public SearchResultEntryProtocolOp(SearchResultEntry searchEntry, |
| | | int ldapVersion) |
| | | { |
| | | this(searchEntry.getDN(), null, searchEntry, ldapVersion); |
| | | this(searchEntry.getName(), null, searchEntry, ldapVersion); |
| | | } |
| | | |
| | | |
| | |
| | | public boolean hasValue(Entry entry, VirtualAttributeRule rule) |
| | | { |
| | | // There's only a value for the rootDSE, i.e. the Null DN. |
| | | return entry.getDN().isRootDN(); |
| | | return entry.getName().isRootDN(); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | |
| | | public boolean hasValue(Entry entry, VirtualAttributeRule rule) |
| | | { |
| | | // There's only a value for the rootDSE, i.e. the Null DN. |
| | | return entry.getDN().isRootDN(); |
| | | return entry.getName().isRootDN(); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | |
| | | public boolean hasValue(Entry entry, VirtualAttributeRule rule) |
| | | { |
| | | // There's only a value for the rootDSE, i.e. the Null DN. |
| | | return entry.getDN().isRootDN(); |
| | | return entry.getName().isRootDN(); |
| | | |
| | | } |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2013 ForgeRock AS |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | * Log information for the repair tool. |
| | | */ |
| | | Message message = ERR_UNKNOWN_ATTRIBUTE_IN_HISTORICAL.get( |
| | | entry.getDN().toNormalizedString(), histVal.getAttrString()); |
| | | entry.getName().toNormalizedString(), |
| | | histVal.getAttrString()); |
| | | logError(message); |
| | | continue; |
| | | } |
| | |
| | | // Any exception happening here means that the coding of the historical |
| | | // information was wrong. |
| | | // Log an error and continue with an empty historical. |
| | | Message message = ERR_BAD_HISTORICAL.get(entry.getDN().toString()); |
| | | Message message = ERR_BAD_HISTORICAL.get(entry.getName().toString()); |
| | | logError(message); |
| | | } |
| | | |
| | |
| | | { |
| | | String uuidString = getEntryUUID(entry); |
| | | FakeModifyOperation modifyFakeOperation = |
| | | new FakeModifyOperation(entry.getDN(), csn, uuidString); |
| | | new FakeModifyOperation(entry.getName(), csn, uuidString); |
| | | modifyFakeOperation.addModification(mod); |
| | | operations.put(histVal.getCSN(), modifyFakeOperation); |
| | | } |
| | |
| | | DirectoryServer.getSchema().getAttributeType(ENTRYUUID_ATTRIBUTE_NAME); |
| | | List<Attribute> uuidAttrs = |
| | | entry.getOperationalAttribute(entryuuidAttrType); |
| | | return extractEntryUUID(uuidAttrs, entry.getDN()); |
| | | return extractEntryUUID(uuidAttrs, entry.getName()); |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2012-2013 ForgeRock AS |
| | | * Portions Copyright 2012-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | |
| | | @Override |
| | | public AddMsg generateMessage() |
| | | { |
| | | return new AddMsg(getCSN(), entry.getDN(), |
| | | return new AddMsg(getCSN(), entry.getName(), |
| | | EntryHistorical.getEntryUUID(entry), |
| | | LDAPReplicationDomain.findEntryUUID( |
| | | entry.getDN().getParentDNInSuffix()), |
| | | entry.getName().getParentDNInSuffix()), |
| | | entry.getObjectClasses(), |
| | | entry.getUserAttributes(), entry.getOperationalAttributes()); |
| | | } |
| | |
| | | @Override |
| | | public ReplicationMsg generateMessage() |
| | | { |
| | | DN dn = entry.getDN(); |
| | | DN dn = entry.getName(); |
| | | return new ModifyDNMsg(dn, getCSN(), |
| | | EntryHistorical.getEntryUUID(entry), |
| | | LDAPReplicationDomain.findEntryUUID(dn.parent()), |
| | |
| | | sync.getReplicationDomain(domainName); |
| | | // Is the entry a sub entry of the replicated domain main entry ? |
| | | DN replicatedDn = replicationDomainCfg.getBaseDN(); |
| | | DN entryDn = entry.getDN(); |
| | | DN entryDn = entry.getName(); |
| | | if (entryDn.isDescendantOf(replicatedDn)) |
| | | { |
| | | // Found the matching replicated domain configuration object |
| | |
| | | ImportFractionalContext importFractionalContext = |
| | | importSessionContexts.get(importConfig); |
| | | |
| | | DN entryDn = entry.getDN(); |
| | | DN entryDn = entry.getName(); |
| | | FractionalConfig localFractionalConfig = null; |
| | | |
| | | // If no context, create it |
| | |
| | | // If we get here, local domain fractional configuration is enabled. |
| | | // Now filter for potential attributes to be removed. |
| | | LDAPReplicationDomain.fractionalRemoveAttributesFromEntry( |
| | | localFractionalConfig, entry.getDN().rdn(), |
| | | localFractionalConfig, entry.getName().rdn(), |
| | | entry.getObjectClasses(), entry.getUserAttributes(), true); |
| | | |
| | | return PluginResult.ImportLDIF.continueEntryProcessing(); |
| | |
| | | |
| | | if (entryToRename != null) |
| | | { |
| | | DN entryDN = entryToRename.getDN(); |
| | | DN entryDN = entryToRename.getName(); |
| | | ModifyDNOperation newOp = renameEntry( |
| | | entryDN, freedDN.rdn(), freedDN.parent(), false); |
| | | |
| | |
| | | SearchResultEntry resultEntry = result.get(0); |
| | | if (resultEntry != null) |
| | | { |
| | | return resultEntry.getDN(); |
| | | return resultEntry.getName(); |
| | | } |
| | | } |
| | | } |
| | |
| | | * and keep the entry as a conflicting entry, |
| | | */ |
| | | conflict = true; |
| | | renameConflictEntry(conflictOp, entry.getDN(), |
| | | renameConflictEntry(conflictOp, entry.getName(), |
| | | EntryHistorical.getEntryUUID(entry)); |
| | | } |
| | | } |
| | |
| | | conn, InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | new ArrayList<Control>(0), |
| | | entry.getDN(), |
| | | entry.getName(), |
| | | mods); |
| | | runAsSynchronizedOperation(newOp); |
| | | |
| | |
| | | SearchResultEntry configEntry = searchConfigEntry(); |
| | | if (configEntry != null) |
| | | { |
| | | DN configDN = configEntry.getDN(); |
| | | DN configDN = configEntry.getName(); |
| | | result = runUpdateStateEntry(configDN); |
| | | } |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013 ForgeRock AS. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.tasks; |
| | | |
| | |
| | | if ((attrList == null) || attrList.isEmpty()) |
| | | { |
| | | Message message = ERR_TASK_ADDSCHEMAFILE_NO_FILENAME.get( |
| | | ATTR_TASK_ADDSCHEMAFILE_FILENAME, String.valueOf(taskEntry.getDN())); |
| | | ATTR_TASK_ADDSCHEMAFILE_FILENAME, |
| | | String.valueOf(taskEntry.getName())); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message); |
| | | } |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.tasks; |
| | | |
| | |
| | | |
| | | restart = false; |
| | | shutdownMessage = INFO_TASK_SHUTDOWN_DEFAULT_MESSAGE.get( |
| | | String.valueOf(taskEntry.getDN())); |
| | | String.valueOf(taskEntry.getName())); |
| | | |
| | | AttributeType attrType = |
| | | DirectoryServer.getAttributeType(ATTR_SHUTDOWN_MESSAGE, true); |
| | |
| | | .getValue().toString(); |
| | | |
| | | shutdownMessage = INFO_TASK_SHUTDOWN_CUSTOM_MESSAGE.get(String |
| | | .valueOf(taskEntry.getDN()), String.valueOf(valueString)); |
| | | .valueOf(taskEntry.getName()), String.valueOf(valueString)); |
| | | } |
| | | } |
| | | |
| | |
| | | break; |
| | | } |
| | | |
| | | if (! ignoreEntries.contains(entry.getDN())) |
| | | if (! ignoreEntries.contains(entry.getName())) |
| | | { |
| | | sourceMap.put(entry.getDN(), entry); |
| | | sourceMap.put(entry.getName(), entry); |
| | | } |
| | | } |
| | | } |
| | |
| | | break; |
| | | } |
| | | |
| | | if (! ignoreEntries.contains(entry.getDN())) |
| | | if (! ignoreEntries.contains(entry.getName())) |
| | | { |
| | | targetMap.put(entry.getDN(), entry); |
| | | targetMap.put(entry.getName(), entry); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | LinkedList<Modification> attrMods = new LinkedList<Modification>(); |
| | | attrMods.add(m); |
| | | writer.writeModifyChangeRecord(sourceEntry.getDN(), attrMods); |
| | | writer.writeModifyChangeRecord(sourceEntry.getName(), attrMods); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | attrMods.clear(); |
| | | attrMods.add(new Modification(m.getModificationType(), attr)); |
| | | writer.writeModifyChangeRecord(sourceEntry.getDN(), attrMods); |
| | | writer.writeModifyChangeRecord(sourceEntry.getName(), attrMods); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | writer.writeModifyChangeRecord(sourceEntry.getDN(), modifications); |
| | | writer.writeModifyChangeRecord(sourceEntry.getName(), modifications); |
| | | } |
| | | |
| | | return true; |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012-2013 ForgeRock AS |
| | | * Portions Copyright 2012-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.tools; |
| | | |
| | |
| | | |
| | | // If the entry is to be deleted, then just skip over it without writing |
| | | // it to the output. |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | if (deletes.remove(entryDN) != null) |
| | | { |
| | | continue; |
| | |
| | | |
| | | // If we've gotten here, then the (possibly updated) entry should be |
| | | // written to the LDIF entry Map. |
| | | ldifEntries.put(entry.getDN(),entry); |
| | | ldifEntries.put(entry.getName(),entry); |
| | | } |
| | | |
| | | |
| | |
| | | Entry e = new Entry(add.getDN(), objectClasses, userAttributes, |
| | | operationalAttributes); |
| | | //Put the entry to be added into the LDIF entry map. |
| | | ldifEntries.put(e.getDN(),e); |
| | | ldifEntries.put(e.getName(),e); |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.tools.tasks; |
| | |
| | | * @param entry to wrap |
| | | */ |
| | | public TaskEntry(Entry entry) { |
| | | dn = entry.getDN(); |
| | | dn = entry.getName(); |
| | | |
| | | String p = "ds-task-"; |
| | | id = getSingleStringValue(entry, p + "id"); |
| | |
| | | { |
| | | if (authorizationEntry != null) |
| | | { |
| | | return authorizationEntry.getDN(); |
| | | return authorizationEntry.getName(); |
| | | } |
| | | return DN.rootDN(); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions copyright 2011 ForgeRock AS. |
| | | * Portions Copyright 2011-2014 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.types; |
| | | |
| | |
| | | */ |
| | | public DN getUserDN() |
| | | { |
| | | return userEntry.getDN(); |
| | | return userEntry.getName(); |
| | | } |
| | | |
| | | |
| | |
| | | public String toString() |
| | | { |
| | | return "AccountStatusNotification(type=" + |
| | | notificationType.getName() + ",dn=" + userEntry.getDN() + |
| | | notificationType.getName() + ",dn=" + userEntry.getName() + |
| | | ",message=" + message + ")"; |
| | | } |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2013 ForgeRock AS |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.types; |
| | | |
| | |
| | | isAuthenticated = (authenticationEntry != null); |
| | | mustChangePassword = false; |
| | | simpleBindDN = authenticationEntry != null ? |
| | | authenticationEntry.getDN() : null; |
| | | authenticationEntry.getName() : null; |
| | | authorizationEntry = authenticationEntry; |
| | | saslMechanism = null; |
| | | authenticationType = AuthenticationType.INTERNAL; |
| | |
| | | { |
| | | if (authenticationEntry != null) |
| | | { |
| | | return authenticationEntry.getDN(); |
| | | return authenticationEntry.getName(); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | { |
| | | if (authorizationEntry != null) |
| | | { |
| | | return authorizationEntry.getDN(); |
| | | return authorizationEntry.getName(); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | |
| | | if (authenticationEntry != null) |
| | | { |
| | | authenticationEntry.getDN().toString(buffer); |
| | | authenticationEntry.getName().toString(buffer); |
| | | } |
| | | |
| | | if (authorizationEntry == null) |
| | |
| | | else |
| | | { |
| | | buffer.append("\",authorizationDN=\""); |
| | | authorizationEntry.getDN().toString(buffer); |
| | | authorizationEntry.getName().toString(buffer); |
| | | buffer.append("\""); |
| | | } |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.types; |
| | | |
| | |
| | | */ |
| | | public DN getDN() |
| | | { |
| | | return entry.getDN(); |
| | | return entry.getName(); |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * @return The distinguished name for this entry. |
| | | */ |
| | | public DN getDN() |
| | | public DN getName() |
| | | { |
| | | return dn; |
| | | } |
| | |
| | | } |
| | | else if (! parentProvided) |
| | | { |
| | | DN parentDN = getDN().getParentDNInSuffix(); |
| | | DN parentDN = getName().getParentDNInSuffix(); |
| | | if (parentDN != null) |
| | | { |
| | | // Get the parent entry and check its structural class. |
| | |
| | | { |
| | | Message message = ERR_ENTRY_SCHEMA_DSR_NO_PARENT_OC.get( |
| | | String.valueOf(dn), |
| | | String.valueOf(parentEntry.getDN())); |
| | | String.valueOf(parentEntry.getName())); |
| | | |
| | | if (structuralPolicy == AcceptRejectWarn.REJECT) |
| | | { |
| | |
| | | Message message = |
| | | ERR_ENTRY_SCHEMA_VIOLATES_PARENT_DSR.get( |
| | | String.valueOf(dn), |
| | | String.valueOf(parentEntry.getDN())); |
| | | String.valueOf(parentEntry.getName())); |
| | | |
| | | if (structuralPolicy == AcceptRejectWarn.REJECT) |
| | | { |
| | |
| | | { |
| | | Message message = ERR_ENTRY_SCHEMA_DSR_NO_PARENT_OC.get( |
| | | String.valueOf(dn), |
| | | String.valueOf(parentEntry.getDN())); |
| | | String.valueOf(parentEntry.getName())); |
| | | |
| | | if (structuralPolicy == AcceptRejectWarn.REJECT) |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013 ForgeRock AS. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.types; |
| | | |
| | |
| | | public boolean includeEntry(Entry entry) |
| | | throws DirectoryException |
| | | { |
| | | DN dn = entry.getDN(); |
| | | DN dn = entry.getName(); |
| | | if (! excludeBranches.isEmpty()) |
| | | { |
| | | for (DN excludeBranch : excludeBranches) |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013 ForgeRock AS |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.types; |
| | | |
| | |
| | | Entry e = nextMemberEntry(); |
| | | if (e != null) |
| | | { |
| | | return e.getDN(); |
| | | return e.getName(); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | return false; |
| | | default: |
| | | Message message = ERR_SEARCH_FILTER_INVALID_RESULT_TYPE. |
| | | get(String.valueOf(entry.getDN()), toString(), |
| | | get(String.valueOf(entry.getName()), toString(), |
| | | String.valueOf(result)); |
| | | logError(message); |
| | | return false; |
| | |
| | | default: |
| | | // This is an invalid filter type. |
| | | Message message = ERR_SEARCH_FILTER_INVALID_FILTER_TYPE. |
| | | get(String.valueOf(entry.getDN()), toString(), |
| | | get(String.valueOf(entry.getName()), toString(), |
| | | filterType.toString()); |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | message); |
| | |
| | | // The set of subcomponents was null. This is not allowed. |
| | | Message message = |
| | | ERR_SEARCH_FILTER_COMPOUND_COMPONENTS_NULL. |
| | | get(String.valueOf(entry.getDN()), |
| | | get(String.valueOf(entry.getName()), |
| | | String.valueOf(completeFilter), |
| | | String.valueOf(filterType)); |
| | | throw new DirectoryException( |
| | |
| | | if (depth >= MAX_NESTED_FILTER_DEPTH) |
| | | { |
| | | Message message = ERR_SEARCH_FILTER_NESTED_TOO_DEEP. |
| | | get(String.valueOf(entry.getDN()), |
| | | get(String.valueOf(entry.getName()), |
| | | String.valueOf(completeFilter)); |
| | | throw new DirectoryException( |
| | | DirectoryServer.getServerErrorResultCode(), |
| | |
| | | TRACER.debugVerbose( |
| | | "Returning FALSE for AND component %s in " + |
| | | "filter %s for entry %s", |
| | | f, completeFilter, entry.getDN()); |
| | | f, completeFilter, entry.getName()); |
| | | } |
| | | return result; |
| | | case UNDEFINED: |
| | |
| | | { |
| | | TRACER.debugInfo( |
| | | "Undefined result for AND component %s in filter " + |
| | | "%s for entry %s", f, completeFilter, entry.getDN()); |
| | | "%s for entry %s", f, completeFilter, entry.getName()); |
| | | } |
| | | return result; |
| | | default: |
| | | Message message = |
| | | ERR_SEARCH_FILTER_INVALID_RESULT_TYPE. |
| | | get(String.valueOf(entry.getDN()), |
| | | get(String.valueOf(entry.getName()), |
| | | String.valueOf(completeFilter), |
| | | String.valueOf(result)); |
| | | throw new |
| | |
| | | { |
| | | TRACER.debugVerbose( |
| | | "Returning TRUE for AND component %s in filter %s " + |
| | | "for entry %s", this, completeFilter, entry.getDN()); |
| | | "for entry %s", this, completeFilter, entry.getName()); |
| | | } |
| | | return ConditionResult.TRUE; |
| | | } |
| | |
| | | // The set of subcomponents was null. This is not allowed. |
| | | Message message = |
| | | ERR_SEARCH_FILTER_COMPOUND_COMPONENTS_NULL. |
| | | get(String.valueOf(entry.getDN()), |
| | | get(String.valueOf(entry.getName()), |
| | | String.valueOf(completeFilter), |
| | | String.valueOf(filterType)); |
| | | throw new DirectoryException( |
| | |
| | | if (depth >= MAX_NESTED_FILTER_DEPTH) |
| | | { |
| | | Message message = ERR_SEARCH_FILTER_NESTED_TOO_DEEP. |
| | | get(String.valueOf(entry.getDN()), |
| | | get(String.valueOf(entry.getName()), |
| | | String.valueOf(completeFilter)); |
| | | throw new DirectoryException( |
| | | DirectoryServer.getServerErrorResultCode(), |
| | |
| | | TRACER.debugVerbose( |
| | | "Returning TRUE for OR component %s in filter " + |
| | | "%s for entry %s", |
| | | f, completeFilter, entry.getDN()); |
| | | f, completeFilter, entry.getName()); |
| | | } |
| | | return ConditionResult.TRUE; |
| | | case FALSE: |
| | |
| | | TRACER.debugInfo( |
| | | "Undefined result for OR component %s in filter " + |
| | | "%s for entry %s", |
| | | f, completeFilter, entry.getDN()); |
| | | f, completeFilter, entry.getName()); |
| | | } |
| | | result = ConditionResult.UNDEFINED; |
| | | break; |
| | | default: |
| | | Message message = |
| | | ERR_SEARCH_FILTER_INVALID_RESULT_TYPE. |
| | | get(String.valueOf(entry.getDN()), |
| | | get(String.valueOf(entry.getName()), |
| | | String.valueOf(completeFilter), |
| | | String.valueOf(result)); |
| | | throw new |
| | |
| | | TRACER.debugVerbose( |
| | | "Returning %s for OR component %s in filter %s for " + |
| | | "entry %s", result, this, completeFilter, |
| | | entry.getDN()); |
| | | entry.getName()); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | { |
| | | // The NOT subcomponent was null. This is not allowed. |
| | | Message message = ERR_SEARCH_FILTER_NOT_COMPONENT_NULL. |
| | | get(String.valueOf(entry.getDN()), |
| | | get(String.valueOf(entry.getName()), |
| | | String.valueOf(completeFilter)); |
| | | throw new DirectoryException( |
| | | DirectoryServer.getServerErrorResultCode(), |
| | |
| | | if (depth >= MAX_NESTED_FILTER_DEPTH) |
| | | { |
| | | Message message = ERR_SEARCH_FILTER_NESTED_TOO_DEEP. |
| | | get(String.valueOf(entry.getDN()), |
| | | get(String.valueOf(entry.getName()), |
| | | String.valueOf(completeFilter)); |
| | | throw new DirectoryException( |
| | | DirectoryServer.getServerErrorResultCode(), |
| | |
| | | TRACER.debugVerbose( |
| | | "Returning FALSE for NOT component %s in filter " + |
| | | "%s for entry %s", |
| | | notComponent, completeFilter, entry.getDN()); |
| | | notComponent, completeFilter, entry.getName()); |
| | | } |
| | | return ConditionResult.FALSE; |
| | | case FALSE: |
| | |
| | | TRACER.debugVerbose( |
| | | "Returning TRUE for NOT component %s in filter " + |
| | | "%s for entry %s", |
| | | notComponent, completeFilter, entry.getDN()); |
| | | notComponent, completeFilter, entry.getName()); |
| | | } |
| | | return ConditionResult.TRUE; |
| | | case UNDEFINED: |
| | |
| | | TRACER.debugInfo( |
| | | "Undefined result for NOT component %s in filter " + |
| | | "%s for entry %s", |
| | | notComponent, completeFilter, entry.getDN()); |
| | | notComponent, completeFilter, entry.getName()); |
| | | } |
| | | return ConditionResult.UNDEFINED; |
| | | default: |
| | | Message message = ERR_SEARCH_FILTER_INVALID_RESULT_TYPE. |
| | | get(String.valueOf(entry.getDN()), |
| | | get(String.valueOf(entry.getName()), |
| | | String.valueOf(completeFilter), |
| | | String.valueOf(result)); |
| | | throw new |
| | |
| | | { |
| | | Message message = |
| | | ERR_SEARCH_FILTER_EQUALITY_NO_ATTRIBUTE_TYPE. |
| | | get(String.valueOf(entry.getDN()), toString()); |
| | | get(String.valueOf(entry.getName()), toString()); |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | message); |
| | | } |
| | |
| | | { |
| | | Message message = |
| | | ERR_SEARCH_FILTER_EQUALITY_NO_ASSERTION_VALUE. |
| | | get(String.valueOf(entry.getDN()), toString(), |
| | | get(String.valueOf(entry.getName()), toString(), |
| | | attributeType.getNameOrOID()); |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | message); |
| | |
| | | "Returning FALSE for equality component %s in " + |
| | | "filter %s because entry %s didn't have attribute " + |
| | | "type %s", |
| | | this, completeFilter, entry.getDN(), |
| | | this, completeFilter, entry.getName(), |
| | | attributeType.getNameOrOID()); |
| | | } |
| | | return ConditionResult.FALSE; |
| | |
| | | TRACER.debugVerbose( |
| | | "Returning TRUE for equality component %s in " + |
| | | "filter %s for entry %s", |
| | | this, completeFilter, entry.getDN()); |
| | | this, completeFilter, entry.getName()); |
| | | } |
| | | return ConditionResult.TRUE; |
| | | } |
| | |
| | | "Returning FALSE for equality component %s in filter " + |
| | | "%s because entry %s didn't have attribute type " + |
| | | "%s with value %s", |
| | | this, completeFilter, entry.getDN(), |
| | | this, completeFilter, entry.getName(), |
| | | attributeType.getNameOrOID(), |
| | | assertionValue.getValue().toString()); |
| | | } |
| | |
| | | { |
| | | Message message = |
| | | ERR_SEARCH_FILTER_SUBSTRING_NO_ATTRIBUTE_TYPE. |
| | | get(String.valueOf(entry.getDN()), toString()); |
| | | get(String.valueOf(entry.getName()), toString()); |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | message); |
| | | } |
| | |
| | | { |
| | | Message message = |
| | | ERR_SEARCH_FILTER_SUBSTRING_NO_SUBSTRING_COMPONENTS. |
| | | get(String.valueOf(entry.getDN()), toString(), |
| | | get(String.valueOf(entry.getName()), toString(), |
| | | attributeType.getNameOrOID()); |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | message); |
| | |
| | | "Returning FALSE for substring component %s in " + |
| | | "filter %s because entry %s didn't have attribute " + |
| | | "type %s", |
| | | this, completeFilter, entry.getDN(), |
| | | this, completeFilter, entry.getName(), |
| | | attributeType.getNameOrOID()); |
| | | } |
| | | return ConditionResult.FALSE; |
| | |
| | | TRACER.debugVerbose( |
| | | "Returning TRUE for substring component %s in " + |
| | | "filter %s for entry %s", |
| | | this, completeFilter, entry.getDN()); |
| | | this, completeFilter, entry.getName()); |
| | | } |
| | | return ConditionResult.TRUE; |
| | | case FALSE: |
| | |
| | | TRACER.debugVerbose( |
| | | "Undefined result encountered for substring " + |
| | | "component %s in filter %s for entry %s", |
| | | this, completeFilter, entry.getDN()); |
| | | this, completeFilter, entry.getName()); |
| | | } |
| | | result = ConditionResult.UNDEFINED; |
| | | break; |
| | |
| | | TRACER.debugVerbose( |
| | | "Returning %s for substring component %s in filter " + |
| | | "%s for entry %s", |
| | | result, this, completeFilter, entry.getDN()); |
| | | result, this, completeFilter, entry.getName()); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | { |
| | | Message message = |
| | | ERR_SEARCH_FILTER_GREATER_OR_EQUAL_NO_ATTRIBUTE_TYPE. |
| | | get(String.valueOf(entry.getDN()), toString()); |
| | | get(String.valueOf(entry.getName()), toString()); |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | message); |
| | | } |
| | |
| | | { |
| | | Message message = |
| | | ERR_SEARCH_FILTER_GREATER_OR_EQUAL_NO_VALUE. |
| | | get(String.valueOf(entry.getDN()), toString(), |
| | | get(String.valueOf(entry.getName()), toString(), |
| | | attributeType.getNameOrOID()); |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | message); |
| | |
| | | TRACER.debugVerbose("Returning FALSE for " + |
| | | "greater-or-equal component %s in filter %s " + |
| | | "because entry %s didn't have attribute type %s", |
| | | this, completeFilter, entry.getDN(), |
| | | this, completeFilter, entry.getName(), |
| | | attributeType.getNameOrOID()); |
| | | } |
| | | return ConditionResult.FALSE; |
| | |
| | | TRACER.debugVerbose( |
| | | "Returning TRUE for greater-or-equal component " + |
| | | "%s in filter %s for entry %s", |
| | | this, completeFilter, entry.getDN()); |
| | | this, completeFilter, entry.getName()); |
| | | } |
| | | return ConditionResult.TRUE; |
| | | case FALSE: |
| | |
| | | "Undefined result encountered for " + |
| | | "greater-or-equal component %s in filter %s " + |
| | | "for entry %s", this, completeFilter, |
| | | entry.getDN()); |
| | | entry.getName()); |
| | | } |
| | | result = ConditionResult.UNDEFINED; |
| | | break; |
| | |
| | | TRACER.debugVerbose( |
| | | "Returning %s for greater-or-equal component %s in " + |
| | | "filter %s for entry %s", |
| | | result, this, completeFilter, entry.getDN()); |
| | | result, this, completeFilter, entry.getName()); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | { |
| | | Message message = |
| | | ERR_SEARCH_FILTER_LESS_OR_EQUAL_NO_ATTRIBUTE_TYPE. |
| | | get(String.valueOf(entry.getDN()), toString()); |
| | | get(String.valueOf(entry.getName()), toString()); |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | message); |
| | | } |
| | |
| | | { |
| | | Message message = |
| | | ERR_SEARCH_FILTER_LESS_OR_EQUAL_NO_ASSERTION_VALUE. |
| | | get(String.valueOf(entry.getDN()), toString(), |
| | | get(String.valueOf(entry.getName()), toString(), |
| | | attributeType.getNameOrOID()); |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | message); |
| | |
| | | TRACER.debugVerbose( |
| | | "Returning FALSE for less-or-equal component %s in " + |
| | | "filter %s because entry %s didn't have attribute " + |
| | | "type %s", this, completeFilter, entry.getDN(), |
| | | "type %s", this, completeFilter, entry.getName(), |
| | | attributeType.getNameOrOID()); |
| | | } |
| | | return ConditionResult.FALSE; |
| | |
| | | TRACER.debugVerbose( |
| | | "Returning TRUE for less-or-equal component %s " + |
| | | "in filter %s for entry %s", |
| | | this, completeFilter, entry.getDN()); |
| | | this, completeFilter, entry.getName()); |
| | | } |
| | | return ConditionResult.TRUE; |
| | | case FALSE: |
| | |
| | | "Undefined result encountered for " + |
| | | "less-or-equal component %s in filter %s " + |
| | | "for entry %s", |
| | | this, completeFilter, entry.getDN()); |
| | | this, completeFilter, entry.getName()); |
| | | } |
| | | result = ConditionResult.UNDEFINED; |
| | | break; |
| | |
| | | TRACER.debugVerbose( |
| | | "Returning %s for less-or-equal component %s in " + |
| | | "filter %s for entry %s", |
| | | result, this, completeFilter, entry.getDN()); |
| | | result, this, completeFilter, entry.getName()); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | { |
| | | Message message = |
| | | ERR_SEARCH_FILTER_PRESENCE_NO_ATTRIBUTE_TYPE. |
| | | get(String.valueOf(entry.getDN()), toString()); |
| | | get(String.valueOf(entry.getName()), toString()); |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | message); |
| | | } |
| | |
| | | TRACER.debugVerbose( |
| | | "Returning TRUE for presence component %s in " + |
| | | "filter %s for entry %s", |
| | | this, completeFilter, entry.getDN()); |
| | | this, completeFilter, entry.getName()); |
| | | } |
| | | return ConditionResult.TRUE; |
| | | } |
| | |
| | | TRACER.debugVerbose( |
| | | "Returning FALSE for presence component %s in " + |
| | | "filter %s for entry %s", |
| | | this, completeFilter, entry.getDN()); |
| | | this, completeFilter, entry.getName()); |
| | | } |
| | | return ConditionResult.FALSE; |
| | | } |
| | |
| | | { |
| | | Message message = |
| | | ERR_SEARCH_FILTER_APPROXIMATE_NO_ATTRIBUTE_TYPE. |
| | | get(String.valueOf(entry.getDN()), toString()); |
| | | get(String.valueOf(entry.getName()), toString()); |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | message); |
| | | } |
| | |
| | | { |
| | | Message message = |
| | | ERR_SEARCH_FILTER_APPROXIMATE_NO_ASSERTION_VALUE. |
| | | get(String.valueOf(entry.getDN()), toString(), |
| | | get(String.valueOf(entry.getName()), toString(), |
| | | attributeType.getNameOrOID()); |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | message); |
| | |
| | | TRACER.debugVerbose( |
| | | "Returning FALSE for approximate component %s in " + |
| | | "filter %s because entry %s didn't have attribute " + |
| | | "type %s", this, completeFilter, entry.getDN(), |
| | | "type %s", this, completeFilter, entry.getName(), |
| | | attributeType.getNameOrOID()); |
| | | } |
| | | return ConditionResult.FALSE; |
| | |
| | | TRACER.debugVerbose( |
| | | "Returning TRUE for approximate component %s in " + |
| | | "filter %s for entry %s", |
| | | this, completeFilter, entry.getDN()); |
| | | this, completeFilter, entry.getName()); |
| | | } |
| | | return ConditionResult.TRUE; |
| | | case FALSE: |
| | |
| | | TRACER.debugVerbose( |
| | | "Undefined result encountered for approximate " + |
| | | "component %s in filter %s for entry %s", |
| | | this, completeFilter, entry.getDN()); |
| | | this, completeFilter, entry.getName()); |
| | | } |
| | | result = ConditionResult.UNDEFINED; |
| | | break; |
| | |
| | | TRACER.debugVerbose( |
| | | "Returning %s for approximate component %s in filter " + |
| | | "%s for entry %s", |
| | | result, this, completeFilter, entry.getDN()); |
| | | result, this, completeFilter, entry.getName()); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | { |
| | | Message message = |
| | | ERR_SEARCH_FILTER_EXTENSIBLE_MATCH_NO_ASSERTION_VALUE. |
| | | get(String.valueOf(entry.getDN()), |
| | | get(String.valueOf(entry.getName()), |
| | | String.valueOf(completeFilter)); |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | message); |
| | |
| | | { |
| | | Message message = |
| | | ERR_SEARCH_FILTER_EXTENSIBLE_MATCH_NO_RULE_OR_TYPE. |
| | | get(String.valueOf(entry.getDN()), |
| | | get(String.valueOf(entry.getName()), |
| | | String.valueOf(completeFilter)); |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | message); |
| | |
| | | default: |
| | | Message message = |
| | | ERR_SEARCH_FILTER_INVALID_RESULT_TYPE. |
| | | get(String.valueOf(entry.getDN()), |
| | | get(String.valueOf(entry.getName()), |
| | | String.valueOf(completeFilter), |
| | | String.valueOf(r)); |
| | | throw new DirectoryException( |
| | |
| | | default: |
| | | Message message = |
| | | ERR_SEARCH_FILTER_INVALID_RESULT_TYPE. |
| | | get(String.valueOf(entry.getDN()), |
| | | get(String.valueOf(entry.getName()), |
| | | String.valueOf(completeFilter), |
| | | String.valueOf(r)); |
| | | throw new DirectoryException( |
| | |
| | | break; |
| | | default: |
| | | Message message = ERR_SEARCH_FILTER_INVALID_RESULT_TYPE. |
| | | get(String.valueOf(entry.getDN()), |
| | | get(String.valueOf(entry.getName()), |
| | | String.valueOf(completeFilter), |
| | | String.valueOf(r)); |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | |
| | | default: |
| | | Message message = |
| | | ERR_SEARCH_FILTER_INVALID_RESULT_TYPE. |
| | | get(String.valueOf(entry.getDN()), |
| | | get(String.valueOf(entry.getName()), |
| | | String.valueOf(completeFilter), |
| | | String.valueOf(r)); |
| | | throw new DirectoryException( |
| | |
| | | // attributes, then do so. |
| | | if (dnAttributes) |
| | | { |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | int count = entryDN.size(); |
| | | for (int rdnIndex = 0; rdnIndex < count; rdnIndex++) |
| | | { |
| | |
| | | default: |
| | | Message message = |
| | | ERR_SEARCH_FILTER_INVALID_RESULT_TYPE. |
| | | get(String.valueOf(entry.getDN()), |
| | | get(String.valueOf(entry.getName()), |
| | | String.valueOf(completeFilter), |
| | | String.valueOf(r)); |
| | | throw new DirectoryException( |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.types; |
| | | |
| | |
| | | */ |
| | | public SearchResultEntry(Entry entry) |
| | | { |
| | | super(entry.getDN(), entry.getObjectClasses(), |
| | | super(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | |
| | |
| | | */ |
| | | public SearchResultEntry(Entry entry, List<Control> controls) |
| | | { |
| | | super(entry.getDN(), entry.getObjectClasses(), |
| | | super(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | |
| | |
| | | try |
| | | { |
| | | this.subTreeSpec = SubtreeSpecification.valueOf( |
| | | entry.getDN().parent(), specString); |
| | | entry.getName().parent(), specString); |
| | | isValidSpec = true; |
| | | } |
| | | catch (DirectoryException de) |
| | |
| | | { |
| | | // There is none for some reason eg this could be |
| | | // old Draft based ldapSubEntry so create a dummy. |
| | | this.subTreeSpec = new SubtreeSpecification(entry.getDN().parent(), |
| | | this.subTreeSpec = new SubtreeSpecification(entry.getName().parent(), |
| | | null, -1, -1, null, null, null); |
| | | } |
| | | |
| | |
| | | */ |
| | | public final DN getDN() |
| | | { |
| | | return this.entry.getDN(); |
| | | return this.entry.getName(); |
| | | } |
| | | |
| | | /** |
| | |
| | | public boolean isWithinScope(final Entry entry) |
| | | { |
| | | |
| | | if (isDNWithinScope(entry.getDN())) |
| | | if (isDNWithinScope(entry.getName())) |
| | | { |
| | | if (refinements != null) |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2013 ForgeRock AS |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.types; |
| | | |
| | |
| | | |
| | | // If there are any base DNs defined, then the entry must be below |
| | | // one of them. |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | if (! baseDNs.isEmpty()) |
| | | { |
| | | boolean found = false; |
| | |
| | | } |
| | | suffix.removePending(entryDN); |
| | | Message message = ERR_LDIF_COULD_NOT_EVALUATE_FILTERS_FOR_IMPORT. |
| | | get(String.valueOf(entry.getDN()), lastEntryLineNumber, |
| | | get(String.valueOf(entry.getName()), lastEntryLineNumber, |
| | | String.valueOf(e)); |
| | | logToSkipWriter(lines, message); |
| | | suffix.removePending(entryDN); |
| | |
| | | } |
| | | |
| | | Message message = ERR_LDIF_COULD_NOT_EVALUATE_FILTERS_FOR_IMPORT. |
| | | get(String.valueOf(entry.getDN()), lastEntryLineNumber, |
| | | get(String.valueOf(entry.getName()), lastEntryLineNumber, |
| | | String.valueOf(e)); |
| | | throw new LDIFException(message, lastEntryLineNumber, true, e); |
| | | } |
| | |
| | | rejectWriter.write(message.toString()); |
| | | rejectWriter.newLine(); |
| | | } |
| | | rejectWriter.write(e.getDN().toString()); |
| | | rejectWriter.write(e.getName().toString()); |
| | | rejectWriter.newLine(); |
| | | List<StringBuilder> eLDIF = e.toLDIF(); |
| | | for(StringBuilder l : eLDIF) { |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013 ForgeRock AS. |
| | | * Portions Copyright 2013-2014 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.util; |
| | | |
| | |
| | | |
| | | |
| | | // First, write the DN. |
| | | writeDN("dn", entry.getDN(), writer, wrapLines, wrapColumn); |
| | | writeDN("dn", entry.getName(), writer, wrapLines, wrapColumn); |
| | | |
| | | |
| | | // Next, the changetype. |
| | |
| | | |
| | | |
| | | // Add the DN and changetype lines. |
| | | writeDN("dn", entry.getDN(), writer, wrapLines, wrapColumn); |
| | | writeDN("dn", entry.getName(), writer, wrapLines, wrapColumn); |
| | | |
| | | StringBuilder changeTypeLine = new StringBuilder("changetype: delete"); |
| | | writeLDIFLine(changeTypeLine, writer, wrapLines, wrapColumn); |
| | |
| | | } |
| | | else |
| | | { |
| | | setProxiedAuthorizationDN(authorizationEntry.getDN()); |
| | | setProxiedAuthorizationDN(authorizationEntry.getName()); |
| | | } |
| | | } |
| | | else if (OID_PROXIED_AUTH_V2.equals(oid)) |
| | |
| | | } |
| | | else |
| | | { |
| | | setProxiedAuthorizationDN(authorizationEntry.getDN()); |
| | | setProxiedAuthorizationDN(authorizationEntry.getName()); |
| | | } |
| | | } |
| | | else if (OID_PERSISTENT_SEARCH.equals(oid)) |
| | |
| | | } |
| | | else |
| | | { |
| | | setProxiedAuthorizationDN(authorizationEntry.getDN()); |
| | | setProxiedAuthorizationDN(authorizationEntry.getName()); |
| | | } |
| | | } |
| | | else if (oid.equals(OID_PROXIED_AUTH_V2)) |
| | |
| | | } |
| | | else |
| | | { |
| | | setProxiedAuthorizationDN(authorizationEntry.getDN()); |
| | | setProxiedAuthorizationDN(authorizationEntry.getName()); |
| | | } |
| | | } |
| | | else if (oid.equals(OID_PASSWORD_POLICY_CONTROL)) |
| | |
| | | } |
| | | else |
| | | { |
| | | setUserEntryDN(userEntry.getDN()); |
| | | setUserEntryDN(userEntry.getName()); |
| | | } |
| | | |
| | | |
| | |
| | | ERR_BIND_REJECTED_LOCKDOWN_MODE.get()); |
| | | } |
| | | setAuthenticationInfo(new AuthenticationInfo(userEntry, getBindDN(), |
| | | DirectoryServer.isRootDN(userEntry.getDN()))); |
| | | DirectoryServer.isRootDN(userEntry.getName()))); |
| | | |
| | | // Set resource limits for the authenticated user. |
| | | setResourceLimits(userEntry); |
| | |
| | | ERR_BIND_REJECTED_LOCKDOWN_MODE.get()); |
| | | } |
| | | setAuthenticationInfo(new AuthenticationInfo(userEntry, getBindDN(), |
| | | DirectoryServer.isRootDN(userEntry.getDN()))); |
| | | DirectoryServer.isRootDN(userEntry.getName()))); |
| | | |
| | | // Set resource limits for the authenticated user. |
| | | setResourceLimits(userEntry); |
| | |
| | | // Create the password policy state object. |
| | | if (saslAuthUserEntry != null) |
| | | { |
| | | setUserEntryDN(saslAuthUserEntry.getDN()); |
| | | setUserEntryDN(saslAuthUserEntry.getName()); |
| | | |
| | | // FIXME -- Need to have a way to enable debugging. |
| | | authPolicyState = AuthenticationPolicyState.forUser( |
| | |
| | | { |
| | | // This policy isn't applicable to root users, so if it's a root |
| | | // user then ignore it. |
| | | if (! DirectoryServer.isRootDN(userEntry.getDN())) |
| | | if (! DirectoryServer.isRootDN(userEntry.getName())) |
| | | { |
| | | throw new DirectoryException(ResultCode.INVALID_CREDENTIALS, |
| | | ERR_BIND_OPERATION_WRITABILITY_DISABLED.get( |
| | | String.valueOf(userEntry.getDN()))); |
| | | String.valueOf(userEntry.getName()))); |
| | | } |
| | | } |
| | | |
| | |
| | | throw new DirectoryException(ResultCode.INVALID_CREDENTIALS, |
| | | ERR_BIND_OPERATION_INSECURE_SASL_BIND.get( |
| | | saslMechanism, |
| | | String.valueOf(userEntry.getDN()))); |
| | | String.valueOf(userEntry.getName()))); |
| | | } |
| | | } |
| | | else |
| | |
| | | } |
| | | |
| | | logError(cannotProcessAttributeMessage.get(v.getValue().toString(), |
| | | String.valueOf(userEntry.getDN()))); |
| | | String.valueOf(userEntry.getName()))); |
| | | } |
| | | } |
| | | else if (a.size() > 1) |
| | | { |
| | | logError(nonUniqueAttributeMessage.get(String |
| | | .valueOf(userEntry.getDN()))); |
| | | .valueOf(userEntry.getName()))); |
| | | } |
| | | } |
| | | return null; |
| | |
| | | } |
| | | else |
| | | { |
| | | setProxiedAuthorizationDN(authorizationEntry.getDN()); |
| | | setProxiedAuthorizationDN(authorizationEntry.getName()); |
| | | } |
| | | } |
| | | else if (oid.equals(OID_PROXIED_AUTH_V2)) |
| | |
| | | } |
| | | else |
| | | { |
| | | setProxiedAuthorizationDN(authorizationEntry.getDN()); |
| | | setProxiedAuthorizationDN(authorizationEntry.getName()); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | setProxiedAuthorizationDN(authorizationEntry.getDN()); |
| | | setProxiedAuthorizationDN(authorizationEntry.getName()); |
| | | } |
| | | } |
| | | else if (oid.equals(OID_PROXIED_AUTH_V2)) |
| | |
| | | } |
| | | else |
| | | { |
| | | setProxiedAuthorizationDN(authorizationEntry.getDN()); |
| | | setProxiedAuthorizationDN(authorizationEntry.getName()); |
| | | } |
| | | } |
| | | |
| | |
| | | for (PersistentSearch psearch : wfe.getPersistentSearches()) |
| | | { |
| | | psearch.processModifyDN(newEntry, getChangeNumber(), currentEntry |
| | | .getDN()); |
| | | .getName()); |
| | | } |
| | | |
| | | // Notify change listeners. |
| | |
| | | } |
| | | else |
| | | { |
| | | setProxiedAuthorizationDN(authorizationEntry.getDN()); |
| | | setProxiedAuthorizationDN(authorizationEntry.getName()); |
| | | } |
| | | } |
| | | else if (oid.equals(OID_PROXIED_AUTH_V2)) |
| | |
| | | } |
| | | else |
| | | { |
| | | setProxiedAuthorizationDN(authorizationEntry.getDN()); |
| | | setProxiedAuthorizationDN(authorizationEntry.getName()); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | setProxiedAuthorizationDN(authorizationEntry.getDN()); |
| | | setProxiedAuthorizationDN(authorizationEntry.getName()); |
| | | } |
| | | } |
| | | else if (oid.equals(OID_PROXIED_AUTH_V2)) |
| | |
| | | } |
| | | else |
| | | { |
| | | setProxiedAuthorizationDN(authorizationEntry.getDN()); |
| | | setProxiedAuthorizationDN(authorizationEntry.getName()); |
| | | } |
| | | } |
| | | else if (oid.equals(OID_PASSWORD_POLICY_CONTROL)) |
| | |
| | | { |
| | | AttributeType t = attr.getAttributeType(); |
| | | |
| | | RDN rdn = modifiedEntry.getDN().rdn(); |
| | | RDN rdn = modifiedEntry.getName().rdn(); |
| | | if ((rdn != null) && rdn.hasAttributeType(t) && |
| | | (! modifiedEntry.hasValue(t, attr.getOptions(), |
| | | rdn.getAttributeValue(t)))) |
| | |
| | | |
| | | // Make sure that the RDN attribute value(s) has not been removed. |
| | | AttributeType t = attr.getAttributeType(); |
| | | RDN rdn = modifiedEntry.getDN().rdn(); |
| | | RDN rdn = modifiedEntry.getName().rdn(); |
| | | if ((rdn != null) |
| | | && rdn.hasAttributeType(t) |
| | | && (!modifiedEntry.hasValue(t, attr.getOptions(), rdn |
| | |
| | | { |
| | | // The specified attribute type must not be an RDN attribute. |
| | | AttributeType t = attr.getAttributeType(); |
| | | RDN rdn = modifiedEntry.getDN().rdn(); |
| | | RDN rdn = modifiedEntry.getName().rdn(); |
| | | if ((rdn != null) && rdn.hasAttributeType(t)) |
| | | { |
| | | throw newDirectoryException(modifiedEntry, ResultCode.NOT_ALLOWED_ON_RDN, |
| | |
| | | if (selfChange) |
| | | { |
| | | AuthenticationInfo authInfo = clientConnection.getAuthenticationInfo(); |
| | | if (authInfo.getAuthenticationDN().equals(modifiedEntry.getDN())) |
| | | if (authInfo.getAuthenticationDN().equals(modifiedEntry.getName())) |
| | | { |
| | | clientConnection.setMustChangePassword(false); |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | setProxiedAuthorizationDN(authorizationEntry.getDN()); |
| | | setProxiedAuthorizationDN(authorizationEntry.getName()); |
| | | } |
| | | } |
| | | else if (oid.equals(OID_PROXIED_AUTH_V2)) |
| | |
| | | } |
| | | else |
| | | { |
| | | setProxiedAuthorizationDN(authorizationEntry.getDN()); |
| | | setProxiedAuthorizationDN(authorizationEntry.getName()); |
| | | } |
| | | } |
| | | else if (oid.equals(OID_PERSISTENT_SEARCH)) |
| | |
| | | */ |
| | | public static void deleteEntry(Entry entry) throws Exception |
| | | { |
| | | deleteEntry(entry.getDN()); |
| | | deleteEntry(entry.getName()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | private void addEntry(Entry entry) { |
| | | MockEntry parent = rootEntry; |
| | | DN entryDN = entry.getDN(); |
| | | DN entryDN = entry.getName(); |
| | | |
| | | // Create required glue entries. |
| | | for (int i = 0; i < entryDN.size() - 1; i++) { |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin.server; |
| | | |
| | |
| | | return mo.getConfiguration(); |
| | | } catch (DefinitionDecodingException e) { |
| | | throw ConfigExceptionFactory.getInstance() |
| | | .createDecodingExceptionAdaptor(entry.getDN(), e); |
| | | .createDecodingExceptionAdaptor(entry.getName(), e); |
| | | } catch (ServerManagedObjectDecodingException e) { |
| | | throw ConfigExceptionFactory.getInstance() |
| | | .createDecodingExceptionAdaptor(e); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.admin.server; |
| | | |
| | |
| | | InternalClientConnection conn = InternalClientConnection |
| | | .getRootConnection(); |
| | | |
| | | AddOperation add = conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | AddOperation add = conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), entry.getOperationalAttributes()); |
| | | |
| | | Assert.assertEquals(add.getResultCode(), expected, add.getErrorMessage() |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions copyright 2011 ForgeRock AS. |
| | | * Portions Copyright 2011-2014 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.api; |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | DN schemaDN = DN.valueOf("cn=schema"); |
| | | Entry schemaEntry = schemaBackend.getEntry(schemaDN); |
| | | assertNotNull(schemaEntry); |
| | | assertEquals(schemaEntry.getDN(), schemaDN); |
| | | assertEquals(schemaEntry.getName(), schemaDN); |
| | | |
| | | AttributeType t = DirectoryServer.getAttributeType("attributetypes"); |
| | | assertTrue(schemaEntry.hasAttribute(t)); |
| | |
| | | DN schemaDN = DN.valueOf("cn=schema"); |
| | | Entry schemaEntry = schemaBackend.getSchemaEntry(schemaDN, false); |
| | | assertNotNull(schemaEntry); |
| | | assertEquals(schemaEntry.getDN(), schemaDN); |
| | | assertEquals(schemaEntry.getName(), schemaDN); |
| | | |
| | | AttributeType t = DirectoryServer.getAttributeType("attributetypes"); |
| | | assertTrue(schemaEntry.hasAttribute(t)); |
| | |
| | | schemaDN = DN.valueOf("cn=subschema"); |
| | | schemaEntry = schemaBackend.getSchemaEntry(schemaDN, false); |
| | | assertNotNull(schemaEntry); |
| | | assertEquals(schemaEntry.getDN(), schemaDN); |
| | | assertEquals(schemaEntry.getName(), schemaDN); |
| | | |
| | | t = DirectoryServer.getAttributeType("attributetypes"); |
| | | assertTrue(schemaEntry.hasAttribute(t)); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends.jeb; |
| | | |
| | |
| | | new LDIFReader(new LDIFImportConfig(ldifEntryStream)); |
| | | for(int i =0; i<numEntries;i++) { |
| | | Entry entry = reader.readEntry(false); |
| | | entryTreeMap.put(entry.getDN(), entry); |
| | | entryTreeMap.put(entry.getName(), entry); |
| | | AddOperation addOperation = |
| | | connection.processAdd(entry.getDN(), |
| | | connection.processAdd(entry.getName(), |
| | | entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | |
| | | public void testAdd() throws Exception { |
| | | for (Entry topEntry : topEntries) { |
| | | backend.addEntry(topEntry, null); |
| | | assertNotNull(backend.getEntry(topEntry.getDN())); |
| | | assertNotNull(backend.getEntry(topEntry.getName())); |
| | | } |
| | | |
| | | for (Entry entry : entries) { |
| | | backend.addEntry(entry, null); |
| | | assertNotNull(backend.getEntry(entry.getDN())); |
| | | assertNotNull(backend.getEntry(entry.getName())); |
| | | } |
| | | } |
| | | |
| | |
| | | List<SearchResultEntry> result = search.getSearchEntries(); |
| | | |
| | | assertEquals(result.size(), 1); |
| | | assertEquals(result.get(0).getDN().toString(), "dc=test,dc=com"); |
| | | assertEquals(result.get(0).getName().toString(), "dc=test,dc=com"); |
| | | |
| | | search = conn.processSearch(DN.valueOf("dc=test,dc=com"), |
| | | SearchScope.BASE_OBJECT, LDAPFilter.decode("(ou=People)").toSearchFilter()); |
| | |
| | | result = search.getSearchEntries(); |
| | | |
| | | assertEquals(result.size(), 1); |
| | | assertEquals(result.get(0).getDN().toString(), |
| | | assertEquals(result.get(0).getName().toString(), |
| | | "ou=People,dc=test,dc=com"); |
| | | |
| | | search = conn.processSearch(DN.valueOf("dc=test,dc=com"), |
| | |
| | | |
| | | assertEquals(result.size(), 13); |
| | | for (Entry entry : result) { |
| | | assertThat(entry.getDN().toString()).isNotEqualTo("dc=test,dc=com"); |
| | | assertThat(entry.getName().toString()).isNotEqualTo("dc=test,dc=com"); |
| | | } |
| | | |
| | | search = conn.processSearch(DN.valueOf("dc=test,dc=com"), |
| | |
| | | DN subDN = DN.valueOf("uid=user.0,ou=Good People,ou=JEB Testers,dc=test,dc=com"); |
| | | Entry subEntry = backend.getEntry(subDN); |
| | | assertNotNull(subEntry); |
| | | assertEquals(subDN, subEntry.getDN()); |
| | | assertEquals(subDN, subEntry.getName()); |
| | | EntryID newSubordinateID = ec.getDN2ID().get(null, subDN, LockMode.DEFAULT); |
| | | assertTrue(newSubordinateID.compareTo(newID) > 0); |
| | | |
| | |
| | | //Add 2 more entries to overflow the index entry limit. |
| | | for (Entry entry : additionalEntries) { |
| | | backend.addEntry(entry, null); |
| | | assertNotNull(backend.getEntry(entry.getDN())); |
| | | assertNotNull(backend.getEntry(entry.getName())); |
| | | } |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | |
| | | for (Entry entry : entryList) { |
| | | entryContainer.addEntry(entry, null); |
| | | Entry afterEntry = entryContainer.getEntry(entry.getDN()); |
| | | Entry afterEntry = entryContainer.getEntry(entry.getName()); |
| | | assertTrue(afterEntry != null); |
| | | } |
| | | actualHighestID = entryContainer.getHighestEntryID(); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends.jeb; |
| | | |
| | |
| | | buffer.append((byte)0x01); |
| | | |
| | | // TODO: Can we encode the DN directly into buffer? |
| | | byte[] dnBytes = getBytes(entry.getDN().toString()); |
| | | byte[] dnBytes = getBytes(entry.getName().toString()); |
| | | buffer.appendBERLength(dnBytes.length); |
| | | buffer.append(dnBytes); |
| | | |
| | |
| | | if (! config.excludeDN()) |
| | | { |
| | | // TODO: Can we encode the DN directly into buffer? |
| | | byte[] dnBytes = getBytes(entry.getDN().toString()); |
| | | byte[] dnBytes = getBytes(entry.getName().toString()); |
| | | buffer.appendBERLength(dnBytes.length); |
| | | buffer.append(dnBytes); |
| | | } |
| | |
| | | assertEquals(entryBefore.getAttributes().size(), entryAfter |
| | | .getAttributes().size()); |
| | | |
| | | assertEquals(entryBefore.getDN(), entryAfter.getDN()); |
| | | assertEquals(entryBefore.getName(), entryAfter.getName()); |
| | | |
| | | // check the object classes were not changed |
| | | for (String ocBefore : entryBefore.getObjectClasses().values()) { |
| | |
| | | entryAfterV2 = Entry.decode(bsb.asReader()); |
| | | if (config.excludeDN()) |
| | | { |
| | | entryAfterV2.setDN(entryBefore.getDN()); |
| | | entryAfterV2.setDN(entryBefore.getName()); |
| | | } |
| | | assertEquals(entryBefore, entryAfterV2); |
| | | } |
| | |
| | | entryAfterV3 = Entry.decode(bsb.asReader()); |
| | | if (config.excludeDN()) |
| | | { |
| | | entryAfterV3.setDN(entryBefore.getDN()); |
| | | entryAfterV3.setDN(entryBefore.getName()); |
| | | } |
| | | assertEquals(entryBefore, entryAfterV3); |
| | | } |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ProxiedAuthV1Control proxyControl = |
| | | new ProxiedAuthV1Control(DN.valueOf("uid=test,o=test")); |
| | | |
| | | assertEquals(proxyControl.getAuthorizationEntry().getDN(), |
| | | assertEquals(proxyControl.getAuthorizationEntry().getName(), |
| | | DN.valueOf("uid=test,o=test")); |
| | | } |
| | | |
| | |
| | | |
| | | ProxiedAuthV2Control proxyControl = |
| | | new ProxiedAuthV2Control(ByteString.valueOf("dn:uid=test,o=test")); |
| | | assertEquals(proxyControl.getAuthorizationEntry().getDN(), |
| | | assertEquals(proxyControl.getAuthorizationEntry().getName(), |
| | | DN.valueOf("uid=test,o=test")); |
| | | } |
| | | |
| | |
| | | |
| | | ProxiedAuthV2Control proxyControl = |
| | | new ProxiedAuthV2Control(ByteString.valueOf("u:test")); |
| | | assertEquals(proxyControl.getAuthorizationEntry().getDN(), |
| | | assertEquals(proxyControl.getAuthorizationEntry().getName(), |
| | | DN.valueOf("uid=test,o=test")); |
| | | } |
| | | |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions copyright 2011-2013 ForgeRock AS. |
| | | * Portions Copyright 2011-2014 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.core; |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | noControls, ByteString.valueOf("ou=People,o=test"), |
| | | ldapAttrList), |
| | | new AddOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(), |
| | | null, entry.getDN(), entry.getObjectClasses(), |
| | | null, entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()), |
| | | new AddOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(), |
| | | noControls, entry.getDN(), entry.getObjectClasses(), |
| | | noControls, entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()), |
| | | }; |
| | |
| | | |
| | | AddOperationBasis addOperation = |
| | | new AddOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(), |
| | | null, entry.getDN(), entry.getObjectClasses(), |
| | | null, entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertNotNull(addOperation.getEntryDN()); |
| | |
| | | |
| | | AddOperationBasis addOperation = |
| | | new AddOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(), |
| | | null, entry.getDN(), entry.getObjectClasses(), |
| | | null, entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertNotNull(addOperation.getEntryDN()); |
| | |
| | | UpdatePreOpPlugin.addObjectClassToAdd(oc); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | UpdatePreOpPlugin.addObjectClassToRemove(oc); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | UpdatePreOpPlugin.addAttributeToSet(a); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | UpdatePreOpPlugin.addAttributeToSet(a); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | UpdatePreOpPlugin.addAttributeToRemove(attrType); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertFalse(addOperation.getResultCode() == ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertFalse(addOperation.getResultCode() == ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertFalse(addOperation.getResultCode() == ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertFalse(addOperation.getResultCode() == ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertFalse(addOperation.getResultCode() == ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertFalse(addOperation.getResultCode() == ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertFalse(addOperation.getResultCode() == ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertFalse(addOperation.getResultCode() == ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), userAttrs, |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), userAttrs, |
| | | entry.getOperationalAttributes()); |
| | | assertFalse(addOperation.getResultCode() == ResultCode.SUCCESS); |
| | | } |
| | |
| | | DirectoryServer.setWritabilityMode(WritabilityMode.DISABLED); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertFalse(addOperation.getResultCode() == ResultCode.SUCCESS); |
| | |
| | | DirectoryServer.setWritabilityMode(WritabilityMode.INTERNAL_ONLY); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | b.setWritabilityMode(WritabilityMode.DISABLED); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertFalse(addOperation.getResultCode() == ResultCode.SUCCESS); |
| | |
| | | b.setWritabilityMode(WritabilityMode.INTERNAL_ONLY); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertFalse(addOperation.getResultCode() == ResultCode.SUCCESS); |
| | |
| | | |
| | | AddOperationBasis addOperation = |
| | | new AddOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(), |
| | | null, entry.getDN(), entry.getObjectClasses(), |
| | | null, entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | |
| | |
| | | |
| | | AddOperationBasis addOperation = |
| | | new AddOperationBasis(conn, InternalClientConnection.nextOperationID(), InternalClientConnection.nextMessageID(), |
| | | null, entry.getDN(), entry.getObjectClasses(), |
| | | null, entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.BUSY); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(backendEntry.getDN(), backendEntry.getObjectClasses(), |
| | | conn.processAdd(backendEntry.getName(), backendEntry.getObjectClasses(), |
| | | backendEntry.getUserAttributes(), |
| | | backendEntry.getOperationalAttributes()); |
| | | assertFalse(addOperation.getResultCode() == ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(backendEntry.getDN(), backendEntry.getObjectClasses(), |
| | | conn.processAdd(backendEntry.getName(), backendEntry.getObjectClasses(), |
| | | backendEntry.getUserAttributes(), |
| | | backendEntry.getOperationalAttributes()); |
| | | assertFalse(addOperation.getResultCode() == ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(backendEntry.getDN(), backendEntry.getObjectClasses(), |
| | | conn.processAdd(backendEntry.getName(), backendEntry.getObjectClasses(), |
| | | backendEntry.getUserAttributes(), |
| | | backendEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNull(DirectoryServer.getBackend(backendID)); |
| | | assertNull(DirectoryServer.getBackendWithBaseDN(baseDN)); |
| | | |
| | | DeleteOperation deleteOperation = conn.processDelete(backendEntry.getDN()); |
| | | DeleteOperation deleteOperation = conn.processDelete(backendEntry.getName()); |
| | | assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(backendEntry.getDN(), backendEntry.getObjectClasses(), |
| | | conn.processAdd(backendEntry.getName(), backendEntry.getObjectClasses(), |
| | | backendEntry.getUserAttributes(), |
| | | backendEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | assertTrue(DirectoryServer.isNamingContext(baseDN)); |
| | | |
| | | Entry e = createEntry(baseDN); |
| | | addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertTrue(backend.entryExists(baseDN)); |
| | | |
| | | DeleteOperation deleteOperation = conn.processDelete(backendEntry.getDN()); |
| | | DeleteOperation deleteOperation = conn.processDelete(backendEntry.getName()); |
| | | assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNull(DirectoryServer.getBackend(backendID)); |
| | | } |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(backendEntry.getDN(), backendEntry.getObjectClasses(), |
| | | conn.processAdd(backendEntry.getName(), backendEntry.getObjectClasses(), |
| | | backendEntry.getUserAttributes(), |
| | | backendEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | mods.add(new Modification(ModificationType.REPLACE, |
| | | Attributes.create("ds-cfg-enabled", "true"))); |
| | | ModifyOperation modifyOperation = |
| | | conn.processModify(backendEntry.getDN(), mods); |
| | | conn.processModify(backendEntry.getName(), mods); |
| | | assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | Backend backend = DirectoryServer.getBackend(backendID); |
| | |
| | | assertTrue(DirectoryServer.isNamingContext(baseDN)); |
| | | |
| | | Entry e = createEntry(baseDN); |
| | | addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | mods.add(new Modification(ModificationType.REPLACE, |
| | | Attributes.create("ds-cfg-enabled", "false"))); |
| | | modifyOperation = |
| | | conn.processModify(backendEntry.getDN(), mods); |
| | | conn.processModify(backendEntry.getName(), mods); |
| | | assertNull(DirectoryServer.getBackend(backendID)); |
| | | assertFalse(DirectoryServer.entryExists(baseDN)); |
| | | assertFalse(DirectoryServer.isNamingContext(baseDN)); |
| | | |
| | | |
| | | // Delete the disabled backend. |
| | | DeleteOperation deleteOperation = conn.processDelete(backendEntry.getDN()); |
| | | DeleteOperation deleteOperation = conn.processDelete(backendEntry.getName()); |
| | | assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(parentBackendEntry.getDN(), |
| | | conn.processAdd(parentBackendEntry.getName(), |
| | | parentBackendEntry.getObjectClasses(), |
| | | parentBackendEntry.getUserAttributes(), |
| | | parentBackendEntry.getOperationalAttributes()); |
| | |
| | | assertTrue(DirectoryServer.isNamingContext(parentBaseDN)); |
| | | |
| | | Entry e = createEntry(parentBaseDN); |
| | | addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | childBaseDN); |
| | | |
| | | addOperation = |
| | | conn.processAdd(childBackendEntry.getDN(), |
| | | conn.processAdd(childBackendEntry.getName(), |
| | | childBackendEntry.getObjectClasses(), |
| | | childBackendEntry.getUserAttributes(), |
| | | childBackendEntry.getOperationalAttributes()); |
| | |
| | | assertFalse(DirectoryServer.isNamingContext(childBaseDN)); |
| | | |
| | | e = createEntry(childBaseDN); |
| | | addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | // Make sure that we can't remove the parent backend with the child still |
| | | // in place. |
| | | DeleteOperation deleteOperation = |
| | | conn.processDelete(parentBackendEntry.getDN()); |
| | | conn.processDelete(parentBackendEntry.getName()); |
| | | assertFalse(deleteOperation.getResultCode() == ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getBackend(parentBackendID)); |
| | | |
| | | // Delete the child and then delete the parent. |
| | | deleteOperation = conn.processDelete(childBackendEntry.getDN()); |
| | | deleteOperation = conn.processDelete(childBackendEntry.getName()); |
| | | assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNull(DirectoryServer.getBackend(childBackendID)); |
| | | assertTrue(parentBackend.getSubordinateBackends().length == 0); |
| | | |
| | | deleteOperation = conn.processDelete(parentBackendEntry.getDN()); |
| | | deleteOperation = conn.processDelete(parentBackendEntry.getName()); |
| | | assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNull(DirectoryServer.getBackend(parentBackendID)); |
| | | } |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(childBackendEntry.getDN(), |
| | | conn.processAdd(childBackendEntry.getName(), |
| | | childBackendEntry.getObjectClasses(), |
| | | childBackendEntry.getUserAttributes(), |
| | | childBackendEntry.getOperationalAttributes()); |
| | |
| | | assertFalse(childBackend.entryExists(childBaseDN)); |
| | | |
| | | Entry e = createEntry(childBaseDN); |
| | | addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | parentBaseDN); |
| | | |
| | | addOperation = |
| | | conn.processAdd(parentBackendEntry.getDN(), |
| | | conn.processAdd(parentBackendEntry.getName(), |
| | | parentBackendEntry.getObjectClasses(), |
| | | parentBackendEntry.getUserAttributes(), |
| | | parentBackendEntry.getOperationalAttributes()); |
| | |
| | | assertTrue(parentBackend.getSubordinateBackends().length == 1); |
| | | |
| | | e = createEntry(parentBaseDN); |
| | | addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | // Delete the backends from the server. |
| | | DeleteOperation deleteOperation = |
| | | conn.processDelete(childBackendEntry.getDN()); |
| | | conn.processDelete(childBackendEntry.getName()); |
| | | assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNull(DirectoryServer.getBackend(childBackendID)); |
| | | assertTrue(parentBackend.getSubordinateBackends().length == 0); |
| | | |
| | | deleteOperation = conn.processDelete(parentBackendEntry.getDN()); |
| | | deleteOperation = conn.processDelete(parentBackendEntry.getName()); |
| | | assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNull(DirectoryServer.getBackend(parentBackendID)); |
| | | } |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(parentBackendEntry.getDN(), |
| | | conn.processAdd(parentBackendEntry.getName(), |
| | | parentBackendEntry.getObjectClasses(), |
| | | parentBackendEntry.getUserAttributes(), |
| | | parentBackendEntry.getOperationalAttributes()); |
| | |
| | | assertFalse(parentBackend.entryExists(parentBaseDN)); |
| | | |
| | | Entry e = createEntry(parentBaseDN); |
| | | addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | grandchildBaseDN); |
| | | |
| | | addOperation = |
| | | conn.processAdd(grandchildBackendEntry.getDN(), |
| | | conn.processAdd(grandchildBackendEntry.getName(), |
| | | grandchildBackendEntry.getObjectClasses(), |
| | | grandchildBackendEntry.getUserAttributes(), |
| | | grandchildBackendEntry.getOperationalAttributes()); |
| | |
| | | // Verify that we can't create the grandchild base entry because its parent |
| | | // doesn't exist. |
| | | e = createEntry(grandchildBaseDN); |
| | | addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.NO_SUCH_OBJECT); |
| | |
| | | childBaseDN); |
| | | |
| | | addOperation = |
| | | conn.processAdd(childBackendEntry.getDN(), |
| | | conn.processAdd(childBackendEntry.getName(), |
| | | childBackendEntry.getObjectClasses(), |
| | | childBackendEntry.getUserAttributes(), |
| | | childBackendEntry.getOperationalAttributes()); |
| | |
| | | assertEquals(grandchildBackend.getParentBackend(), childBackend); |
| | | |
| | | e = createEntry(childBaseDN); |
| | | addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | // Now we can create the grandchild base entry. |
| | | e = createEntry(grandchildBaseDN); |
| | | addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | Attributes.create("ds-cfg-enabled", |
| | | "false"))); |
| | | ModifyOperation modifyOperation = |
| | | conn.processModify(childBackendEntry.getDN(), mods); |
| | | conn.processModify(childBackendEntry.getName(), mods); |
| | | assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | |
| | | mods = new ArrayList<Modification>(); |
| | | mods.add(new Modification(ModificationType.REPLACE, |
| | | Attributes.create("ds-cfg-enabled", "true"))); |
| | | modifyOperation = conn.processModify(childBackendEntry.getDN(), mods); |
| | | modifyOperation = conn.processModify(childBackendEntry.getName(), mods); |
| | | assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | |
| | | // Add the child entry back into the server to get things back to the way |
| | | // they were before we disabled the backend. |
| | | e = createEntry(childBaseDN); |
| | | addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | // Get rid of the entries in the proper order. |
| | | DeleteOperation deleteOperation = |
| | | conn.processDelete(grandchildBackendEntry.getDN()); |
| | | conn.processDelete(grandchildBackendEntry.getName()); |
| | | assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNull(DirectoryServer.getBackend(grandchildBackendID)); |
| | | assertTrue(childBackend.getSubordinateBackends().length == 0); |
| | | assertTrue(parentBackend.getSubordinateBackends().length == 1); |
| | | |
| | | deleteOperation = conn.processDelete(childBackendEntry.getDN()); |
| | | deleteOperation = conn.processDelete(childBackendEntry.getName()); |
| | | assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNull(DirectoryServer.getBackend(childBackendID)); |
| | | assertTrue(parentBackend.getSubordinateBackends().length == 0); |
| | | |
| | | deleteOperation = conn.processDelete(parentBackendEntry.getDN()); |
| | | deleteOperation = conn.processDelete(parentBackendEntry.getName()); |
| | | assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNull(DirectoryServer.getBackend(parentBackendID)); |
| | | } |
| | |
| | | // new InternalClientConnection(new AuthenticationInfo()); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | "allow(proxy) userdn=\"ldap:///uid=proxy.user,o=test\";)" |
| | | ); |
| | | AddOperation addOperation = |
| | | connection.processAdd(entry.getDN(), |
| | | connection.processAdd(entry.getName(), |
| | | entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(entry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(entry.getName())); |
| | | |
| | | // Add a user capable of using the proxied authorization control. |
| | | TestCaseUtils.addEntry( |
| | |
| | | conn, InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | new ArrayList<Control>(), |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | "uid", ByteString.valueOf("rogasawara")) |
| | | }; |
| | | } |
| | |
| | | conn, InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | new ArrayList<Control>(), |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | "uid", ByteString.valueOf("rogasawara")); |
| | | |
| | | compareOperation.run(); |
| | |
| | | conn, InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | new ArrayList<Control>(), |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | "uid", ByteString.valueOf("rogasawala")); |
| | | |
| | | compareOperation.run(); |
| | |
| | | conn, InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | new ArrayList<Control>(), |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | "description", ByteString.valueOf("rogasawara")); |
| | | |
| | | compareOperation.run(); |
| | |
| | | conn, InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | new ArrayList<Control>(), |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | "NotAnAttribute", |
| | | ByteString.valueOf("rogasawara")); |
| | | |
| | |
| | | conn, InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | new ArrayList<Control>(), |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | "name", |
| | | ByteString.valueOf("Ogasawara")); |
| | | |
| | |
| | | conn, InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | new ArrayList<Control>(), |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | "sn", |
| | | ByteString.valueOf("Ogasawara")); |
| | | |
| | |
| | | conn, InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | new ArrayList<Control>(), |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | "sn;lang-ja", |
| | | ByteString.valueOf("Ogasawara")); |
| | | |
| | |
| | | conn, InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | new ArrayList<Control>(), |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | "givenName;lAnG-En", |
| | | ByteString.valueOf("Rodney")); |
| | | |
| | |
| | | conn, InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | controls, |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | "uid", ByteString.valueOf("rogasawara")); |
| | | |
| | | compareOperation.run(); |
| | |
| | | conn, InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | controls, |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | "uid", ByteString.valueOf("rogasawara")); |
| | | |
| | | compareOperation.run(); |
| | |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | controls, |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | "uid", ByteString.valueOf("rogasawara")); |
| | | |
| | | compareOperation.run(); |
| | |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | controls, |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | "uid", ByteString.valueOf("rogasawara")); |
| | | |
| | | compareOperation.run(); |
| | |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | controls, |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | "uid", ByteString.valueOf("rogasawara")); |
| | | |
| | | compareOperation.run(); |
| | |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | controls, |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | "uid", ByteString.valueOf("rogasawara")); |
| | | |
| | | compareOperation.run(); |
| | |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | controls, |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | "uid", ByteString.valueOf("rogasawara")); |
| | | |
| | | compareOperation.run(); |
| | |
| | | conn, InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | controls, |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | "uid", ByteString.valueOf("rogasawara")); |
| | | |
| | | compareOperation.run(); |
| | |
| | | // operation has completed. |
| | | TestCaseUtils.quiesceServer(); |
| | | |
| | | Lock writeLock = LockManager.lockWrite(entry.getDN()); |
| | | Lock writeLock = LockManager.lockWrite(entry.getName()); |
| | | assertNotNull(writeLock); |
| | | |
| | | try |
| | |
| | | |
| | | CompareRequestProtocolOp compareRequest = |
| | | new CompareRequestProtocolOp( |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | "uid", ByteString.valueOf("rogasawara")); |
| | | message = new LDAPMessage(2, compareRequest); |
| | | w.writeMessage(message); |
| | |
| | | assertEquals(ldapStatistics.getCompareResponses(), compareResponses+1); |
| | | } finally |
| | | { |
| | | LockManager.unlock(entry.getDN(), writeLock); |
| | | LockManager.unlock(entry.getName(), writeLock); |
| | | } |
| | | } finally |
| | | { |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), entry |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), entry |
| | | .getUserAttributes(), entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | |
| | | { |
| | | Entry suffixEntry = StaticUtils.createEntry(suffixDN); |
| | | AddOperation addOperation = |
| | | connection.processAdd(suffixEntry.getDN(), |
| | | connection.processAdd(suffixEntry.getName(), |
| | | suffixEntry.getObjectClasses(), |
| | | suffixEntry.getUserAttributes(), |
| | | suffixEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(suffixEntry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(suffixEntry.getName())); |
| | | } |
| | | |
| | | // Add a search base entry. |
| | |
| | | { |
| | | Entry baseEntry = StaticUtils.createEntry(baseDN); |
| | | AddOperation addOperation = |
| | | connection.processAdd(baseEntry.getDN(), |
| | | connection.processAdd(baseEntry.getName(), |
| | | baseEntry.getObjectClasses(), |
| | | baseEntry.getUserAttributes(), |
| | | baseEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(baseEntry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(baseEntry.getName())); |
| | | } |
| | | |
| | | // Add a test ldapsubentry. |
| | |
| | | "dn: cn=subentry," + BASE, |
| | | "objectclass: ldapsubentry"); |
| | | AddOperation addOperation = |
| | | connection.processAdd(ldapSubentry.getDN(), |
| | | connection.processAdd(ldapSubentry.getName(), |
| | | ldapSubentry.getObjectClasses(), |
| | | ldapSubentry.getUserAttributes(), |
| | | ldapSubentry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(ldapSubentry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(ldapSubentry.getName())); |
| | | |
| | | // Add a test entry. |
| | | testEntry = TestCaseUtils.makeEntry( |
| | |
| | | Entry duplicateEntry = testEntry.duplicate(false); |
| | | |
| | | addOperation = |
| | | connection.processAdd(duplicateEntry.getDN(), |
| | | connection.processAdd(duplicateEntry.getName(), |
| | | duplicateEntry.getObjectClasses(), |
| | | duplicateEntry.getUserAttributes(), |
| | | duplicateEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(testEntry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(testEntry.getName())); |
| | | |
| | | // Add a test referral entry. |
| | | Entry referralEntry = TestCaseUtils.makeEntry( |
| | |
| | | "ref: ldap://hostb/OU=People,O=MNN,C=US", |
| | | "ref: ldap://hostc/OU=People,O=MNN,C=US"); |
| | | addOperation = |
| | | connection.processAdd(referralEntry.getDN(), |
| | | connection.processAdd(referralEntry.getName(), |
| | | referralEntry.getObjectClasses(), |
| | | referralEntry.getUserAttributes(), |
| | | referralEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(referralEntry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(referralEntry.getName())); |
| | | |
| | | Entry level1Entry = TestCaseUtils.makeEntry( |
| | | "dn: ou=level1," + BASE, |
| | |
| | | "objectclass: organizationalunit", |
| | | "ou: level1"); |
| | | addOperation = |
| | | connection.processAdd(level1Entry.getDN(), |
| | | connection.processAdd(level1Entry.getName(), |
| | | level1Entry.getObjectClasses(), |
| | | level1Entry.getUserAttributes(), |
| | | level1Entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(level1Entry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(level1Entry.getName())); |
| | | |
| | | Entry level2Entry = TestCaseUtils.makeEntry( |
| | | "dn: ou=level2,ou=level1," + BASE, |
| | |
| | | "objectclass: organizationalunit", |
| | | "ou: level2"); |
| | | addOperation = |
| | | connection.processAdd(level2Entry.getDN(), |
| | | connection.processAdd(level2Entry.getName(), |
| | | level2Entry.getObjectClasses(), |
| | | level2Entry.getUserAttributes(), |
| | | level2Entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(level2Entry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(level2Entry.getName())); |
| | | |
| | | Entry referral2Entry = TestCaseUtils.makeEntry( |
| | | "dn: ou=level3,ou=level2,ou=level1," + BASE, |
| | |
| | | "ref: ldap://hostc/OU=People,O=MNN,C=US", |
| | | "ref: ldap://hostd/OU=People,O=MNN,C=US"); |
| | | addOperation = |
| | | connection.processAdd(referral2Entry.getDN(), |
| | | connection.processAdd(referral2Entry.getName(), |
| | | referral2Entry.getObjectClasses(), |
| | | referral2Entry.getUserAttributes(), |
| | | referral2Entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(referral2Entry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(referral2Entry.getName())); |
| | | } |
| | | |
| | | |
| | |
| | | assertEquals(entries.size(), 1); |
| | | |
| | | Entry entry = entries.getFirst(); |
| | | assertEquals(entry.getDN(), userDN); |
| | | assertEquals(entry.getName(), userDN); |
| | | |
| | | // Check real attributes. |
| | | List<String> messages = new LinkedList<String>(); |
| | |
| | | assertEquals(entries.size(), 1); |
| | | |
| | | Entry entry = entries.getFirst(); |
| | | assertEquals(entry.getDN(), userDN); |
| | | assertEquals(entry.getName(), userDN); |
| | | |
| | | // Check all expected attributes are present and have |
| | | // the user requested name. |
| | |
| | | @AfterClass |
| | | public void cleanUp() throws Exception |
| | | { |
| | | TestCaseUtils.deleteEntry(collectiveSubentry.getDN()); |
| | | TestCaseUtils.deleteEntry(ldapSubentry.getDN()); |
| | | TestCaseUtils.deleteEntry(legacyLdapSubentry.getDN()); |
| | | TestCaseUtils.deleteEntry(collectiveSubentry.getName()); |
| | | TestCaseUtils.deleteEntry(ldapSubentry.getName()); |
| | | TestCaseUtils.deleteEntry(legacyLdapSubentry.getName()); |
| | | |
| | | SubentryManager manager = DirectoryServer.getSubentryManager(); |
| | | assertNotNull(manager); |
| | | List<SubEntry> subentryList = manager.getSubentries(testEntry.getDN()); |
| | | List<SubEntry> subentryList = manager.getSubentries(testEntry.getName()); |
| | | assertNotNull(subentryList); |
| | | assertTrue(subentryList.isEmpty()); |
| | | subentryList = manager.getCollectiveSubentries(testEntry.getDN()); |
| | | subentryList = manager.getCollectiveSubentries(testEntry.getName()); |
| | | assertNotNull(subentryList); |
| | | assertTrue(subentryList.isEmpty()); |
| | | |
| | |
| | | { |
| | | SubentryManager manager = DirectoryServer.getSubentryManager(); |
| | | assertNotNull(manager); |
| | | List<SubEntry> subentryList = manager.getSubentries(testEntry.getDN()); |
| | | List<SubEntry> subentryList = manager.getSubentries(testEntry.getName()); |
| | | assertNotNull(subentryList); |
| | | assertEquals(subentryList.size(), 2); |
| | | assertEquals(subentryList.get(0).getDN(), ldapSubentry.getDN()); |
| | | assertEquals(subentryList.get(1).getDN(), legacyLdapSubentry.getDN()); |
| | | assertEquals(subentryList.get(0).getDN(), ldapSubentry.getName()); |
| | | assertEquals(subentryList.get(1).getDN(), legacyLdapSubentry.getName()); |
| | | subentryList.clear(); |
| | | subentryList = manager.getSubentries(testEntry); |
| | | assertNotNull(subentryList); |
| | |
| | | assertEquals(subentryList.get(0).getEntry(), ldapSubentry); |
| | | assertEquals(subentryList.get(1).getEntry(), legacyLdapSubentry); |
| | | subentryList.clear(); |
| | | subentryList = manager.getCollectiveSubentries(testEntry.getDN()); |
| | | subentryList = manager.getCollectiveSubentries(testEntry.getName()); |
| | | assertNotNull(subentryList); |
| | | assertEquals(subentryList.size(), 1); |
| | | assertEquals(subentryList.get(0).getDN(), collectiveSubentry.getDN()); |
| | | assertEquals(subentryList.get(0).getDN(), collectiveSubentry.getName()); |
| | | subentryList.clear(); |
| | | subentryList = manager.getCollectiveSubentries(testEntry); |
| | | assertNotNull(subentryList); |
| | | assertEquals(subentryList.size(), 1); |
| | | assertEquals(subentryList.get(0).getEntry(), collectiveSubentry); |
| | | subentryList.clear(); |
| | | subentryList = manager.getSubentries(legacyLdapSubentry.getDN().parent()); |
| | | subentryList = manager.getSubentries(legacyLdapSubentry.getName().parent()); |
| | | assertNotNull(subentryList); |
| | | assertEquals(subentryList.size(), 1); |
| | | assertEquals(subentryList.get(0).getEntry(), legacyLdapSubentry); |
| | | subentryList.clear(); |
| | | subentryList = manager.getSubentries(legacyLdapSubentry.getDN().parent().parent()); |
| | | subentryList = manager.getSubentries(legacyLdapSubentry.getName().parent().parent()); |
| | | assertNotNull(subentryList); |
| | | assertEquals(subentryList.size(), 0); |
| | | } |
| | |
| | | mods.add(new LDAPModification(ModificationType.REPLACE, attr)); |
| | | ModifyOperation modifyOperation = |
| | | conn.processModify(ByteString.valueOf( |
| | | collectiveSubentry.getDN().toNormalizedString()), mods); |
| | | collectiveSubentry.getName().toNormalizedString()), mods); |
| | | assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | Entry entry = DirectoryServer.getEntry(testEntry.getDN()); |
| | | Entry entry = DirectoryServer.getEntry(testEntry.getName()); |
| | | AttributeType attrType = DirectoryServer.getAttributeType( |
| | | "c-l"); |
| | | assertTrue(entry.hasAttribute(attrType)); |
| | |
| | | "subtreeSpecification: {base \"ou=Test SubEntry Manager\"}", |
| | | "cn: Inherited From DN Collective Subentry"); |
| | | AddOperation addOperation = |
| | | connection.processAdd(collectiveDNInheritedSubentry.getDN(), |
| | | connection.processAdd(collectiveDNInheritedSubentry.getName(), |
| | | collectiveDNInheritedSubentry.getObjectClasses(), |
| | | collectiveDNInheritedSubentry.getUserAttributes(), |
| | | collectiveDNInheritedSubentry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry( |
| | | collectiveDNInheritedSubentry.getDN())); |
| | | collectiveDNInheritedSubentry.getName())); |
| | | |
| | | // Add test inherited from RDN collective subentry. |
| | | Entry collectiveRDNInheritedSubentry = TestCaseUtils.makeEntry( |
| | |
| | | "subtreeSpecification: {base \"ou=Test SubEntry Manager\"}", |
| | | "cn: Inherited From RDN Collective Subentry"); |
| | | addOperation = |
| | | connection.processAdd(collectiveRDNInheritedSubentry.getDN(), |
| | | connection.processAdd(collectiveRDNInheritedSubentry.getName(), |
| | | collectiveRDNInheritedSubentry.getObjectClasses(), |
| | | collectiveRDNInheritedSubentry.getUserAttributes(), |
| | | collectiveRDNInheritedSubentry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry( |
| | | collectiveRDNInheritedSubentry.getDN())); |
| | | collectiveRDNInheritedSubentry.getName())); |
| | | |
| | | // Test Inherited Collective Attributes on test entry. |
| | | Entry entry = DirectoryServer.getEntry(testEntry.getDN()); |
| | | Entry entry = DirectoryServer.getEntry(testEntry.getName()); |
| | | AttributeType attrType = DirectoryServer.getAttributeType( |
| | | "postaladdress"); |
| | | assertTrue(entry.hasAttribute(attrType)); |
| | |
| | | "+1 999 999 9999"))); |
| | | |
| | | // Cleanup. |
| | | TestCaseUtils.deleteEntry(collectiveRDNInheritedSubentry.getDN()); |
| | | TestCaseUtils.deleteEntry(collectiveDNInheritedSubentry.getDN()); |
| | | TestCaseUtils.deleteEntry(collectiveRDNInheritedSubentry.getName()); |
| | | TestCaseUtils.deleteEntry(collectiveDNInheritedSubentry.getName()); |
| | | } |
| | | |
| | | @Test |
| | |
| | | mods.add(new LDAPModification(ModificationType.REPLACE, attr)); |
| | | ModifyOperation modifyOperation = |
| | | conn.processModify(ByteString.valueOf( |
| | | testEntry.getDN().toNormalizedString()), mods); |
| | | testEntry.getName().toNormalizedString()), mods); |
| | | assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | // real-overrides-virtual. |
| | |
| | | mods.add(new LDAPModification(ModificationType.REPLACE, attr)); |
| | | modifyOperation = |
| | | conn.processModify(ByteString.valueOf( |
| | | collectiveSubentry.getDN().toNormalizedString()), mods); |
| | | collectiveSubentry.getName().toNormalizedString()), mods); |
| | | assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | Entry entry = DirectoryServer.getEntry(testEntry.getDN()); |
| | | Entry entry = DirectoryServer.getEntry(testEntry.getName()); |
| | | AttributeType attrType = DirectoryServer.getAttributeType( |
| | | "preferredlanguage"); |
| | | assertTrue(entry.hasAttribute(attrType)); |
| | |
| | | mods.add(new LDAPModification(ModificationType.REPLACE, attr)); |
| | | modifyOperation = |
| | | conn.processModify(ByteString.valueOf( |
| | | collectiveSubentry.getDN().toNormalizedString()), mods); |
| | | collectiveSubentry.getName().toNormalizedString()), mods); |
| | | assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | entry = DirectoryServer.getEntry(testEntry.getDN()); |
| | | entry = DirectoryServer.getEntry(testEntry.getName()); |
| | | attrType = DirectoryServer.getAttributeType( |
| | | "preferredlanguage"); |
| | | assertTrue(entry.hasAttribute(attrType)); |
| | |
| | | mods.add(new LDAPModification(ModificationType.REPLACE, attr)); |
| | | modifyOperation = |
| | | conn.processModify(ByteString.valueOf( |
| | | collectiveSubentry.getDN().toNormalizedString()), mods); |
| | | collectiveSubentry.getName().toNormalizedString()), mods); |
| | | assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | entry = DirectoryServer.getEntry(testEntry.getDN()); |
| | | entry = DirectoryServer.getEntry(testEntry.getName()); |
| | | attrType = DirectoryServer.getAttributeType( |
| | | "preferredlanguage"); |
| | | assertTrue(entry.hasAttribute(attrType)); |
| | |
| | | mods.add(new LDAPModification(ModificationType.DELETE, attr)); |
| | | modifyOperation = |
| | | conn.processModify(ByteString.valueOf( |
| | | testEntry.getDN().toNormalizedString()), mods); |
| | | testEntry.getName().toNormalizedString()), mods); |
| | | assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | | |
| | |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | new ArrayList<Control>(), |
| | | ByteString.valueOf(testEntry.getDN().toString()), |
| | | ByteString.valueOf(testEntry.getName().toString()), |
| | | SearchScope.BASE_OBJECT, |
| | | DereferencePolicy.NEVER_DEREF_ALIASES, |
| | | Integer.MAX_VALUE, |
| | |
| | | "collectiveattributesubentries"); |
| | | assertTrue(searchOperation.getSearchEntries().getFirst().hasValue( |
| | | attrType, null, AttributeValues.create(attrType, |
| | | collectiveSubentry.getDN().toNormalizedString()))); |
| | | collectiveSubentry.getName().toNormalizedString()))); |
| | | } |
| | | |
| | | @Test |
| | |
| | | mods.add(new LDAPModification(ModificationType.REPLACE, attr)); |
| | | ModifyOperation modifyOperation = |
| | | conn.processModify(ByteString.valueOf( |
| | | collectiveSubentry.getDN().toNormalizedString()), mods); |
| | | collectiveSubentry.getName().toNormalizedString()), mods); |
| | | assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); |
| | | values = new ArrayList<ByteString>(); |
| | | values.add(ByteString.valueOf("c-l")); |
| | |
| | | mods.add(new LDAPModification(ModificationType.REPLACE, attr)); |
| | | modifyOperation = |
| | | conn.processModify(ByteString.valueOf( |
| | | testEntry.getDN().toNormalizedString()), mods); |
| | | testEntry.getName().toNormalizedString()), mods); |
| | | assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | Entry entry = DirectoryServer.getEntry(testEntry.getDN()); |
| | | Entry entry = DirectoryServer.getEntry(testEntry.getName()); |
| | | AttributeType attrType = DirectoryServer.getAttributeType( |
| | | "c-l"); |
| | | assertFalse(entry.hasAttribute(attrType)); |
| | |
| | | mods.add(new LDAPModification(ModificationType.REPLACE, attr)); |
| | | modifyOperation = |
| | | conn.processModify(ByteString.valueOf( |
| | | testEntry.getDN().toNormalizedString()), mods); |
| | | testEntry.getName().toNormalizedString()), mods); |
| | | assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | entry = DirectoryServer.getEntry(testEntry.getDN()); |
| | | entry = DirectoryServer.getEntry(testEntry.getName()); |
| | | attrType = DirectoryServer.getAttributeType( |
| | | "preferredlanguage"); |
| | | assertFalse(entry.hasAttribute(attrType)); |
| | |
| | | mods.add(new LDAPModification(ModificationType.REPLACE, attr)); |
| | | modifyOperation = |
| | | conn.processModify(ByteString.valueOf( |
| | | testEntry.getDN().toNormalizedString()), mods); |
| | | testEntry.getName().toNormalizedString()), mods); |
| | | assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | entry = DirectoryServer.getEntry(testEntry.getDN()); |
| | | entry = DirectoryServer.getEntry(testEntry.getName()); |
| | | attrType = DirectoryServer.getAttributeType( |
| | | "preferredlanguage"); |
| | | assertFalse(entry.hasAttribute(attrType)); |
| | |
| | | mods.add(new LDAPModification(ModificationType.DELETE, attr)); |
| | | modifyOperation = |
| | | conn.processModify(ByteString.valueOf( |
| | | testEntry.getDN().toNormalizedString()), mods); |
| | | testEntry.getName().toNormalizedString()), mods); |
| | | assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | | |
| | |
| | | { |
| | | // This one should have been added during test setup so just |
| | | // do a quick check here to make sure it is available there. |
| | | assertNotNull(DirectoryServer.getEntry(ldapSubentry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(ldapSubentry.getName())); |
| | | |
| | | // RFC3672 Spec test subentry. |
| | | List<SubEntry> rfc3672SubList = |
| | | DirectoryServer.getSubentryManager().getSubentries(); |
| | | for (SubEntry subentry : rfc3672SubList) |
| | | { |
| | | if (subentry.getDN().equals(ldapSubentry.getDN())) |
| | | if (subentry.getDN().equals(ldapSubentry.getName())) |
| | | { |
| | | SubtreeSpecification spec = subentry.getSubTreeSpecification(); |
| | | assertNull(spec.getRefinements()); |
| | |
| | | "subtreeSpecification: {base \"ou=Test SubEntry Manager\", specificationFilter \"(objectClass=*)\"}", |
| | | "cn: Subentry"); |
| | | AddOperation addOperation = |
| | | connection.processAdd(relativeSubentry.getDN(), |
| | | connection.processAdd(relativeSubentry.getName(), |
| | | relativeSubentry.getObjectClasses(), |
| | | relativeSubentry.getUserAttributes(), |
| | | relativeSubentry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(relativeSubentry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(relativeSubentry.getName())); |
| | | |
| | | List<SubEntry> relativeSubList = |
| | | DirectoryServer.getSubentryManager().getSubentries(); |
| | | for (SubEntry subentry : relativeSubList) |
| | | { |
| | | if (subentry.getDN().equals(relativeSubentry.getDN())) |
| | | if (subentry.getDN().equals(relativeSubentry.getName())) |
| | | { |
| | | SubtreeSpecification spec = subentry.getSubTreeSpecification(); |
| | | assertTrue(spec.getRefinements() instanceof SubtreeSpecification.FilterRefinement); |
| | |
| | | } |
| | | |
| | | // Remove Relative Spec test subentry. |
| | | TestCaseUtils.deleteEntry(relativeSubentry.getDN()); |
| | | TestCaseUtils.deleteEntry(relativeSubentry.getName()); |
| | | } |
| | | |
| | | private void addTestEntries() throws Exception |
| | |
| | | { |
| | | Entry suffixEntry = StaticUtils.createEntry(suffixDN); |
| | | AddOperation addOperation = |
| | | connection.processAdd(suffixEntry.getDN(), |
| | | connection.processAdd(suffixEntry.getName(), |
| | | suffixEntry.getObjectClasses(), |
| | | suffixEntry.getUserAttributes(), |
| | | suffixEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(suffixEntry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(suffixEntry.getName())); |
| | | } |
| | | |
| | | // Add base entry. |
| | |
| | | { |
| | | Entry baseEntry = StaticUtils.createEntry(baseDN); |
| | | AddOperation addOperation = |
| | | connection.processAdd(baseEntry.getDN(), |
| | | connection.processAdd(baseEntry.getName(), |
| | | baseEntry.getObjectClasses(), |
| | | baseEntry.getUserAttributes(), |
| | | baseEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(baseEntry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(baseEntry.getName())); |
| | | } |
| | | |
| | | // Add role entry. |
| | |
| | | "cn: Sales" |
| | | ); |
| | | AddOperation addOperation = |
| | | connection.processAdd(roleEntry.getDN(), |
| | | connection.processAdd(roleEntry.getName(), |
| | | roleEntry.getObjectClasses(), |
| | | roleEntry.getUserAttributes(), |
| | | roleEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(roleEntry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(roleEntry.getName())); |
| | | |
| | | // Add test entry. |
| | | testEntry = TestCaseUtils.makeEntry( |
| | |
| | | "title: Sales" |
| | | ); |
| | | addOperation = |
| | | connection.processAdd(testEntry.getDN(), |
| | | connection.processAdd(testEntry.getName(), |
| | | testEntry.getObjectClasses(), |
| | | testEntry.getUserAttributes(), |
| | | testEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(testEntry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(testEntry.getName())); |
| | | |
| | | // Add test subentry. |
| | | ldapSubentry = TestCaseUtils.makeEntry( |
| | |
| | | "subtreeSpecification: {base \"ou=Test SubEntry Manager\"}", |
| | | "cn: Subentry"); |
| | | addOperation = |
| | | connection.processAdd(ldapSubentry.getDN(), |
| | | connection.processAdd(ldapSubentry.getName(), |
| | | ldapSubentry.getObjectClasses(), |
| | | ldapSubentry.getUserAttributes(), |
| | | ldapSubentry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(ldapSubentry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(ldapSubentry.getName())); |
| | | |
| | | // Add test legacy subentry. |
| | | legacyLdapSubentry = TestCaseUtils.makeEntry( |
| | |
| | | "objectclass: ldapSubentry", |
| | | "cn: Legacy Subentry"); |
| | | addOperation = |
| | | connection.processAdd(legacyLdapSubentry.getDN(), |
| | | connection.processAdd(legacyLdapSubentry.getName(), |
| | | legacyLdapSubentry.getObjectClasses(), |
| | | legacyLdapSubentry.getUserAttributes(), |
| | | legacyLdapSubentry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(legacyLdapSubentry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(legacyLdapSubentry.getName())); |
| | | |
| | | // Add test collective subentry. |
| | | collectiveSubentry = TestCaseUtils.makeEntry( |
| | |
| | | "subtreeSpecification: {base \"ou=Test SubEntry Manager\"}", |
| | | "cn: Collective Subentry"); |
| | | addOperation = |
| | | connection.processAdd(collectiveSubentry.getDN(), |
| | | connection.processAdd(collectiveSubentry.getName(), |
| | | collectiveSubentry.getObjectClasses(), |
| | | collectiveSubentry.getUserAttributes(), |
| | | collectiveSubentry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(collectiveSubentry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(collectiveSubentry.getName())); |
| | | } |
| | | } |
| | |
| | | { |
| | | Entry suffixEntry = StaticUtils.createEntry(suffixDN); |
| | | AddOperation addOperation = |
| | | connection.processAdd(suffixEntry.getDN(), |
| | | connection.processAdd(suffixEntry.getName(), |
| | | suffixEntry.getObjectClasses(), |
| | | suffixEntry.getUserAttributes(), |
| | | suffixEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(suffixEntry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(suffixEntry.getName())); |
| | | } |
| | | |
| | | // Add base entry. |
| | |
| | | { |
| | | Entry baseEntry = StaticUtils.createEntry(baseDN); |
| | | AddOperation addOperation = |
| | | connection.processAdd(baseEntry.getDN(), |
| | | connection.processAdd(baseEntry.getName(), |
| | | baseEntry.getObjectClasses(), |
| | | baseEntry.getUserAttributes(), |
| | | baseEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(baseEntry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(baseEntry.getName())); |
| | | } |
| | | |
| | | // Add test entry. |
| | |
| | | "title: Sales, Director" |
| | | ); |
| | | AddOperation addOperation = |
| | | connection.processAdd(testEntry.getDN(), |
| | | connection.processAdd(testEntry.getName(), |
| | | testEntry.getObjectClasses(), |
| | | testEntry.getUserAttributes(), |
| | | testEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(testEntry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(testEntry.getName())); |
| | | } |
| | | |
| | | @AfterClass |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | connection.processAdd(e.getDN(), |
| | | connection.processAdd(e.getName(), |
| | | e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertTrue(addOperation.getResultCode() != ResultCode.SUCCESS); |
| | | assertNull(DirectoryServer.getEntry(e.getDN())); |
| | | assertNull(DirectoryServer.getEntry(e.getName())); |
| | | } |
| | | |
| | | /** |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | connection.processAdd(policyEntry.getDN(), |
| | | connection.processAdd(policyEntry.getName(), |
| | | policyEntry.getObjectClasses(), |
| | | policyEntry.getUserAttributes(), |
| | | policyEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(policyEntry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(policyEntry.getName())); |
| | | |
| | | PasswordPolicy policy = (PasswordPolicy) DirectoryServer.getAuthenticationPolicy( |
| | | DN.valueOf("cn=Temp Policy," + SUFFIX)); |
| | |
| | | |
| | | // Make sure this policy is gone and default |
| | | // policy is in effect instead. |
| | | TestCaseUtils.deleteEntry(policyEntry.getDN()); |
| | | TestCaseUtils.deleteEntry(policyEntry.getName()); |
| | | statePolicy = AuthenticationPolicy.forUser(testEntry, false); |
| | | assertNotNull(statePolicy); |
| | | assertEquals(defaultPolicy, statePolicy); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = |
| | | connection.processAdd(policyEntry.getDN(), |
| | | connection.processAdd(policyEntry.getName(), |
| | | policyEntry.getObjectClasses(), |
| | | policyEntry.getUserAttributes(), |
| | | policyEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(policyEntry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(policyEntry.getName())); |
| | | |
| | | // Make sure just added policy is in effect. |
| | | testEntry = DirectoryServer.getEntry(DN.valueOf( |
| | |
| | | |
| | | // Remove subentry policy and make sure |
| | | // default policy is in effect again. |
| | | TestCaseUtils.deleteEntry(policyEntry.getDN()); |
| | | TestCaseUtils.deleteEntry(policyEntry.getName()); |
| | | |
| | | testEntry = DirectoryServer.getEntry(DN.valueOf( |
| | | "uid=rogasawara," + BASE)); |
| | |
| | | ); |
| | | |
| | | AddOperation addOperation = |
| | | connection.processAdd(exampleCom.getDN(), |
| | | connection.processAdd(exampleCom.getName(), |
| | | exampleCom.getObjectClasses(), |
| | | exampleCom.getUserAttributes(), |
| | | exampleCom.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(exampleCom.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(exampleCom.getName())); |
| | | |
| | | addOperation = |
| | | connection.processAdd(people.getDN(), |
| | | connection.processAdd(people.getName(), |
| | | people.getObjectClasses(), |
| | | people.getUserAttributes(), |
| | | people.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(people.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(people.getName())); |
| | | |
| | | addOperation = |
| | | connection.processAdd(entry.getDN(), |
| | | connection.processAdd(entry.getName(), |
| | | entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(DirectoryServer.getEntry(entry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(entry.getName())); |
| | | |
| | | // Add a user capable of using the proxied authorization control. |
| | | TestCaseUtils.addEntry( |
| | |
| | | final Entry newEntry = DirectoryServer.getEntry(DN.valueOf(entryDN)); |
| | | assertNotNull(newEntry); |
| | | |
| | | final RDN rdn = newEntry.getDN().rdn(); |
| | | final RDN rdn = newEntry.getName().rdn(); |
| | | for (int i = 0; i < rdn.getNumValues(); i++) |
| | | { |
| | | AttributeType attribute = rdn.getAttributeType(i); |
| | |
| | | "uid=user.0,ou=People,dc=example,dc=com")); |
| | | assertNotNull(newEntry); |
| | | |
| | | assertEquals(newEntry.getDN().toString(), |
| | | assertEquals(newEntry.getName().toString(), |
| | | "uid=USER.0,ou=People,dc=example,dc=com"); |
| | | |
| | | AttributeType at = DirectoryServer.getAttributeType("uid"); |
| | |
| | | |
| | | // Because deleteOldRDN is true, the values from RDN and the entry have to be identical |
| | | ByteString valueFromEntry = attrList.get(0).iterator().next().getValue(); |
| | | ByteString valueFromRDN = newEntry.getDN().rdn().getAttributeValue(at).getValue(); |
| | | ByteString valueFromRDN = newEntry.getName().rdn().getAttributeValue(at).getValue(); |
| | | assertEquals(valueFromEntry,valueFromRDN); |
| | | |
| | | examineCompletedOperation(modifyDNOperation); |
| | |
| | | "uid=userid.0+cn=test,ou=People,dc=example,dc=com")); |
| | | assertNotNull(newEntry); |
| | | |
| | | assertEquals(newEntry.getDN().toString(), |
| | | assertEquals(newEntry.getName().toString(), |
| | | "uid=UserID.0+cn=Test,ou=People,dc=example,dc=com"); |
| | | |
| | | AttributeType at = DirectoryServer.getAttributeType("uid"); |
| | |
| | | |
| | | // Even though the value of the RDN changed, the representation of the entry's value should be preserved |
| | | ByteString valueFromEntry = attrList.get(0).iterator().next().getValue(); |
| | | ByteString valueFromRDN = newEntry.getDN().rdn().getAttributeValue(at).getValue(); |
| | | ByteString valueFromRDN = newEntry.getName().rdn().getAttributeValue(at).getValue(); |
| | | assertEquals(valueFromEntry,ByteString.valueOf("userid.0")); |
| | | |
| | | examineCompletedOperation(modifyDNOperation); |
| | |
| | | "uid=userid.0+sn=jensen,ou=People,dc=example,dc=com")); |
| | | assertNotNull(newEntry); |
| | | |
| | | assertEquals(newEntry.getDN().toString(), |
| | | assertEquals(newEntry.getName().toString(), |
| | | "uid=userid.0+sn=JENSEN,ou=People,dc=example,dc=com"); |
| | | |
| | | AttributeType at = DirectoryServer.getAttributeType("sn"); |
| | |
| | | // Even though the representation of the sn value differs in the RDN, |
| | | // the representation of the entry's value should be preserved |
| | | ByteString valueFromEntry = attrList.get(0).iterator().next().getValue(); |
| | | ByteString valueFromRDN = newEntry.getDN().rdn().getAttributeValue(at).getValue(); |
| | | ByteString valueFromRDN = newEntry.getName().rdn().getAttributeValue(at).getValue(); |
| | | assertEquals(valueFromEntry,ByteString.valueOf("Jensen")); |
| | | |
| | | examineCompletedOperation(modifyDNOperation); |
| | |
| | | InvocationCounterPlugin.resetAllCounters(); |
| | | ModifyDNRequestProtocolOp modifyRequest = |
| | | new ModifyDNRequestProtocolOp( |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | ByteString.valueOf("uid=user.test0"), false); |
| | | LDAPMessage message = new LDAPMessage(2, modifyRequest, |
| | | ShortCircuitPlugin.createShortCircuitControlList(80, "PreOperation")); |
| | |
| | | assertTrue(DirectoryServer.getWorkQueue().waitUntilIdle(10000)); |
| | | |
| | | |
| | | Lock writeLock = LockManager.lockWrite(entry.getDN()); |
| | | Lock writeLock = LockManager.lockWrite(entry.getName()); |
| | | assertNotNull(writeLock); |
| | | |
| | | try |
| | |
| | | |
| | | ModifyDNRequestProtocolOp modifyRequest = |
| | | new ModifyDNRequestProtocolOp( |
| | | ByteString.valueOf(entry.getDN().toString()), |
| | | ByteString.valueOf(entry.getName().toString()), |
| | | ByteString.valueOf("uid=user.test0"), false); |
| | | message = new LDAPMessage(2, modifyRequest); |
| | | w.writeMessage(message); |
| | |
| | | // modifyDNResponses+1); |
| | | } finally |
| | | { |
| | | LockManager.unlock(entry.getDN(), writeLock); |
| | | LockManager.unlock(entry.getName(), writeLock); |
| | | } |
| | | } finally |
| | | { |
| | |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | null, |
| | | entry.getDN(), |
| | | entry.getName(), |
| | | entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | |
| | | Entry userEntry = DirectoryServer.getEntry( |
| | | DN.valueOf("cn=Directory Manager, cn=Root DNs, cn=config")); |
| | | ClientConnection connection2 = new InternalClientConnection( |
| | | new AuthenticationInfo(userEntry, userEntry.getDN(), true)); |
| | | new AuthenticationInfo(userEntry, userEntry.getName(), true)); |
| | | ng = NetworkGroup.findMatchingNetworkGroup(connection2); |
| | | assertEquals(ng, networkGroup2); |
| | | |
| | |
| | | Entry userEntry = DirectoryServer.getEntry( |
| | | DN.valueOf("cn=Directory Manager, cn=Root DNs, cn=config")); |
| | | ClientConnection connection2 = new InternalClientConnection( |
| | | new AuthenticationInfo(userEntry, userEntry.getDN(), true)); |
| | | new AuthenticationInfo(userEntry, userEntry.getName(), true)); |
| | | ng = NetworkGroup.findMatchingNetworkGroup(connection2); |
| | | if (match) { |
| | | assertEquals(ng, networkGroup); |
| | |
| | | "o: " + namingAttribute); |
| | | |
| | | AddOperation addOperation = connection.processAdd( |
| | | e.getDN(), |
| | | e.getName(), |
| | | e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | |
| | | String compromisedTime = TimeThread.getGeneralizedTime(); |
| | | for (Entry e : searchOp.getSearchEntries()) { |
| | | TestCaseUtils.applyModifications(true, |
| | | "dn: " + e.getDN().toNormalizedString(), |
| | | "dn: " + e.getName().toNormalizedString(), |
| | | "changetype: modify", |
| | | "replace: " + ConfigConstants.ATTR_CRYPTO_KEY_COMPROMISED_TIME, |
| | | ConfigConstants.ATTR_CRYPTO_KEY_COMPROMISED_TIME + ": " |
| | |
| | | // using a compromised key can no longer be decrypted. |
| | | for (Entry e : searchOp.getSearchEntries()) { |
| | | TestCaseUtils.applyModifications(true, |
| | | "dn: " + e.getDN().toNormalizedString(), "changetype: delete"); |
| | | "dn: " + e.getName().toNormalizedString(), "changetype: delete"); |
| | | } |
| | | Thread.sleep(1000); // Clearing the cache is asynchronous. |
| | | try { |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions copyright 2012 ForgeRock AS. |
| | | * Portions Copyright 2012-2014 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | TestCaseUtils.initializeTestBackend(false); |
| | | Backend b = DirectoryServer.getBackend(DN.valueOf("o=test")); |
| | | |
| | | assertFalse(cache.containsEntry(testEntriesList.get(0).getDN()), |
| | | "Not expected to find " + testEntriesList.get(0).getDN().toString() + |
| | | assertFalse(cache.containsEntry(testEntriesList.get(0).getName()), |
| | | "Not expected to find " + testEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | | cache.putEntry(testEntriesList.get(0), b, 1); |
| | | |
| | | assertTrue(cache.containsEntry(testEntriesList.get(0).getDN()), |
| | | "Expected to find " + testEntriesList.get(0).getDN().toString() + |
| | | assertTrue(cache.containsEntry(testEntriesList.get(0).getName()), |
| | | "Expected to find " + testEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | |
| | | TestCaseUtils.initializeTestBackend(false); |
| | | Backend b = DirectoryServer.getBackend(DN.valueOf("o=test")); |
| | | |
| | | assertNull(cache.getEntry(testEntriesList.get(0).getDN()), |
| | | "Not expected to find " + testEntriesList.get(0).getDN().toString() + |
| | | assertNull(cache.getEntry(testEntriesList.get(0).getName()), |
| | | "Not expected to find " + testEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | | cache.putEntry(testEntriesList.get(0), b, 1); |
| | | |
| | | assertNotNull(cache.getEntry(testEntriesList.get(0).getDN()), |
| | | "Expected to find " + testEntriesList.get(0).getDN().toString() + |
| | | assertNotNull(cache.getEntry(testEntriesList.get(0).getName()), |
| | | "Expected to find " + testEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | |
| | | TestCaseUtils.initializeTestBackend(false); |
| | | Backend b = DirectoryServer.getBackend(DN.valueOf("o=test")); |
| | | |
| | | assertNull(cache.getEntry(testEntriesList.get(0).getDN()), |
| | | "Not expected to find " + testEntriesList.get(0).getDN().toString() + |
| | | assertNull(cache.getEntry(testEntriesList.get(0).getName()), |
| | | "Not expected to find " + testEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | | cache.putEntry(testEntriesList.get(0), b, 1); |
| | | |
| | | assertNotNull(cache.getEntry(testEntriesList.get(0).getDN()), |
| | | "Expected to find " + testEntriesList.get(0).getDN().toString() + |
| | | assertNotNull(cache.getEntry(testEntriesList.get(0).getName()), |
| | | "Expected to find " + testEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | |
| | | TestCaseUtils.initializeTestBackend(false); |
| | | Backend b = DirectoryServer.getBackend(DN.valueOf("o=test")); |
| | | |
| | | assertEquals(cache.getEntryID(testEntriesList.get(0).getDN()), -1, |
| | | "Not expected to find " + testEntriesList.get(0).getDN().toString() + |
| | | assertEquals(cache.getEntryID(testEntriesList.get(0).getName()), -1, |
| | | "Not expected to find " + testEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | | cache.putEntry(testEntriesList.get(0), b, 1); |
| | | |
| | | assertEquals(cache.getEntryID(testEntriesList.get(0).getDN()), 1, |
| | | "Expected to find " + testEntriesList.get(0).getDN().toString() + |
| | | assertEquals(cache.getEntryID(testEntriesList.get(0).getName()), 1, |
| | | "Expected to find " + testEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | |
| | | |
| | | cache.putEntry(testEntriesList.get(0), b, 1); |
| | | |
| | | assertNotNull(cache.getEntry(testEntriesList.get(0).getDN()), |
| | | "Expected to find " + testEntriesList.get(0).getDN().toString() + |
| | | assertNotNull(cache.getEntry(testEntriesList.get(0).getName()), |
| | | "Expected to find " + testEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | |
| | | Backend b = DirectoryServer.getBackend(DN.valueOf("o=test")); |
| | | |
| | | assertTrue(cache.putEntryIfAbsent(testEntriesList.get(0), b, 1), |
| | | "Not expected to find " + testEntriesList.get(0).getDN().toString() + |
| | | "Not expected to find " + testEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | | assertFalse(cache.putEntryIfAbsent(testEntriesList.get(0), b, 1), |
| | | "Expected to find " + testEntriesList.get(0).getDN().toString() + |
| | | "Expected to find " + testEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | | assertNotNull(cache.getEntry(testEntriesList.get(0).getDN()), |
| | | "Expected to find " + testEntriesList.get(0).getDN().toString() + |
| | | assertNotNull(cache.getEntry(testEntriesList.get(0).getName()), |
| | | "Expected to find " + testEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | |
| | | TestCaseUtils.initializeTestBackend(false); |
| | | Backend b = DirectoryServer.getBackend(DN.valueOf("o=test")); |
| | | |
| | | cache.removeEntry(testEntriesList.get(0).getDN()); |
| | | cache.removeEntry(testEntriesList.get(0).getName()); |
| | | cache.putEntry(testEntriesList.get(0), b, 1); |
| | | cache.removeEntry(testEntriesList.get(0).getDN()); |
| | | cache.removeEntry(testEntriesList.get(0).getName()); |
| | | |
| | | assertNull(cache.getEntry(testEntriesList.get(0).getDN()), |
| | | "Not expected to find " + testEntriesList.get(0).getDN().toString() + |
| | | assertNull(cache.getEntry(testEntriesList.get(0).getName()), |
| | | "Not expected to find " + testEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | |
| | | cache.putEntry(testEntriesList.get(0), b, 1); |
| | | cache.clear(); |
| | | |
| | | assertNull(cache.getEntry(testEntriesList.get(0).getDN()), |
| | | "Not expected to find " + testEntriesList.get(0).getDN().toString() + |
| | | assertNull(cache.getEntry(testEntriesList.get(0).getName()), |
| | | "Not expected to find " + testEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | |
| | | b.getBackendID() + " in the cache. Cache contents:" + |
| | | ServerConstants.EOL + cache.toVerboseString()); |
| | | |
| | | assertNull(cache.getEntry(testEntriesList.get(0).getDN()), |
| | | "Not expected to find " + testEntriesList.get(0).getDN().toString() + |
| | | assertNull(cache.getEntry(testEntriesList.get(0).getName()), |
| | | "Not expected to find " + testEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | |
| | | |
| | | cache.putEntry(testEntriesList.get(0), b, 1); |
| | | Entry testEntry = testEntriesList.get(1); |
| | | testEntry.getDN(); |
| | | testEntry.getName(); |
| | | testEntry.setDN(DN.valueOf( |
| | | testEntry.getDN().rdn() + ",cn=config")); |
| | | testEntry.getName().rdn() + ",cn=config")); |
| | | cache.putEntry(testEntry, c, 1); |
| | | cache.clearSubtree(DN.valueOf("o=test")); |
| | | |
| | | assertNull(cache.getEntry(testEntriesList.get(0).getDN()), |
| | | "Not expected to find " + testEntriesList.get(0).getDN().toString() + |
| | | assertNull(cache.getEntry(testEntriesList.get(0).getName()), |
| | | "Not expected to find " + testEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | | assertNotNull(cache.getEntry(testEntry.getDN()), |
| | | "Expected to find " + testEntry.getDN().toString() + |
| | | assertNotNull(cache.getEntry(testEntry.getName()), |
| | | "Expected to find " + testEntry.getName().toString() + |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | |
| | | for(int loops = 0; loops < CONCURRENCYLOOPS; loops++) { |
| | | for(int i = 0; i < NUMTESTENTRIES; i++) { |
| | | cache.putEntry(testEntriesList.get(i), b, i); |
| | | cache.getEntry(testEntriesList.get(i).getDN()); |
| | | cache.removeEntry(testEntriesList.get(i).getDN()); |
| | | cache.getEntry(testEntriesList.get(i).getName()); |
| | | cache.removeEntry(testEntriesList.get(i).getName()); |
| | | cache.putEntryIfAbsent(testEntriesList.get(i), b, i); |
| | | cache.getEntry(b, i); |
| | | } |
| | |
| | | // Ensure all test entries are available via default cache. |
| | | for (int i = 0; i < NUMTESTENTRIES; i++) { |
| | | assertNotNull(super.cache.getEntry( |
| | | testSoftRefEntriesList.get(0).getDN()), |
| | | testSoftRefEntriesList.get(0).getName()), |
| | | "Expected to find " + |
| | | testSoftRefEntriesList.get(0).getDN().toString() + |
| | | testSoftRefEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + |
| | | ServerConstants.EOL + cache.toVerboseString()); |
| | | assertNotNull(super.cache.getEntry( |
| | | testFIFOEntriesList.get(0).getDN()), |
| | | testFIFOEntriesList.get(0).getName()), |
| | | "Expected to find " + |
| | | testFIFOEntriesList.get(0).getDN().toString() + |
| | | testFIFOEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + |
| | | ServerConstants.EOL + cache.toVerboseString()); |
| | | assertNotNull(super.cache.getEntry( |
| | | testFSEntriesList.get(0).getDN()), |
| | | testFSEntriesList.get(0).getName()), |
| | | "Expected to find " + |
| | | testFSEntriesList.get(0).getDN().toString() + |
| | | testFSEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + |
| | | ServerConstants.EOL + cache.toVerboseString()); |
| | | } |
| | |
| | | // Ensure all test entries landed on their levels. |
| | | for (int i = 0; i < NUMTESTENTRIES; i++) { |
| | | assertNotNull(softRefCache.getEntry( |
| | | testSoftRefEntriesList.get(0).getDN()), |
| | | testSoftRefEntriesList.get(0).getName()), |
| | | "Expected to find " + |
| | | testSoftRefEntriesList.get(0).getDN().toString() + |
| | | testSoftRefEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + |
| | | ServerConstants.EOL + cache.toVerboseString()); |
| | | assertNotNull(fifoCache.getEntry( |
| | | testFIFOEntriesList.get(0).getDN()), |
| | | testFIFOEntriesList.get(0).getName()), |
| | | "Expected to find " + |
| | | testFIFOEntriesList.get(0).getDN().toString() + |
| | | testFIFOEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + |
| | | ServerConstants.EOL + cache.toVerboseString()); |
| | | assertNotNull(fsCache.getEntry( |
| | | testFSEntriesList.get(0).getDN()), |
| | | testFSEntriesList.get(0).getName()), |
| | | "Expected to find " + |
| | | testFSEntriesList.get(0).getDN().toString() + |
| | | testFSEntriesList.get(0).getName().toString() + |
| | | " in the cache. Cache contents:" + |
| | | ServerConstants.EOL + cache.toVerboseString()); |
| | | } |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | assertEquals(LDAPSearch.mainSearch(args, false, null, System.err), 0); |
| | | |
| | | |
| | | DeleteOperation deleteOperation = conn.processDelete(e.getDN()); |
| | | DeleteOperation deleteOperation = conn.processDelete(e.getName()); |
| | | assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | | |
| | |
| | | AddOperation addOperation = conn.processAdd(e); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | e = DirectoryServer.getEntry(e.getDN()); |
| | | e = DirectoryServer.getEntry(e.getName()); |
| | | assertNotNull(e); |
| | | assertTrue(e.hasAttribute(entryUUIDType)); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | // successfully. |
| | | Entry mappedEntry = mapper.getEntryForID("test"); |
| | | assertNotNull(mappedEntry); |
| | | assertEquals(mappedEntry.getDN(), DN.valueOf("uid=test,o=test")); |
| | | assertEquals(mappedEntry.getName(), DN.valueOf("uid=test,o=test")); |
| | | |
| | | |
| | | mapper.finalizeIdentityMapper(); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | // successfully. |
| | | Entry mappedEntry = mapper.getEntryForID("test"); |
| | | assertNotNull(mappedEntry); |
| | | assertEquals(mappedEntry.getDN(), DN.valueOf("uid=test,o=test")); |
| | | assertEquals(mappedEntry.getName(), DN.valueOf("uid=test,o=test")); |
| | | |
| | | |
| | | mapper.finalizeIdentityMapper(); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | "cn: Test", |
| | | "userPassword: password"); |
| | | addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | // successfully. |
| | | Entry mappedEntry = mapper.getEntryForID("foo"); |
| | | assertNotNull(mappedEntry); |
| | | assertEquals(mappedEntry.getDN(), DN.valueOf("uid=foo,o=test")); |
| | | assertEquals(mappedEntry.getName(), DN.valueOf("uid=foo,o=test")); |
| | | |
| | | |
| | | mapper.finalizeIdentityMapper(); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | // successfully. |
| | | Entry mappedEntry = mapper.getEntryForID("bar"); |
| | | assertNotNull(mappedEntry); |
| | | assertEquals(mappedEntry.getDN(), DN.valueOf("uid=foo,o=test")); |
| | | assertEquals(mappedEntry.getName(), DN.valueOf("uid=foo,o=test")); |
| | | |
| | | |
| | | mapper.finalizeIdentityMapper(); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | // does not. |
| | | Entry mappedEntry = mapper.getEntryForID("test"); |
| | | assertNotNull(mappedEntry); |
| | | assertEquals(mappedEntry.getDN(), DN.valueOf("uid=test,o=test")); |
| | | assertEquals(mappedEntry.getName(), DN.valueOf("uid=test,o=test")); |
| | | |
| | | mappedEntry = mapper.getEntryForID("test user"); |
| | | assertNull(mappedEntry); |
| | |
| | | |
| | | mappedEntry = mapper.getEntryForID("test user"); |
| | | assertNotNull(mappedEntry); |
| | | assertEquals(mappedEntry.getDN(), DN.valueOf("uid=test,o=test")); |
| | | assertEquals(mappedEntry.getName(), DN.valueOf("uid=test,o=test")); |
| | | |
| | | |
| | | // Change the configuration back to the way it was. |
| | |
| | | // Verify that the original matching pattern is back. |
| | | mappedEntry = mapper.getEntryForID("test"); |
| | | assertNotNull(mappedEntry); |
| | | assertEquals(mappedEntry.getDN(), DN.valueOf("uid=test,o=test")); |
| | | assertEquals(mappedEntry.getName(), DN.valueOf("uid=test,o=test")); |
| | | |
| | | mappedEntry = mapper.getEntryForID("test user"); |
| | | assertNull(mappedEntry); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | // Verify that we can retrieve the user. |
| | | Entry mappedEntry = mapper.getEntryForID("test"); |
| | | assertNotNull(mappedEntry); |
| | | assertEquals(mappedEntry.getDN(), DN.valueOf("uid=test,o=test")); |
| | | assertEquals(mappedEntry.getName(), DN.valueOf("uid=test,o=test")); |
| | | |
| | | |
| | | // Create a modification to set the map base DN to "dc=example,dc=com". |
| | |
| | | // Verify that we can retrieve the user again. |
| | | mappedEntry = mapper.getEntryForID("test"); |
| | | assertNotNull(mappedEntry); |
| | | assertEquals(mappedEntry.getDN(), DN.valueOf("uid=test,o=test")); |
| | | assertEquals(mappedEntry.getName(), DN.valueOf("uid=test,o=test")); |
| | | |
| | | |
| | | // Change the configuration back to its original setting. |
| | |
| | | // Verify that we can still retrieve the user. |
| | | mappedEntry = mapper.getEntryForID("test"); |
| | | assertNotNull(mappedEntry); |
| | | assertEquals(mappedEntry.getDN(), DN.valueOf("uid=test,o=test")); |
| | | assertEquals(mappedEntry.getName(), DN.valueOf("uid=test,o=test")); |
| | | } |
| | | |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | // cache are no longer there after handleLowMemory. |
| | | for(int i = 0; i < super.NUMTESTENTRIES; i++ ) { |
| | | assertFalse(super.cache.containsEntry( |
| | | super.testEntriesList.get(i).getDN()), "Not expected to find " + |
| | | super.testEntriesList.get(i).getDN().toString() + " in the " + |
| | | super.testEntriesList.get(i).getName()), "Not expected to find " + |
| | | super.testEntriesList.get(i).getName().toString() + " in the " + |
| | | "cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | } |
| | |
| | | // Make sure first NUMTESTENTRIES - MAXENTRIES got rotated. |
| | | for(int i = 0; i < (super.NUMTESTENTRIES - super.MAXENTRIES); i++ ) { |
| | | assertFalse(super.cache.containsEntry( |
| | | super.testEntriesList.get(i).getDN()), "Not expected to find " + |
| | | super.testEntriesList.get(i).getDN().toString() + " in the " + |
| | | super.testEntriesList.get(i).getName()), "Not expected to find " + |
| | | super.testEntriesList.get(i).getName().toString() + " in the " + |
| | | "cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | } |
| | |
| | | i++) |
| | | { |
| | | assertTrue(super.cache.containsEntry( |
| | | super.testEntriesList.get(i).getDN()), "Expected to find " + |
| | | super.testEntriesList.get(i).getDN().toString() + " in the " + |
| | | super.testEntriesList.get(i).getName()), "Expected to find " + |
| | | super.testEntriesList.get(i).getName().toString() + " in the " + |
| | | "cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | } |
| | |
| | | // Make sure first NUMTESTENTRIES - MAXENTRIES got rotated. |
| | | for(int i = 0; i < (super.NUMTESTENTRIES - super.MAXENTRIES); i++ ) { |
| | | assertFalse(super.cache.containsEntry( |
| | | super.testEntriesList.get(i).getDN()), "Not expected to find " + |
| | | super.testEntriesList.get(i).getDN().toString() + " in the " + |
| | | super.testEntriesList.get(i).getName()), "Not expected to find " + |
| | | super.testEntriesList.get(i).getName().toString() + " in the " + |
| | | "cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | } |
| | |
| | | i++) |
| | | { |
| | | assertTrue(super.cache.containsEntry( |
| | | super.testEntriesList.get(i).getDN()), "Expected to find " + |
| | | super.testEntriesList.get(i).getDN().toString() + " in the " + |
| | | super.testEntriesList.get(i).getName()), "Expected to find " + |
| | | super.testEntriesList.get(i).getName().toString() + " in the " + |
| | | "cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | } |
| | |
| | | // Sacrifice one cache entry to support rotation. |
| | | for(int j = 0; j < (super.MAXENTRIES - 1); j++) { |
| | | // Generate access. |
| | | super.cache.getEntry(super.testEntriesList.get(j).getDN()); |
| | | super.cache.getEntry(super.testEntriesList.get(j).getName()); |
| | | } |
| | | } |
| | | |
| | | // Make sure MAXENTRIES - 1 are still in the cache. |
| | | for(int i = 0; i < (super.MAXENTRIES - 1); i++) { |
| | | assertTrue(super.cache.containsEntry( |
| | | super.testEntriesList.get(i).getDN()), |
| | | super.testEntriesList.get(i).getName()), |
| | | "Expected to find " + |
| | | super.testEntriesList.get(i).getDN().toString() + " in the " + |
| | | super.testEntriesList.get(i).getName().toString() + " in the " + |
| | | "cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | } |
| | | |
| | | // Plus the last cache entry added. |
| | | assertTrue(super.cache.containsEntry( |
| | | super.testEntriesList.get(super.NUMTESTENTRIES - 1).getDN()), |
| | | super.testEntriesList.get(super.NUMTESTENTRIES - 1).getName()), |
| | | "Expected to find " + |
| | | super.testEntriesList.get(super.NUMTESTENTRIES - 1).getDN().toString() + |
| | | super.testEntriesList.get(super.NUMTESTENTRIES - 1).getName().toString() + |
| | | " in the cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | |
| | |
| | | i < (super.NUMTESTENTRIES - 1); |
| | | i++) { |
| | | assertFalse(super.cache.containsEntry( |
| | | super.testEntriesList.get(i).getDN()), |
| | | super.testEntriesList.get(i).getName()), |
| | | "Not expected to find " + |
| | | super.testEntriesList.get(i).getDN().toString() + " in the " + |
| | | super.testEntriesList.get(i).getName().toString() + " in the " + |
| | | "cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | } |
| | |
| | | // Check that this cache is persistent indeed. |
| | | for(int i = 0; i < super.NUMTESTENTRIES; i++) { |
| | | assertTrue(super.cache.containsEntry( |
| | | super.testEntriesList.get(i).getDN()), |
| | | super.testEntriesList.get(i).getName()), |
| | | "Expected to find " + |
| | | super.testEntriesList.get(i).getDN().toString() + " in the " + |
| | | super.testEntriesList.get(i).getName().toString() + " in the " + |
| | | "cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | } |
| | |
| | | // Check that this cache is persistent indeed. |
| | | for(int i = 0; i < super.NUMTESTENTRIES; i++) { |
| | | assertFalse(super.cache.containsEntry( |
| | | super.testEntriesList.get(i).getDN()), |
| | | super.testEntriesList.get(i).getName()), |
| | | "Not expected to find " + |
| | | super.testEntriesList.get(i).getDN().toString() + " in the " + |
| | | super.testEntriesList.get(i).getName().toString() + " in the " + |
| | | "cache. Cache contents:" + ServerConstants.EOL + |
| | | cache.toVerboseString()); |
| | | } |
| | |
| | | boolean matchFound = false; |
| | | for (Entry e : searchOperation.getSearchEntries()) |
| | | { |
| | | if (e.getDN().equals(userEntry.getDN())) |
| | | if (e.getName().equals(userEntry.getName())) |
| | | { |
| | | if (matchFound) |
| | | { |
| | |
| | | * |
| | | * |
| | | * Copyright 2012 profiq, s.r.o. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | // Process the search request |
| | | |
| | | InternalSearchOperation search = |
| | | conn.processSearch(notExpired.getDN().toString(), |
| | | conn.processSearch(notExpired.getName().toString(), |
| | | SearchScope.BASE_OBJECT, |
| | | DereferencePolicy.DEREF_ALWAYS, |
| | | 0, |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | // Perform an internal bind to verify the password was actually changed. |
| | | conn = new InternalClientConnection(new AuthenticationInfo()); |
| | | BindOperation bindOperation = |
| | | conn.processSimpleBind(userEntry.getDN(), |
| | | conn.processSimpleBind(userEntry.getName(), |
| | | ByteString.valueOf("newPassword")); |
| | | assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | // Perform an internal bind to verify the password was actually changed. |
| | | conn = new InternalClientConnection(new AuthenticationInfo()); |
| | | BindOperation bindOperation = |
| | | conn.processSimpleBind(userEntry.getDN(), |
| | | conn.processSimpleBind(userEntry.getName(), |
| | | ByteString.valueOf("newPassword")); |
| | | assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | // Perform an internal bind to verify the password was actually changed. |
| | | conn = new InternalClientConnection(new AuthenticationInfo()); |
| | | BindOperation bindOperation = |
| | | conn.processSimpleBind(userEntry.getDN(), |
| | | conn.processSimpleBind(userEntry.getName(), |
| | | ByteString.valueOf("newPassword")); |
| | | assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | // Perform an internal bind to verify the password was actually changed. |
| | | conn = new InternalClientConnection(new AuthenticationInfo()); |
| | | BindOperation bindOperation = |
| | | conn.processSimpleBind(userEntry.getDN(), |
| | | conn.processSimpleBind(userEntry.getName(), |
| | | ByteString.valueOf("newPassword")); |
| | | assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | // Perform an internal bind to verify the password was actually changed. |
| | | conn = new InternalClientConnection(new AuthenticationInfo()); |
| | | BindOperation bindOperation = |
| | | conn.processSimpleBind(userEntry.getDN(), |
| | | conn.processSimpleBind(userEntry.getName(), |
| | | ByteString.valueOf("newPassword")); |
| | | assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | // Perform an internal bind to verify the password was actually changed. |
| | | conn = new InternalClientConnection(new AuthenticationInfo()); |
| | | BindOperation bindOperation = |
| | | conn.processSimpleBind(userEntry.getDN(), |
| | | conn.processSimpleBind(userEntry.getName(), |
| | | ByteString.valueOf("newPassword")); |
| | | assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | // Perform an internal bind to verify the password was actually changed. |
| | | conn = new InternalClientConnection(new AuthenticationInfo()); |
| | | BindOperation bindOperation = |
| | | conn.processSimpleBind(userEntry.getDN(), |
| | | conn.processSimpleBind(userEntry.getName(), |
| | | ByteString.valueOf("newPassword")); |
| | | assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | // Perform an internal bind to verify the password was actually changed. |
| | | conn = new InternalClientConnection(new AuthenticationInfo()); |
| | | BindOperation bindOperation = |
| | | conn.processSimpleBind(userEntry.getDN(), |
| | | conn.processSimpleBind(userEntry.getName(), |
| | | ByteString.valueOf("newPassword")); |
| | | assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | // Perform an internal bind to verify the password was actually changed. |
| | | conn = new InternalClientConnection(new AuthenticationInfo()); |
| | | BindOperation bindOperation = |
| | | conn.processSimpleBind(userEntry.getDN(), |
| | | conn.processSimpleBind(userEntry.getName(), |
| | | ByteString.valueOf("newPassword")); |
| | | assertEquals(bindOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | mods.add(new Modification(ModificationType.REPLACE, |
| | | Attributes.create("pwdchangedtime", |
| | | "20050101000000.000Z"))); |
| | | modifyOperation = conn.processModify(userEntry.getDN(), mods); |
| | | modifyOperation = conn.processModify(userEntry.getName(), mods); |
| | | assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | mods.add(new Modification(ModificationType.REPLACE, |
| | | Attributes.create("pwdchangedtime", |
| | | "20050101000000.000Z"))); |
| | | modifyOperation = conn.processModify(userEntry.getDN(), mods); |
| | | modifyOperation = conn.processModify(userEntry.getName(), mods); |
| | | assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(userEntry.getDN(), userEntry.getObjectClasses(), |
| | | conn.processAdd(userEntry.getName(), userEntry.getObjectClasses(), |
| | | userEntry.getUserAttributes(), |
| | | userEntry.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013 ForgeRock AS |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | ByteStringBuilder saslCredBytes = new ByteStringBuilder(); |
| | | saslCredBytes.append((byte)0); |
| | | saslCredBytes.append("dn:"); |
| | | saslCredBytes.append(e.getDN().toString()); |
| | | saslCredBytes.append(e.getName().toString()); |
| | | saslCredBytes.append((byte)0); |
| | | saslCredBytes.append(password); |
| | | InternalClientConnection anonymousConn = |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | ByteStringBuilder saslCredBytes = new ByteStringBuilder(); |
| | | saslCredBytes.append("dn:"); |
| | | saslCredBytes.append(e.getDN().toString()); |
| | | saslCredBytes.append(e.getName().toString()); |
| | | saslCredBytes.append((byte)0); |
| | | saslCredBytes.append("dn:"); |
| | | saslCredBytes.append(e.getDN().toString()); |
| | | saslCredBytes.append(e.getName().toString()); |
| | | saslCredBytes.append((byte)0); |
| | | saslCredBytes.append(password); |
| | | InternalClientConnection anonymousConn = |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | // Check that all test entries are preloaded. |
| | | for(int i = 0; i < NUMTESTENTRIES; i++ ) { |
| | | assertNotNull(DirectoryServer.getEntryCache().getEntry( |
| | | testEntriesList.get(i).getDN()), "Expected to find " + |
| | | testEntriesList.get(i).getDN().toString() + |
| | | testEntriesList.get(i).getName()), "Expected to find " + |
| | | testEntriesList.get(i).getName().toString() + |
| | | " in the cache. Cache contents:" + |
| | | ServerConstants.EOL + toVerboseString()); |
| | | } |
| | |
| | | // successfully. |
| | | Entry mappedEntry = mapper.getEntryForID("test@example.com"); |
| | | assertNotNull(mappedEntry); |
| | | assertEquals(mappedEntry.getDN(), DN.valueOf("uid=test,o=test")); |
| | | assertEquals(mappedEntry.getName(), DN.valueOf("uid=test,o=test")); |
| | | |
| | | mapper.finalizeIdentityMapper(); |
| | | } |
| | |
| | | // successfully. |
| | | Entry mappedEntry = mapper.getEntryForID("test@example.com"); |
| | | assertNotNull(mappedEntry); |
| | | assertEquals(mappedEntry.getDN(), DN.valueOf("uid=test,o=test")); |
| | | assertEquals(mappedEntry.getName(), DN.valueOf("uid=test,o=test")); |
| | | |
| | | mapper.finalizeIdentityMapper(); |
| | | } |
| | |
| | | // successfully. |
| | | Entry mappedEntry = mapper.getEntryForID("test@example.com"); |
| | | assertNotNull(mappedEntry); |
| | | assertEquals(mappedEntry.getDN(), DN.valueOf("uid=test,o=test")); |
| | | assertEquals(mappedEntry.getName(), DN.valueOf("uid=test,o=test")); |
| | | |
| | | mapper.finalizeIdentityMapper(); |
| | | } |
| | |
| | | // successfully. |
| | | Entry mappedEntry = mapper.getEntryForID("test@example.com"); |
| | | assertNotNull(mappedEntry); |
| | | assertEquals(mappedEntry.getDN(), DN.valueOf("uid=test,o=test")); |
| | | assertEquals(mappedEntry.getName(), DN.valueOf("uid=test,o=test")); |
| | | |
| | | mapper.finalizeIdentityMapper(); |
| | | } |
| | |
| | | // successfully. |
| | | Entry mappedEntry = mapper.getEntryForID("test"); |
| | | assertNotNull(mappedEntry); |
| | | assertEquals(mappedEntry.getDN(), DN.valueOf("uid=test,o=test")); |
| | | assertEquals(mappedEntry.getName(), DN.valueOf("uid=test,o=test")); |
| | | |
| | | mapper.finalizeIdentityMapper(); |
| | | } |
| | |
| | | // successfully. |
| | | Entry mappedEntry = mapper.getEntryForID("test@example.com"); |
| | | assertNotNull(mappedEntry); |
| | | assertEquals(mappedEntry.getDN(), DN.valueOf("uid=test,o=test")); |
| | | assertEquals(mappedEntry.getName(), DN.valueOf("uid=test,o=test")); |
| | | |
| | | mapper.finalizeIdentityMapper(); |
| | | } |
| | |
| | | // successfully. |
| | | Entry mappedEntry = mapper.getEntryForID("test"); |
| | | assertNotNull(mappedEntry); |
| | | assertEquals(mappedEntry.getDN(), DN.valueOf("uid=test@example.com,o=test")); |
| | | assertEquals(mappedEntry.getName(), DN.valueOf("uid=test@example.com,o=test")); |
| | | |
| | | mapper.finalizeIdentityMapper(); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | SearchFilter.createFilterFromString("(objectClass=*)")); |
| | | for (Entry e : searchOperation.getSearchEntries()) |
| | | { |
| | | conn.processDelete(e.getDN()); |
| | | conn.processDelete(e.getName()); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOp = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOp = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOp.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOp = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOp = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOp.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | SearchFilter filter = |
| | | SearchFilter.createFilterFromString("(objectClass=*)"); |
| | | searchOperation = |
| | | conn.processSearch(sre.getDN(), SearchScope.BASE_OBJECT, filter); |
| | | conn.processSearch(sre.getName(), SearchScope.BASE_OBJECT, filter); |
| | | assertEquals(searchOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | | } |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | e = DirectoryConfig.getEntry(e.getDN()); |
| | | e = DirectoryConfig.getEntry(e.getName()); |
| | | assertNotNull(e); |
| | | assertNotNull(e.getAttribute("entryuuid")); |
| | | } |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | e = DirectoryConfig.getEntry(e.getDN()); |
| | | e = DirectoryConfig.getEntry(e.getName()); |
| | | assertNotNull(e); |
| | | assertNotNull(e.getAttribute("entryuuid")); |
| | | } |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | e = DirectoryConfig.getEntry(e.getDN()); |
| | | e = DirectoryConfig.getEntry(e.getName()); |
| | | assertNotNull(e); |
| | | assertNotNull(e.getAttribute("creatorsname")); |
| | | assertNotNull(e.getAttribute("createtimestamp")); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | |
| | | ModifyDNOperation modifyDNOperation = |
| | | conn.processModifyDN(e.getDN(), RDN.decode("cn=test2"), false); |
| | | conn.processModifyDN(e.getName(), RDN.decode("cn=test2"), false); |
| | | assertEquals(modifyDNOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | e = DirectoryConfig.getEntry(DN.valueOf("cn=test2,o=test")); |
| | |
| | | mods.add(new Modification(ModificationType.REPLACE, Attributes.create( |
| | | "userPassword", "password"))); |
| | | |
| | | ModifyOperation modOp = conn.processModify(testEntry.getDN(), mods); |
| | | ModifyOperation modOp = conn.processModify(testEntry.getName(), mods); |
| | | |
| | | assertEquals(modOp.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | private void assertThatPasswordsAreEqualTo(Entry testEntry, |
| | | String ntPassword, String lmPassword) throws DirectoryException |
| | | { |
| | | Entry entry = DirectoryServer.getEntry(testEntry.getDN()); |
| | | Entry entry = DirectoryServer.getEntry(testEntry.getName()); |
| | | assertNotNull(entry); |
| | | |
| | | List<Attribute> sambaAttribute = entry.getAttribute("sambantpassword"); |
| | |
| | | mods.add(new Modification(ModificationType.REPLACE, Attributes.create( |
| | | "userPassword", "password"))); |
| | | |
| | | ModifyOperation modOp = conn.processModify(testEntry.getDN(), mods); |
| | | ModifyOperation modOp = conn.processModify(testEntry.getName(), mods); |
| | | |
| | | assertEquals(modOp.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | mods.add(new Modification(ModificationType.REPLACE, Attributes.create( |
| | | "userPassword", "password1"))); |
| | | |
| | | ModifyOperation modOp = conn.processModify(testEntry.getDN(), mods); |
| | | ModifyOperation modOp = conn.processModify(testEntry.getName(), mods); |
| | | |
| | | assertEquals(modOp.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | // Verification of the result |
| | | |
| | | Entry entry = DirectoryServer.getEntry(testEntry.getDN()); |
| | | Entry entry = DirectoryServer.getEntry(testEntry.getName()); |
| | | assertNotNull(entry); |
| | | |
| | | List<Attribute> sambaAttribute = entry.getAttribute("sambantpassword"); |
| | |
| | | mods.add(new Modification(ModificationType.ADD, Attributes.create( |
| | | "userPassword", "password3"))); |
| | | |
| | | ModifyOperation modOp = conn.processModify(testEntry.getDN(), mods); |
| | | ModifyOperation modOp = conn.processModify(testEntry.getName(), mods); |
| | | |
| | | assertEquals(modOp.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | |
| | | // Verification of the result |
| | | |
| | | Entry entry = DirectoryServer.getEntry(testEntry.getDN()); |
| | | Entry entry = DirectoryServer.getEntry(testEntry.getName()); |
| | | assertNotNull(entry); |
| | | |
| | | List<Attribute> sambaAttribute = entry.getAttribute("sambantpassword"); |
| | |
| | | mods.add(new Modification(ModificationType.REPLACE, Attributes.create( |
| | | "userPassword", "password"))); |
| | | |
| | | ModifyOperation modOp = conn.processModify(testEntry.getDN(), mods); |
| | | ModifyOperation modOp = conn.processModify(testEntry.getName(), mods); |
| | | |
| | | assertEquals(modOp.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | |
| | | // Verification of the result |
| | | |
| | | Entry entry = DirectoryServer.getEntry(testEntry.getDN()); |
| | | Entry entry = DirectoryServer.getEntry(testEntry.getName()); |
| | | assertNotNull(entry); |
| | | |
| | | Attribute sambaPwdLastSetAttr = |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | AddOperation addOperation = conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | |
| | | AddOperationBasis addOp = new AddOperationBasis(connection, |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), null, |
| | | newJmxConnectionJmx.getDN(), newJmxConnectionJmx |
| | | newJmxConnectionJmx.getName(), newJmxConnectionJmx |
| | | .getObjectClasses(), newJmxConnectionJmx |
| | | .getUserAttributes(), newJmxConnectionJmx |
| | | .getOperationalAttributes()); |
| | |
| | | assertNotNull(jmxc); |
| | | |
| | | // Disable the "new" connector |
| | | toggleEnableJmxConnector(connector, newJmxConnectionJmx.getDN(), false); |
| | | toggleEnableJmxConnector(connector, newJmxConnectionJmx.getName(), false); |
| | | Thread.sleep(100); |
| | | OpendsJmxConnector jmxcDisabled = connect("cn=Privileged User,o=test", |
| | | "password", serverJmxPort); |
| | | assertNull(jmxcDisabled); |
| | | |
| | | toggleEnableJmxConnector(connector, newJmxConnectionJmx.getDN(), true); |
| | | toggleEnableJmxConnector(connector, newJmxConnectionJmx.getName(), true); |
| | | Thread.sleep(100); |
| | | jmxcDisabled = connect("cn=Privileged User,o=test", "password", serverJmxPort); |
| | | assertNotNull(jmxcDisabled); |
| | |
| | | DeleteOperationBasis delOp = new DeleteOperationBasis(connection, |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), null, |
| | | newJmxConnectionJmx.getDN()); |
| | | newJmxConnectionJmx.getName()); |
| | | delOp.run(); |
| | | } |
| | | |
| | |
| | | "userPassword: password"); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | if (hasPrivilege) |
| | | { |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | DeleteOperation deleteOperation = conn.processDelete(entry.getDN()); |
| | | DeleteOperation deleteOperation = conn.processDelete(entry.getName()); |
| | | assertEquals(deleteOperation.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | | else |
| | |
| | | } |
| | | else |
| | | { |
| | | identifier = authNEntry.getDN().toString(); |
| | | identifier = authNEntry.getName().toString(); |
| | | identifier = identifier.replace(',', '-'); |
| | | identifier = identifier.replace(' ', '-'); |
| | | identifier = identifier.replace('=', '-'); |
| | |
| | | "ds-task-schema-file-name: 05-" + identifier + ".ldif"); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(taskEntry.getDN(), taskEntry.getObjectClasses(), |
| | | conn.processAdd(taskEntry.getName(), taskEntry.getObjectClasses(), |
| | | taskEntry.getUserAttributes(), |
| | | taskEntry.getOperationalAttributes()); |
| | | |
| | |
| | | { |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | Task task = getCompletedTask(taskEntry.getDN()); |
| | | Task task = getCompletedTask(taskEntry.getName()); |
| | | assertNotNull(task); |
| | | assertTrue(TaskState.isSuccessful(task.getTaskState())); |
| | | } |
| | |
| | | "ds-task-backup-all: TRUE"); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(taskEntry.getDN(), taskEntry.getObjectClasses(), |
| | | conn.processAdd(taskEntry.getName(), taskEntry.getObjectClasses(), |
| | | taskEntry.getUserAttributes(), |
| | | taskEntry.getOperationalAttributes()); |
| | | |
| | |
| | | { |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | Task task = getCompletedTask(taskEntry.getDN()); |
| | | Task task = getCompletedTask(taskEntry.getName()); |
| | | assertNotNull(task); |
| | | assertTrue(TaskState.isSuccessful(task.getTaskState())); |
| | | } |
| | |
| | | "ds-backup-directory-path: bak" + File.separator + "userRoot"); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(taskEntry.getDN(), taskEntry.getObjectClasses(), |
| | | conn.processAdd(taskEntry.getName(), taskEntry.getObjectClasses(), |
| | | taskEntry.getUserAttributes(), |
| | | taskEntry.getOperationalAttributes()); |
| | | |
| | |
| | | { |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | Task task = getCompletedTask(taskEntry.getDN()); |
| | | Task task = getCompletedTask(taskEntry.getName()); |
| | | assertNotNull(task); |
| | | assertTrue(TaskState.isSuccessful(task.getTaskState())); |
| | | } |
| | |
| | | "ds-task-export-ldif-file: " + tempFilePath); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(taskEntry.getDN(), taskEntry.getObjectClasses(), |
| | | conn.processAdd(taskEntry.getName(), taskEntry.getObjectClasses(), |
| | | taskEntry.getUserAttributes(), |
| | | taskEntry.getOperationalAttributes()); |
| | | |
| | |
| | | { |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | Task task = getCompletedTask(taskEntry.getDN()); |
| | | Task task = getCompletedTask(taskEntry.getName()); |
| | | assertNotNull(task); |
| | | assertTrue(TaskState.isSuccessful(task.getTaskState())); |
| | | |
| | |
| | | "ds-task-import-ldif-file: " + path); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(taskEntry.getDN(), taskEntry.getObjectClasses(), |
| | | conn.processAdd(taskEntry.getName(), taskEntry.getObjectClasses(), |
| | | taskEntry.getUserAttributes(), |
| | | taskEntry.getOperationalAttributes()); |
| | | |
| | |
| | | { |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | Task task = getCompletedTask(taskEntry.getDN()); |
| | | Task task = getCompletedTask(taskEntry.getName()); |
| | | assertNotNull(task); |
| | | assertTrue(TaskState.isSuccessful(task.getTaskState())); |
| | | } |
| | |
| | | "ds-task-rebuild-index: cn"); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(taskEntry.getDN(), taskEntry.getObjectClasses(), |
| | | conn.processAdd(taskEntry.getName(), taskEntry.getObjectClasses(), |
| | | taskEntry.getUserAttributes(), |
| | | taskEntry.getOperationalAttributes()); |
| | | |
| | |
| | | { |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | Task task = getCompletedTask(taskEntry.getDN()); |
| | | Task task = getCompletedTask(taskEntry.getName()); |
| | | assertNotNull(task); |
| | | assertTrue(TaskState.isSuccessful(task.getTaskState())); |
| | | } |
| | |
| | | // with a root connection so we can do other things with it. |
| | | AddOperationBasis addOperation = |
| | | new AddOperationBasis(conn, conn |
| | | .nextOperationID(), conn.nextMessageID(), controls, e.getDN(), e |
| | | .nextOperationID(), conn.nextMessageID(), controls, e.getName(), e |
| | | .getObjectClasses(), e.getUserAttributes(), e |
| | | .getOperationalAttributes()); |
| | | addOperation.run(); |
| | |
| | | Attributes.create("description", "foo"))); |
| | | |
| | | ModifyOperationBasis modifyOperation = new ModifyOperationBasis(conn, |
| | | conn.nextOperationID(), conn.nextMessageID(), controls, e.getDN(), |
| | | conn.nextOperationID(), conn.nextMessageID(), controls, e.getName(), |
| | | mods); |
| | | modifyOperation.run(); |
| | | |
| | |
| | | // Try to rename the entry. |
| | | ModifyDNOperationBasis modifyDNOperation = |
| | | new ModifyDNOperationBasis(conn, conn.nextOperationID(), |
| | | conn.nextMessageID(), controls, e.getDN(), |
| | | conn.nextMessageID(), controls, e.getName(), |
| | | RDN.decode("cn=Proxy V1 Test"), true, null); |
| | | modifyDNOperation.run(); |
| | | |
| | |
| | | { |
| | | assertEquals(modifyDNOperation.getResultCode(), |
| | | ResultCode.AUTHORIZATION_DENIED); |
| | | newEntryDN = e.getDN(); |
| | | newEntryDN = e.getName(); |
| | | } |
| | | |
| | | |
| | |
| | | DN authDN = conn.getAuthenticationInfo().getAuthenticationDN(); |
| | | AddOperationBasis addOperation = |
| | | new AddOperationBasis(conn, conn |
| | | .nextOperationID(), conn.nextMessageID(), controls, e.getDN(), e |
| | | .nextOperationID(), conn.nextMessageID(), controls, e.getName(), e |
| | | .getObjectClasses(), e.getUserAttributes(), e |
| | | .getOperationalAttributes()); |
| | | addOperation.run(); |
| | |
| | | |
| | | ModifyOperationBasis modifyOperation = |
| | | new ModifyOperationBasis(conn, |
| | | conn.nextOperationID(), conn.nextMessageID(), controls, e.getDN(), |
| | | conn.nextOperationID(), conn.nextMessageID(), controls, e.getName(), |
| | | mods); |
| | | modifyOperation.run(); |
| | | |
| | |
| | | // Try to rename the entry. |
| | | ModifyDNOperationBasis modifyDNOperation = |
| | | new ModifyDNOperationBasis(conn, conn.nextOperationID(), |
| | | conn.nextMessageID(), controls, e.getDN(), |
| | | conn.nextMessageID(), controls, e.getName(), |
| | | RDN.decode("cn=Proxy V2 Test"), true, null); |
| | | modifyDNOperation.run(); |
| | | |
| | |
| | | assertEquals(modifyDNOperation.getResultCode(), |
| | | ResultCode.AUTHORIZATION_DENIED, |
| | | "Unexpected moddn success for user " + authDN); |
| | | newEntryDN = e.getDN(); |
| | | newEntryDN = e.getName(); |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | |
| | | |
| | |
| | | ASN1Writer writer = ASN1.getWriter(builder); |
| | | writer.writeStartSequence(OP_TYPE_SEARCH_RESULT_ENTRY); |
| | | writer.writeBoolean(true); |
| | | writer.writeOctetString(entry.getDN().toString()); |
| | | writer.writeOctetString(entry.getName().toString()); |
| | | |
| | | writer.writeStartSequence(); |
| | | for(Attribute attr : entry.getAttributes()) |
| | |
| | | ByteStringBuilder builder = new ByteStringBuilder(); |
| | | ASN1Writer writer = ASN1.getWriter(builder); |
| | | writer.writeStartSequence(OP_TYPE_SEARCH_RESULT_ENTRY); |
| | | writer.writeOctetString(entry.getDN().toString()); |
| | | writer.writeOctetString(entry.getName().toString()); |
| | | writer.writeOctetString("cn"); |
| | | writer.writeEndSequence(); |
| | | |
| | |
| | | DN.valueOf("cn=external changelog," + synchroServerStringDN)); |
| | | if (ecle!=null) |
| | | { |
| | | DirectoryServer.getConfigHandler().deleteEntry(ecle.getDN(), null); |
| | | DirectoryServer.getConfigHandler().deleteEntry(ecle.getName(), null); |
| | | } |
| | | DirectoryServer.getConfigHandler().deleteEntry(synchroServerDN, null); |
| | | assertNull(DirectoryServer.getConfigEntry(synchroServerEntry.getDN()), |
| | | assertNull(DirectoryServer.getConfigEntry(synchroServerEntry.getName()), |
| | | "Unable to delete the synchronized domain"); |
| | | synchroServerEntry = null; |
| | | |
| | |
| | | |
| | | // Create and publish an update message to add an entry. |
| | | return new AddMsg(gen.newCSN(), |
| | | personWithUUIDEntry.getDN(), |
| | | personWithUUIDEntry.getName(), |
| | | user1entryUUID, |
| | | null, |
| | | personWithUUIDEntry.getObjectClassAttribute(), |
| | |
| | | do |
| | | { |
| | | InternalSearchOperation searchOperation = connection.processSearch( |
| | | taskEntry.getDN(), SearchScope.BASE_OBJECT, filter); |
| | | taskEntry.getName(), SearchScope.BASE_OBJECT, filter); |
| | | Entry resultEntry = searchOperation.getSearchEntries().getFirst(); |
| | | |
| | | String completionTime = resultEntry.getAttributeValue( |
| | |
| | | log("addEntry: Failed" + addOp.getResultCode()); |
| | | } |
| | | |
| | | entriesToCleanup.add(entry.getDN()); |
| | | entriesToCleanup.add(entry.getName()); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | // Configure replication domain |
| | | DirectoryServer.getConfigHandler().addEntry(repDomainEntry, null); |
| | | assertNotNull(DirectoryServer.getConfigEntry(repDomainEntry.getDN()), |
| | | assertNotNull(DirectoryServer.getConfigEntry(repDomainEntry.getName()), |
| | | "Unable to add the synchronized server"); |
| | | configEntriesToCleanup.add(repDomainEntry.getDN()); |
| | | configEntriesToCleanup.add(repDomainEntry.getName()); |
| | | |
| | | ReplicationBroker broker = openReplicationSession(baseDN, 12, |
| | | WINDOW_SIZE, replServerPort, 1000); |
| | |
| | | Entry tmp = personEntry.duplicate(false); |
| | | AddOperation addOp = connection.processAdd(tmp); |
| | | assertEquals(addOp.getResultCode(), ResultCode.SUCCESS); |
| | | assertTrue(DirectoryServer.entryExists(personEntry.getDN()), |
| | | assertTrue(DirectoryServer.entryExists(personEntry.getName()), |
| | | "The Add Entry operation failed"); |
| | | |
| | | // Check if the client has received the MSG |
| | |
| | | assertTrue(OperationType.ADD.compareTo(receivedOp.getOperationType()) == 0, |
| | | "The received Replication message is not an ADD msg"); |
| | | |
| | | assertEquals(addMsg.getDN(), personEntry.getDN(), |
| | | assertEquals(addMsg.getDN(), personEntry.getName(), |
| | | "The received ADD Replication message is not for the excepted DN"); |
| | | |
| | | // send (2 * window + replicationServer queue) modify operations |
| | |
| | | finally { |
| | | broker.stop(); |
| | | // Clean domain |
| | | DN dn = repDomainEntry.getDN(); |
| | | DN dn = repDomainEntry.getName(); |
| | | try |
| | | { |
| | | DeleteOperation op = connection.processDelete(dn); |
| | |
| | | List<Modification> mods = generatemods("telephonenumber", "01 02 45"); |
| | | |
| | | ModifyOperation modOp = |
| | | connection.processModify(personEntry.getDN(), mods); |
| | | connection.processModify(personEntry.getName(), mods); |
| | | assertEquals(modOp.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | | } |
| | |
| | | { |
| | | Entry entry = TestCaseUtils.entryFromLdifString(entryString); |
| | | AddOperation addOp = connection.processAdd(entry); |
| | | entriesToCleanup.add(entry.getDN()); |
| | | entriesToCleanup.add(entry.getName()); |
| | | return addOp.getResultCode(); |
| | | } |
| | | |
| | |
| | | if (configEntry != null) |
| | | { |
| | | DirectoryServer.getConfigHandler().addEntry(configEntry, null); |
| | | assertNotNull(DirectoryServer.getConfigEntry(configEntry.getDN()), errorMessage); |
| | | configEntriesToCleanup.add(configEntry.getDN()); |
| | | assertNotNull(DirectoryServer.getConfigEntry(configEntry.getName()), errorMessage); |
| | | configEntriesToCleanup.add(configEntry.getName()); |
| | | } |
| | | } |
| | | |
| | |
| | | do |
| | | { |
| | | InternalSearchOperation searchOperation = |
| | | connection.processSearch(taskEntry.getDN(), |
| | | connection.processSearch(taskEntry.getName(), |
| | | SearchScope.BASE_OBJECT, |
| | | filter); |
| | | if (searchOperation.getSearchEntries().isEmpty()) |
| | |
| | | } |
| | | |
| | | // Entry will be removed at the end of the test |
| | | entriesToCleanup.add(taskEntry.getDN()); |
| | | entriesToCleanup.add(taskEntry.getName()); |
| | | |
| | | TRACER.debugInfo("AddedTask/" + taskEntry.getDN()); |
| | | TRACER.debugInfo("AddedTask/" + taskEntry.getName()); |
| | | } |
| | | |
| | | protected void waitTaskState(Entry taskEntry, TaskState expectedTaskState, |
| | |
| | | do |
| | | { |
| | | InternalSearchOperation searchOperation = |
| | | connection.processSearch(taskEntry.getDN(), SearchScope.BASE_OBJECT, filter); |
| | | connection.processSearch(taskEntry.getName(), SearchScope.BASE_OBJECT, filter); |
| | | resultEntry = searchOperation.getSearchEntries().getFirst(); |
| | | |
| | | // Check that the task state is as expected. |
| | |
| | | AddOperation addOp = connection.processAdd(entry); |
| | | if (addOp.getResultCode() != ResultCode.SUCCESS) |
| | | { |
| | | TRACER.debugInfo("Failed to add entry " + entry.getDN() |
| | | TRACER.debugInfo("Failed to add entry " + entry.getName() |
| | | + "Result code = : " + addOp.getResultCode()); |
| | | } |
| | | else |
| | | { |
| | | TRACER.debugInfo(entry.getDN() + " added " + addOp.getResultCode()); |
| | | TRACER.debugInfo(entry.getName() + " added " + addOp.getResultCode()); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | if (entry != null) |
| | | { |
| | | deleteEntry(entry.getDN()); |
| | | deleteEntry(entry.getName()); |
| | | } |
| | | } |
| | | } |
| | |
| | | // Create an Entry (add operation) that will be later used in the test. |
| | | Entry tmp = personEntry.duplicate(false); |
| | | AddOperation addOp = connection.processAdd(tmp); |
| | | assertTrue(DirectoryServer.entryExists(personEntry.getDN()), |
| | | assertTrue(DirectoryServer.entryExists(personEntry.getName()), |
| | | "The Add Entry operation failed"); |
| | | if (ResultCode.SUCCESS == addOp.getResultCode()) |
| | | { |
| | |
| | | Operation receivedOp = addMsg.createOperation(connection); |
| | | assertEquals(receivedOp.getOperationType(), OperationType.ADD, |
| | | "The received replication message is not an ADD msg"); |
| | | assertEquals(addMsg.getDN(), personEntry.getDN(), |
| | | assertEquals(addMsg.getDN(), personEntry.getName(), |
| | | "The received ADD replication message is not for the excepted DN"); |
| | | } |
| | | |
| | |
| | | List<Modification> mods = generatemods("telephonenumber", "01 02 45"); |
| | | |
| | | ModifyOperation modOp = |
| | | connection.processModify(personEntry.getDN(), mods); |
| | | connection.processModify(personEntry.getName(), mods); |
| | | assertEquals(modOp.getResultCode(), ResultCode.SUCCESS); |
| | | } |
| | | } |
| | |
| | | { |
| | | AddOperation addOp = connection.processAdd(entry); |
| | | assertEquals(addOp.getResultCode(), ResultCode.SUCCESS); |
| | | assertNotNull(getEntry(entry.getDN(), 1000, true)); |
| | | assertNotNull(getEntry(entry.getName(), 1000, true)); |
| | | return OperationContext.getCSN(addOp); |
| | | } |
| | | |
| | |
| | | CSNGenerator gen = new CSNGenerator(serverId, 0); |
| | | |
| | | // Disable the directory server receive status. |
| | | setReceiveStatus(synchroServerEntry.getDN(), false); |
| | | setReceiveStatus(synchroServerEntry.getName(), false); |
| | | |
| | | // Create and publish an update message to add an entry. |
| | | broker.publish(addMsg(gen, personWithUUIDEntry, user1entryUUID, baseUUID)); |
| | | |
| | | assertNull(getEntry(personWithUUIDEntry.getDN(), 1000, true), |
| | | assertNull(getEntry(personWithUUIDEntry.getName(), 1000, true), |
| | | "The replication message was replayed while it should not have been: " |
| | | + "the server receive status was disabled"); |
| | | |
| | | // Enable the directory server receive status. |
| | | setReceiveStatus(synchroServerEntry.getDN(), true); |
| | | setReceiveStatus(synchroServerEntry.getName(), true); |
| | | |
| | | broker.publish(addMsg(gen, personWithUUIDEntry, user1entryUUID, baseUUID)); |
| | | |
| | | assertNotNull(getEntry(personWithUUIDEntry.getDN(), 10000, true), |
| | | assertNotNull(getEntry(personWithUUIDEntry.getName(), 10000, true), |
| | | "The replication message was not replayed while it should have been: " |
| | | + "the server receive status was reenabled"); |
| | | |
| | | // Delete the entries to clean the database. |
| | | broker.publish( |
| | | new DeleteMsg(personWithUUIDEntry.getDN(), gen.newCSN(), user1entryUUID)); |
| | | new DeleteMsg(personWithUUIDEntry.getName(), gen.newCSN(), user1entryUUID)); |
| | | |
| | | assertNull(getEntry(personWithUUIDEntry.getDN(), 10000, false), |
| | | assertNull(getEntry(personWithUUIDEntry.getName(), 10000, false), |
| | | "The DELETE replication message was not replayed"); |
| | | } |
| | | finally |
| | |
| | | |
| | | private AddMsg addMsg(CSNGenerator gen, Entry entry, String uniqueId, String parentId) |
| | | { |
| | | return new AddMsg(gen.newCSN(), entry.getDN(), uniqueId, parentId, |
| | | return new AddMsg(gen.newCSN(), entry.getName(), uniqueId, parentId, |
| | | entry.getObjectClassAttribute(), entry.getAttributes(), |
| | | new ArrayList<Attribute>()); |
| | | } |
| | |
| | | // Create and publish an update message to add an entry. |
| | | broker.publish(addMsg(gen, personWithUUIDEntry, user1entryUUID, baseUUID)); |
| | | |
| | | assertNotNull(getEntry(personWithUUIDEntry.getDN(), 30000, true), |
| | | assertNotNull(getEntry(personWithUUIDEntry.getName(), 30000, true), |
| | | "The ADD replication message was not replayed"); |
| | | |
| | | // Send a first modify operation message. |
| | | List<Modification> mods = generatemods("telephonenumber", "01 02 45"); |
| | | ModifyMsg modMsg = new ModifyMsg(gen.newCSN(), |
| | | personWithUUIDEntry.getDN(), mods, user1entryUUID); |
| | | personWithUUIDEntry.getName(), mods, user1entryUUID); |
| | | broker.publish(modMsg); |
| | | |
| | | // Check that the modify has been replayed. |
| | | boolean found = checkEntryHasAttribute(personWithUUIDEntry.getDN(), |
| | | boolean found = checkEntryHasAttribute(personWithUUIDEntry.getName(), |
| | | "telephonenumber", "01 02 45", 10000, true); |
| | | assertTrue(found, "The first modification was not replayed."); |
| | | |
| | |
| | | // Send a second modify operation message. |
| | | mods = generatemods("description", "Description was changed"); |
| | | modMsg = new ModifyMsg(gen.newCSN(), |
| | | personWithUUIDEntry.getDN(), mods, user1entryUUID); |
| | | personWithUUIDEntry.getName(), mods, user1entryUUID); |
| | | broker.publish(modMsg); |
| | | |
| | | // Check that the modify has been replayed. |
| | | found = checkEntryHasAttribute(personWithUUIDEntry.getDN(), |
| | | found = checkEntryHasAttribute(personWithUUIDEntry.getName(), |
| | | "description", "Description was changed", 10000, true); |
| | | assertTrue(found, "The second modification was not replayed."); |
| | | |
| | | // Delete the entries to clean the database. |
| | | broker.publish( |
| | | new DeleteMsg(personWithUUIDEntry.getDN(), gen.newCSN(), user1entryUUID)); |
| | | assertNull(getEntry(personWithUUIDEntry.getDN(), 10000, false), |
| | | new DeleteMsg(personWithUUIDEntry.getName(), gen.newCSN(), user1entryUUID)); |
| | | assertNull(getEntry(personWithUUIDEntry.getName(), 10000, false), |
| | | "The DELETE replication message was not replayed"); |
| | | } |
| | | finally |
| | |
| | | broker.publish(addMsg(gen, personWithUUIDEntry, user1entryUUID, baseUUID)); |
| | | |
| | | // Check that the entry has been created in the local DS. |
| | | assertNotNull(getEntry(personWithUUIDEntry.getDN(), 10000, true), |
| | | assertNotNull(getEntry(personWithUUIDEntry.getName(), 10000, true), |
| | | "The send ADD replication message was not applied"); |
| | | |
| | | // send a modify operation with the correct unique ID but another DN |
| | |
| | | broker.publish(modMsg); |
| | | |
| | | // check that the modify has been applied as if the entry had been renamed. |
| | | boolean found = checkEntryHasAttribute(personWithUUIDEntry.getDN(), |
| | | boolean found = checkEntryHasAttribute(personWithUUIDEntry.getName(), |
| | | "telephonenumber", "01 02 45", 10000, true); |
| | | assertTrue(found, "The modification has not been correctly replayed."); |
| | | assertEquals(getMonitorDelta(), 1); |
| | |
| | | // with a new value |
| | | mods = generatemods("uid", "AnotherUid"); |
| | | modMsg = new ModifyMsg(gen.newCSN(), |
| | | personWithUUIDEntry.getDN(), mods, user1entryUUID); |
| | | personWithUUIDEntry.getName(), mods, user1entryUUID); |
| | | |
| | | updateMonitorCount(baseDN, resolvedMonitorAttr); |
| | | alertCount = DummyAlertHandler.getAlertCount(); |
| | | broker.publish(modMsg); |
| | | |
| | | // check that the modify has been applied. |
| | | found = checkEntryHasAttribute(personWithUUIDEntry.getDN(), |
| | | found = checkEntryHasAttribute(personWithUUIDEntry.getName(), |
| | | "uid", "AnotherUid", 10000, true); |
| | | assertTrue(found, "The modification has not been correctly replayed."); |
| | | assertEquals(getMonitorDelta(), 1); |
| | |
| | | broker.publish(addMsg(gen, personWithUUIDEntry, user1entryUUID, baseUUID)); |
| | | |
| | | // Check that the entry has been created in the local DS. |
| | | assertNotNull(getEntry(personWithUUIDEntry.getDN(), 10000, true), |
| | | assertNotNull(getEntry(personWithUUIDEntry.getName(), 10000, true), |
| | | "The ADD replication message was not applied"); |
| | | |
| | | // send a modify operation with a wrong unique ID but the same DN |
| | |
| | | |
| | | // check that the modify has not been applied |
| | | Thread.sleep(2000); |
| | | found = checkEntryHasAttribute(personWithUUIDEntry.getDN(), |
| | | found = checkEntryHasAttribute(personWithUUIDEntry.getName(), |
| | | "telephonenumber", "02 01 03 05", 10000, false); |
| | | assertFalse(found, |
| | | "The modification has been replayed while it should not."); |
| | |
| | | broker.publish(new DeleteMsg(delDN, gen.newCSN(), user1entryUUID)); |
| | | |
| | | // check that the delete operation has been applied |
| | | assertNull(getEntry(personWithUUIDEntry.getDN(), 10000, false), |
| | | assertNull(getEntry(personWithUUIDEntry.getName(), 10000, false), |
| | | "The DELETE replication message was not replayed"); |
| | | assertEquals(getMonitorDelta(), 1); |
| | | assertConflictAutomaticallyResolved(alertCount); |
| | |
| | | broker.publish(addMsg(gen, personWithUUIDEntry, user1entryUUID, baseUUID)); |
| | | |
| | | // Check that the entry has been created in the local DS. |
| | | assertNotNull(getEntry(personWithUUIDEntry.getDN(), 10000, true), |
| | | assertNotNull(getEntry(personWithUUIDEntry.getName(), 10000, true), |
| | | "The ADD replication message was not applied"); |
| | | |
| | | // create an entry with the same DN and another unique ID |
| | |
| | | |
| | | // delete the entries to clean the database. |
| | | broker.publish( |
| | | new DeleteMsg(personWithUUIDEntry.getDN(), gen.newCSN(), user1entryUUID)); |
| | | new DeleteMsg(personWithUUIDEntry.getName(), gen.newCSN(), user1entryUUID)); |
| | | broker.publish( |
| | | new DeleteMsg(personWithSecondUniqueID.getDN(), gen.newCSN(), user1entrysecondUUID)); |
| | | new DeleteMsg(personWithSecondUniqueID.getName(), gen.newCSN(), user1entrysecondUUID)); |
| | | |
| | | assertNull(getEntry(personWithUUIDEntry.getDN(), 10000, false), |
| | | assertNull(getEntry(personWithUUIDEntry.getName(), 10000, false), |
| | | "The DELETE replication message was not replayed"); |
| | | assertNull(getEntry(personWithSecondUniqueID.getDN(), 10000, false), |
| | | assertNull(getEntry(personWithSecondUniqueID.getName(), 10000, false), |
| | | "The DELETE replication message was not replayed"); |
| | | /* |
| | | * Check that and added entry is correctly added below it's |
| | |
| | | // Create an Entry (add operation) |
| | | Entry tmp = personEntry.duplicate(false); |
| | | AddOperation addOp = connection.processAdd(tmp); |
| | | assertTrue(DirectoryServer.entryExists(personEntry.getDN()), |
| | | assertTrue(DirectoryServer.entryExists(personEntry.getName()), |
| | | "The Add Entry operation failed"); |
| | | assertEquals(addOp.getResultCode(), ResultCode.SUCCESS); |
| | | assertClientReceivesExpectedMsg(broker, AddMsg.class, personEntry.getDN()); |
| | | assertClientReceivesExpectedMsg(broker, AddMsg.class, personEntry.getName()); |
| | | |
| | | // Modify the entry |
| | | List<Modification> mods = generatemods("telephonenumber", "01 02 45"); |
| | | connection.processModify(personEntry.getDN(), mods); |
| | | assertClientReceivesExpectedMsg(broker, ModifyMsg.class, personEntry.getDN()); |
| | | connection.processModify(personEntry.getName(), mods); |
| | | assertClientReceivesExpectedMsg(broker, ModifyMsg.class, personEntry.getName()); |
| | | |
| | | // Modify the entry DN |
| | | DN newDN = DN.valueOf("uid= new person," + baseDN); |
| | | connection.processModifyDN(personEntry.getDN(), |
| | | connection.processModifyDN(personEntry.getName(), |
| | | RDN.decode("uid=new person"), true, baseDN); |
| | | assertTrue(DirectoryServer.entryExists(newDN), |
| | | "The MOD_DN operation didn't create the new person entry"); |
| | | assertFalse(DirectoryServer.entryExists(personEntry.getDN()), |
| | | assertFalse(DirectoryServer.entryExists(personEntry.getName()), |
| | | "The MOD_DN operation didn't delete the old person entry"); |
| | | assertClientReceivesExpectedMsg(broker, ModifyDNMsg.class, personEntry.getDN()); |
| | | assertClientReceivesExpectedMsg(broker, ModifyDNMsg.class, personEntry.getName()); |
| | | |
| | | // Delete the entry |
| | | connection.processDelete(newDN); |
| | |
| | | /* |
| | | * Check that the entry has been created in the local DS. |
| | | */ |
| | | Entry resultEntry = getEntry(personWithUUIDEntry.getDN(), 10000, true); |
| | | Entry resultEntry = getEntry(personWithUUIDEntry.getName(), 10000, true); |
| | | assertNotNull(resultEntry, |
| | | "The send ADD replication message was not applied for "+personWithUUIDEntry.getDN().toString()); |
| | | "The send ADD replication message was not applied for "+personWithUUIDEntry.getName().toString()); |
| | | |
| | | /* |
| | | * Test the reception of Modify Msg |
| | | */ |
| | | ModifyMsg modMsg = new ModifyMsg(gen.newCSN(), personWithUUIDEntry.getDN(), |
| | | ModifyMsg modMsg = new ModifyMsg(gen.newCSN(), personWithUUIDEntry.getName(), |
| | | mods, user1entryUUID); |
| | | modMsg.setAssured(assured); |
| | | broker.publish(modMsg); |
| | | |
| | | boolean found = checkEntryHasAttribute(personWithUUIDEntry.getDN(), |
| | | boolean found = checkEntryHasAttribute(personWithUUIDEntry.getName(), |
| | | "telephonenumber", "01 02 45", 10000, true); |
| | | assertTrue(found, "The modification has not been correctly replayed."); |
| | | |
| | | // Test that replication is able to add attribute that do |
| | | // not exist in the schema. |
| | | List<Modification> invalidMods = generatemods("badattribute", "value"); |
| | | modMsg = new ModifyMsg(gen.newCSN(), personWithUUIDEntry.getDN(), |
| | | modMsg = new ModifyMsg(gen.newCSN(), personWithUUIDEntry.getName(), |
| | | invalidMods, user1entryUUID); |
| | | modMsg.setAssured(assured); |
| | | broker.publish(modMsg); |
| | | |
| | | found = checkEntryHasAttribute( |
| | | personWithUUIDEntry.getDN(), "badattribute", "value", 10000, true); |
| | | personWithUUIDEntry.getName(), "badattribute", "value", 10000, true); |
| | | assertTrue(found, "The modification has not been correctly replayed."); |
| | | |
| | | /* |
| | | * Test the Reception of Modify Dn Msg |
| | | */ |
| | | ModifyDNMsg moddnMsg = new ModifyDNMsg(personWithUUIDEntry.getDN(), |
| | | ModifyDNMsg moddnMsg = new ModifyDNMsg(personWithUUIDEntry.getName(), |
| | | gen.newCSN(), |
| | | user1entryUUID, null, |
| | | true, null, "uid= new person"); |
| | |
| | | long initialCount = getMonitorAttrValue(baseDN, "replayed-updates"); |
| | | |
| | | // Get the UUID of the test entry. |
| | | Entry resultEntry = getEntry(tmp.getDN(), 1, true); |
| | | Entry resultEntry = getEntry(tmp.getName(), 1, true); |
| | | AttributeType uuidType = DirectoryServer.getAttributeType("entryuuid"); |
| | | String uuid = resultEntry.getAttributeValue(uuidType, DirectoryStringSyntax.DECODER); |
| | | |
| | |
| | | try |
| | | { |
| | | // Publish a delete message for this test entry. |
| | | DeleteMsg delMsg = new DeleteMsg(tmp.getDN(), gen.newCSN(), uuid); |
| | | DeleteMsg delMsg = new DeleteMsg(tmp.getName(), gen.newCSN(), uuid); |
| | | broker.publish(delMsg); |
| | | |
| | | // Wait for the operation to be replayed. |
| | |
| | | broker.publish(addMsg); |
| | | |
| | | // Check that the entry has not been created in the directory server. |
| | | assertNotNull(getEntry(user3Entry.getDN(), 1000, true), |
| | | assertNotNull(getEntry(user3Entry.getName(), 1000, true), |
| | | "The entry has not been created"); |
| | | |
| | | // Modify the entry |
| | | List<Modification> mods = generatemods("telephonenumber", "01 02 45"); |
| | | connection.processModify(user3Entry.getDN(), mods); |
| | | connection.processModify(user3Entry.getName(), mods); |
| | | |
| | | // See if the client has received the msg |
| | | ReplicationMsg msg = broker.receive(); |
| | |
| | | |
| | | // Delete the entries to clean the database. |
| | | broker.publish( |
| | | new DeleteMsg(user3Entry.getDN(), gen.newCSN(), user3UUID)); |
| | | new DeleteMsg(user3Entry.getName(), gen.newCSN(), user3UUID)); |
| | | |
| | | // Check that the delete operation has been applied. |
| | | assertNull(getEntry(user3Entry.getDN(), 10000, false), |
| | | assertNull(getEntry(user3Entry.getName(), 10000, false), |
| | | "The DELETE replication message was not replayed"); |
| | | } |
| | | finally |
| | |
| | | */ |
| | | private void addEntry(Entry entry) throws Exception |
| | | { |
| | | debugInfo("AddEntry " + entry.getDN()); |
| | | debugInfo("AddEntry " + entry.getName()); |
| | | AddOperation addOp = connection.processAdd(entry); |
| | | waitOpResult(addOp, ResultCode.SUCCESS); |
| | | assertNotNull(getEntry(entry.getDN(), 1000, true)); |
| | | assertNotNull(getEntry(entry.getName(), 1000, true)); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | // Add the config entry to create the replicated domain |
| | | DirectoryServer.getConfigHandler().addEntry(domainCfgEntry, null); |
| | | assertNotNull(DirectoryServer.getConfigEntry(domainCfgEntry.getDN()), |
| | | assertNotNull(DirectoryServer.getConfigEntry(domainCfgEntry.getName()), |
| | | "Unable to add the domain config entry: " + configEntryLdif); |
| | | |
| | | return domainCfgEntry; |
| | |
| | | |
| | | // Add the config entry to create the replicated domain |
| | | DirectoryServer.getConfigHandler().addEntry(domainCfgEntry, null); |
| | | assertNotNull(DirectoryServer.getConfigEntry(domainCfgEntry.getDN()), |
| | | assertNotNull(DirectoryServer.getConfigEntry(domainCfgEntry.getName()), |
| | | "Unable to add the domain config entry: " + configEntryLdif); |
| | | |
| | | return domainCfgEntry; |
| | |
| | | { |
| | | { |
| | | AddMsg addMsg = |
| | | new AddMsg(gen.newCSN(), entry.getDN(), UUID.randomUUID().toString(), |
| | | new AddMsg(gen.newCSN(), entry.getName(), UUID.randomUUID().toString(), |
| | | parentUid, |
| | | entry.getObjectClassAttribute(), |
| | | entry.getAttributes(), null ); |
| | |
| | | fail("Should only go here for RS with same group id as DS"); |
| | | |
| | | // Ack received, replay has occurred |
| | | assertNotNull(DirectoryServer.getEntry(entry.getDN())); |
| | | assertNotNull(DirectoryServer.getEntry(entry.getName())); |
| | | |
| | | // Check that DS replied an ack without errors anyway |
| | | assertFalse(ackMsg.hasTimeout()); |
| | |
| | | |
| | | // Add the config entry to create the replicated domain |
| | | DirectoryServer.getConfigHandler().addEntry(fractionalDomainCfgEntry, null); |
| | | assertNotNull(DirectoryServer.getConfigEntry(fractionalDomainCfgEntry.getDN()), |
| | | assertNotNull(DirectoryServer.getConfigEntry(fractionalDomainCfgEntry.getName()), |
| | | "Unable to add the domain config entry: " + configEntryLdif); |
| | | } |
| | | } |
| | |
| | | |
| | | // Create an update message to add an entry. |
| | | AddMsg addMsg = new AddMsg(gen.newCSN(), |
| | | entry.getDN(), |
| | | entry.getName(), |
| | | ENTRY_UUID, |
| | | null, |
| | | entry.getObjectClassAttribute(), |
| | |
| | | private void addEntry(Entry entry) throws Exception |
| | | { |
| | | connection.processAdd(entry); |
| | | assertNotNull(getEntry(entry.getDN(), 1000, true)); |
| | | assertNotNull(getEntry(entry.getName(), 1000, true)); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | // Create an update message to add an entry. |
| | | AddMsg addMsg = new AddMsg(gen.newCSN(), |
| | | entry.getDN(), |
| | | entry.getName(), |
| | | ENTRY_UUID, |
| | | null, |
| | | entry.getObjectClassAttribute(), |
| | |
| | | * check that entry has been created and has attribute values from RDN |
| | | * only |
| | | */ |
| | | Entry newEntry = getEntry(entry.getDN(), TIMEOUT, true); |
| | | Entry newEntry = getEntry(entry.getName(), TIMEOUT, true); |
| | | assertNotNull(newEntry); |
| | | assertEquals(entry.getDN(), newEntry.getDN()); |
| | | assertEquals(entry.getName(), newEntry.getName()); |
| | | ObjectClass objectClass = DirectoryServer.getObjectClass("inetOrgPerson".toLowerCase()); |
| | | assertTrue(newEntry.hasObjectClass(objectClass)); |
| | | checkEntryAttributeValue(newEntry, "displayName", "ValueToBeKept"); |
| | |
| | | |
| | | // Create an update message to add an entry. |
| | | addMsg = new AddMsg(gen.newCSN(), |
| | | entry.getDN(), |
| | | entry.getName(), |
| | | ENTRY_UUID2, |
| | | null, |
| | | entry.getObjectClassAttribute(), |
| | |
| | | * check that entry has been created and has attribute values from RDN |
| | | * only |
| | | */ |
| | | newEntry = getEntry(entry.getDN(), TIMEOUT, true); |
| | | newEntry = getEntry(entry.getName(), TIMEOUT, true); |
| | | assertNotNull(newEntry); |
| | | assertEquals(entry.getDN(), newEntry.getDN()); |
| | | assertEquals(entry.getName(), newEntry.getName()); |
| | | objectClass = DirectoryServer.getObjectClass("inetOrgPerson".toLowerCase()); |
| | | assertTrue(newEntry.hasObjectClass(objectClass)); |
| | | checkEntryAttributeValue(newEntry, "displayName", "ValueToBeKept"); |
| | |
| | | |
| | | // Create an update message to add an entry. |
| | | AddMsg addMsg = new AddMsg(gen.newCSN(), |
| | | entry.getDN(), |
| | | entry.getName(), |
| | | ENTRY_UUID, |
| | | null, |
| | | entry.getObjectClassAttribute(), |
| | |
| | | * check that entry has been created and has attribute values from RDN |
| | | * only |
| | | */ |
| | | Entry newEntry = getEntry(entry.getDN(), TIMEOUT, true); |
| | | Entry newEntry = getEntry(entry.getName(), TIMEOUT, true); |
| | | assertNotNull(newEntry); |
| | | assertEquals(entry.getDN(), newEntry.getDN()); |
| | | assertEquals(entry.getName(), newEntry.getName()); |
| | | ObjectClass objectClass = DirectoryServer.getObjectClass("inetOrgPerson".toLowerCase()); |
| | | assertTrue(newEntry.hasObjectClass(objectClass)); |
| | | checkEntryAttributeValue(newEntry, "displayName", "ValueToBeKept"); |
| | |
| | | |
| | | // Create an update message to add an entry. |
| | | addMsg = new AddMsg(gen.newCSN(), |
| | | entry.getDN(), |
| | | entry.getName(), |
| | | ENTRY_UUID2, |
| | | null, |
| | | entry.getObjectClassAttribute(), |
| | |
| | | * check that entry has been created and has attribute values from RDN |
| | | * only |
| | | */ |
| | | newEntry = getEntry(entry.getDN(), TIMEOUT, true); |
| | | newEntry = getEntry(entry.getName(), TIMEOUT, true); |
| | | assertNotNull(newEntry); |
| | | assertEquals(entry.getDN(), newEntry.getDN()); |
| | | assertEquals(entry.getName(), newEntry.getName()); |
| | | objectClass = DirectoryServer.getObjectClass("inetOrgPerson".toLowerCase()); |
| | | assertTrue(newEntry.hasObjectClass(objectClass)); |
| | | checkEntryAttributeValue(newEntry, "displayName", "ValueToBeKept"); |
| | |
| | | |
| | | // Create an update message to add an entry. |
| | | AddMsg addMsg = new AddMsg(gen.newCSN(), |
| | | entry.getDN(), |
| | | entry.getName(), |
| | | ENTRY_UUID, |
| | | null, |
| | | entry.getObjectClassAttribute(), |
| | |
| | | replicationDomain.publish(addMsg); |
| | | |
| | | // check that entry has been created and has attribute values from RDN |
| | | Entry newEntry = getEntry(entry.getDN(), TIMEOUT, true); |
| | | Entry newEntry = getEntry(entry.getName(), TIMEOUT, true); |
| | | assertNotNull(newEntry); |
| | | assertEquals(entry.getDN(), newEntry.getDN()); |
| | | assertEquals(entry.getName(), newEntry.getName()); |
| | | ObjectClass objectClass = DirectoryServer.getObjectClass("inetOrgPerson".toLowerCase()); |
| | | assertTrue(newEntry.hasObjectClass(objectClass)); |
| | | checkEntryAttributeValue(newEntry, "displayName", "ValueToBeKept"); |
| | |
| | | */ |
| | | newEntry = getEntry(newEntryDn, TIMEOUT, true); |
| | | assertNotNull(newEntry); |
| | | assertEquals(newEntryDn, newEntry.getDN()); |
| | | assertEquals(newEntryDn, newEntry.getName()); |
| | | objectClass = DirectoryServer.getObjectClass("inetOrgPerson".toLowerCase()); |
| | | assertTrue(newEntry.hasObjectClass(objectClass)); |
| | | checkEntryAttributeValue(newEntry, "displayName", "ValueToBeKept"); |
| | |
| | | |
| | | // Create an update message to add an entry. |
| | | AddMsg addMsg = new AddMsg(gen.newCSN(), |
| | | entry.getDN(), |
| | | entry.getName(), |
| | | ENTRY_UUID, |
| | | null, |
| | | entry.getObjectClassAttribute(), |
| | |
| | | replicationDomain.publish(addMsg); |
| | | |
| | | // check that entry has been created and has attribute values from RDN |
| | | Entry newEntry = getEntry(entry.getDN(), TIMEOUT, true); |
| | | Entry newEntry = getEntry(entry.getName(), TIMEOUT, true); |
| | | assertNotNull(newEntry); |
| | | assertEquals(entry.getDN(), newEntry.getDN()); |
| | | assertEquals(entry.getName(), newEntry.getName()); |
| | | ObjectClass objectClass = DirectoryServer.getObjectClass("inetOrgPerson".toLowerCase()); |
| | | assertTrue(newEntry.hasObjectClass(objectClass)); |
| | | checkEntryAttributeValue(newEntry, "displayName", "ValueToBeKept"); |
| | |
| | | */ |
| | | newEntry = getEntry(newEntryDn, TIMEOUT, true); |
| | | assertNotNull(newEntry); |
| | | assertEquals(newEntryDn, newEntry.getDN()); |
| | | assertEquals(newEntryDn, newEntry.getName()); |
| | | objectClass = DirectoryServer.getObjectClass("inetOrgPerson".toLowerCase()); |
| | | assertTrue(newEntry.hasObjectClass(objectClass)); |
| | | checkEntryAttributeValue(newEntry, "displayName", "ValueToBeKept"); |
| | |
| | | } |
| | | |
| | | Entry newEntry = DirectoryServer.getEntry(dn2); |
| | | assertEquals(entry.getDN(), newEntry.getDN()); |
| | | assertEquals(entry.getName(), newEntry.getName()); |
| | | } |
| | | |
| | | /** |
| | |
| | | CSN t = new CSN(date, 0, 0); |
| | | |
| | | ModifyOperationBasis modOpBasis = |
| | | new ModifyOperationBasis(aConnection, 1, 1, null, entry.getDN(), mods); |
| | | new ModifyOperationBasis(aConnection, 1, 1, null, entry.getName(), mods); |
| | | LocalBackendModifyOperation modOp = new LocalBackendModifyOperation(modOpBasis); |
| | | ModifyContext ctx = new ModifyContext(t, "uniqueId"); |
| | | modOp.setAttachment(SYNCHROCONTEXT, ctx); |
| | |
| | | mods.add(mod); |
| | | |
| | | ModifyOperationBasis modOpBasis = |
| | | new ModifyOperationBasis(aConnection, 1, 1, null, entry.getDN(), mods); |
| | | new ModifyOperationBasis(aConnection, 1, 1, null, entry.getName(), mods); |
| | | LocalBackendModifyOperation modOp = new LocalBackendModifyOperation(modOpBasis); |
| | | ModifyContext ctx = new ModifyContext(t, "uniqueId"); |
| | | modOp.setAttachment(SYNCHROCONTEXT, ctx); |
| | |
| | | { |
| | | AddOperationBasis addOpBasis = |
| | | new AddOperationBasis(aConnection, 1, 1, null, entry |
| | | .getDN(), entry.getObjectClasses(), entry.getUserAttributes(), |
| | | .getName(), entry.getObjectClasses(), entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | LocalBackendAddOperation addOp = new LocalBackendAddOperation(addOpBasis); |
| | | testHistorical(addOp); |
| | |
| | | + "userPassword: password\n" + "initials: AA\n"); |
| | | |
| | | TestCaseUtils.addEntry(entry); |
| | | String entryUUID = getEntryUUID(entry.getDN()); |
| | | String entryUUID = getEntryUUID(entry.getName()); |
| | | |
| | | // generate two consecutive CSN that will be used in backward order |
| | | CSN csn1 = gen.newCSN(); |
| | | CSN csn2 = gen.newCSN(); |
| | | |
| | | ModifyDNMsg modDnMsg = new ModifyDNMsg( |
| | | entry.getDN(), csn2, |
| | | entry.getName(), csn2, |
| | | entryUUID, parentUUID, false, |
| | | TEST_ROOT_DN_STRING, |
| | | "uid=simultaneous2"); |
| | |
| | | // This MODIFY DN uses an older DN and should therefore be cancelled |
| | | // at replay time. |
| | | modDnMsg = new ModifyDNMsg( |
| | | entry.getDN(), csn1, |
| | | entry.getName(), csn1, |
| | | entryUUID, parentUUID, false, |
| | | TEST_ROOT_DN_STRING, |
| | | "uid=simulatneouswrong"); |
| | |
| | | domain.replay(queue.take().getUpdateMessage(), SHUTDOWN); |
| | | |
| | | // Expect the conflict resolution |
| | | assertFalse(DirectoryServer.entryExists(entry.getDN()), |
| | | assertFalse(DirectoryServer.entryExists(entry.getName()), |
| | | "The modDN conflict was not resolved as expected."); |
| | | } |
| | | finally |
| | |
| | | // Now try to add the same entry with same DN but a different |
| | | // unique ID though the replication |
| | | AddMsg addMsg = new AddMsg(csn1, |
| | | entry.getDN(), |
| | | entry.getName(), |
| | | "c9cb8c3c-615a-4122-865d-50323aaaed48", parentUUID, |
| | | entry.getObjectClasses(), entry.getUserAttributes(), |
| | | null); |
| | |
| | | domain.replay(queue.take().getUpdateMessage(), SHUTDOWN); |
| | | |
| | | // Now delete the first entry that was added at the beginning |
| | | TestCaseUtils.deleteEntry(entry.getDN()); |
| | | TestCaseUtils.deleteEntry(entry.getName()); |
| | | |
| | | // Expect the conflict resolution : the second entry should now |
| | | // have been renamed with the original DN. |
| | | Entry resultEntry = DirectoryServer.getEntry(entry.getDN()); |
| | | Entry resultEntry = DirectoryServer.getEntry(entry.getName()); |
| | | assertNotNull(resultEntry, "The conflict was not cleared"); |
| | | assertEquals(getEntryUUID(resultEntry.getDN()), |
| | | assertEquals(getEntryUUID(resultEntry.getName()), |
| | | "c9cb8c3c-615a-4122-865d-50323aaaed48", |
| | | "The wrong entry has been renamed"); |
| | | assertNull(resultEntry.getAttribute(LDAPReplicationDomain.DS_SYNC_CONFLICT)); |
| | |
| | | // Now try to add the same entry with same DN but a different |
| | | // unique ID though the replication |
| | | AddMsg addMsg = new AddMsg(csn1, |
| | | entry.getDN(), |
| | | entry.getName(), |
| | | "c9cb8c3c-615a-4122-865d-50323aaaed48", parentUUID, |
| | | entry.getObjectClasses(), entry.getUserAttributes(), |
| | | null); |
| | |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | ModifyDNOperation modDNOperation = |
| | | conn.processModifyDN(entry.getDN(), RDN.decode("cn=foo"), false); |
| | | conn.processModifyDN(entry.getName(), RDN.decode("cn=foo"), false); |
| | | assertEquals(modDNOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | | // Expect the conflict resolution : the second entry should now |
| | | // have been renamed with the original DN. |
| | | Entry resultEntry = DirectoryServer.getEntry(entry.getDN()); |
| | | Entry resultEntry = DirectoryServer.getEntry(entry.getName()); |
| | | assertNotNull(resultEntry, "The conflict was not cleared"); |
| | | assertEquals(getEntryUUID(resultEntry.getDN()), |
| | | assertEquals(getEntryUUID(resultEntry.getName()), |
| | | "c9cb8c3c-615a-4122-865d-50323aaaed48", |
| | | "The wrong entry has been renamed"); |
| | | assertNull(resultEntry.getAttribute(LDAPReplicationDomain.DS_SYNC_CONFLICT)); |
| | |
| | | TestCaseUtils.addEntry(parentEntry); |
| | | TestCaseUtils.addEntry(childEntry); |
| | | |
| | | String parentUUID = getEntryUUID(parentEntry.getDN()); |
| | | String parentUUID = getEntryUUID(parentEntry.getName()); |
| | | |
| | | CSN csn2 = gen.newCSN(); |
| | | DeleteMsg delMsg = new DeleteMsg(parentEntry.getDN(), csn2, parentUUID); |
| | | DeleteMsg delMsg = new DeleteMsg(parentEntry.getName(), csn2, parentUUID); |
| | | delMsg.setSubtreeDelete(true); |
| | | |
| | | // Put the message in the replay queue |
| | |
| | | domain.replay(queue.take().getUpdateMessage(), SHUTDOWN); |
| | | |
| | | // Expect the subtree to be deleted and no conflict entry created |
| | | assertFalse(DirectoryServer.entryExists(parentEntry.getDN()), |
| | | assertFalse(DirectoryServer.entryExists(parentEntry.getName()), |
| | | "DEL subtree on parent was not processed as expected."); |
| | | assertFalse(DirectoryServer.entryExists(parentEntry.getDN()), |
| | | assertFalse(DirectoryServer.entryExists(parentEntry.getName()), |
| | | "DEL subtree on parent was not processed as expected."); |
| | | } |
| | | finally |
| | |
| | | TestCaseUtils.addEntry(parentEntry); |
| | | TestCaseUtils.addEntry(childEntry); |
| | | |
| | | assertTrue(DirectoryServer.entryExists(parentEntry.getDN()), |
| | | assertTrue(DirectoryServer.entryExists(parentEntry.getName()), |
| | | "Parent entry expected to exist."); |
| | | assertTrue(DirectoryServer.entryExists(childEntry.getDN()), |
| | | assertTrue(DirectoryServer.entryExists(childEntry.getName()), |
| | | "Child entry expected to be exist."); |
| | | |
| | | String parentUUID = getEntryUUID(parentEntry.getDN()); |
| | | String childUUID = getEntryUUID(childEntry.getDN()); |
| | | String parentUUID = getEntryUUID(parentEntry.getName()); |
| | | String childUUID = getEntryUUID(childEntry.getName()); |
| | | |
| | | CSN csn2 = gen.newCSN(); |
| | | DeleteMsg delMsg = new DeleteMsg(parentEntry.getDN(), csn2, parentUUID); |
| | | DeleteMsg delMsg = new DeleteMsg(parentEntry.getName(), csn2, parentUUID); |
| | | // NOT SUBTREE |
| | | |
| | | // Put the message in the replay queue |
| | |
| | | domain.replay(queue.take().getUpdateMessage(), SHUTDOWN); |
| | | |
| | | // Expect the parent entry to be deleted |
| | | assertTrue(!DirectoryServer.entryExists(parentEntry.getDN()), |
| | | "Parent entry expected to be deleted : " + parentEntry.getDN()); |
| | | assertTrue(!DirectoryServer.entryExists(parentEntry.getName()), |
| | | "Parent entry expected to be deleted : " + parentEntry.getName()); |
| | | |
| | | // Expect the child entry to be moved as conflict entry under the root |
| | | // entry of the suffix |
| | |
| | | |
| | | |
| | | TestCaseUtils.addEntry(parentEntry); |
| | | String parentUUID = getEntryUUID(parentEntry.getDN()); |
| | | String parentUUID = getEntryUUID(parentEntry.getName()); |
| | | TestCaseUtils.deleteEntry(parentEntry); |
| | | |
| | | CSN csn1 = gen.newCSN(); |
| | |
| | | String childUUID = "44444444-4444-4444-4444-444444444444"; |
| | | AddMsg addMsg = new AddMsg( |
| | | csn1, |
| | | childEntry.getDN(), |
| | | childEntry.getName(), |
| | | childUUID, |
| | | parentUUID, |
| | | childEntry.getObjectClassAttribute(), |
| | |
| | | domain.replay(queue.take().getUpdateMessage(), SHUTDOWN); |
| | | |
| | | // Expect the parent entry to be deleted |
| | | assertFalse(DirectoryServer.entryExists(parentEntry.getDN()), |
| | | assertFalse(DirectoryServer.entryExists(parentEntry.getName()), |
| | | "Parent entry exists "); |
| | | |
| | | // Expect the child entry to be moved as conflict entry under the root |
| | |
| | | |
| | | // Create an update message to add an entry. |
| | | return new AddMsg(gen.newCSN(), |
| | | personWithUUIDEntry.getDN(), |
| | | personWithUUIDEntry.getName(), |
| | | userEntryUUID, |
| | | null, |
| | | personWithUUIDEntry.getObjectClassAttribute(), |
| | |
| | | private void addEntry(Entry entry) throws Exception |
| | | { |
| | | waitOpResult(connection.processAdd(entry), ResultCode.SUCCESS); |
| | | assertNotNull(getEntry(entry.getDN(), 1000, true)); |
| | | assertNotNull(getEntry(entry.getName(), 1000, true)); |
| | | } |
| | | |
| | | private void ECLOnPrivateBackend() throws Exception |
| | |
| | | |
| | | private void checkDn(CSN csn, SearchResultEntry resultEntry) |
| | | { |
| | | String actualDN = resultEntry.getDN().toNormalizedString(); |
| | | String actualDN = resultEntry.getName().toNormalizedString(); |
| | | String expectedDN = |
| | | "replicationcsn=" + csn + "," + TEST_ROOT_DN_STRING + ",cn=changelog"; |
| | | assertThat(actualDN).isEqualToIgnoringCase(expectedDN); |
| | |
| | | Entry entry = TestCaseUtils.entryFromLdifString(lentry); |
| | | AddMsg addMsg = new AddMsg( |
| | | csns[1], |
| | | entry.getDN(), |
| | | entry.getName(), |
| | | user1entryUUID, |
| | | baseUUID, |
| | | entry.getObjectClassAttribute(), |
| | |
| | | |
| | | private void assertDNEquals(SearchResultEntry resultEntry, long changeNumber) |
| | | { |
| | | String actualDN = resultEntry.getDN().toNormalizedString(); |
| | | String actualDN = resultEntry.getName().toNormalizedString(); |
| | | String expectedDN = "changenumber=" + changeNumber + ",cn=changelog"; |
| | | assertThat(actualDN).isEqualToIgnoringCase(expectedDN); |
| | | } |
| | |
| | | |
| | | // check the entry has the right content |
| | | SearchResultEntry resultEntry = searchOp.getSearchEntries().get(0); |
| | | assertTrue("changenumber=6,cn=changelog".equalsIgnoreCase(resultEntry.getDN().toNormalizedString())); |
| | | assertTrue("changenumber=6,cn=changelog".equalsIgnoreCase(resultEntry.getName().toNormalizedString())); |
| | | checkValue(resultEntry, "replicationcsn", csn.toString()); |
| | | checkValue(resultEntry, "replicaidentifier", String.valueOf(SERVER_ID_1)); |
| | | checkValue(resultEntry, "changetype", "add"); |
| | |
| | | |
| | | // mod 'sn' of fiona (o=test2) with 'sn' configured as ecl-incl-att |
| | | final ModifyOperation modOp1 = connection.processModify( |
| | | uentry1.getDN(), createMods("sn", "newsn")); |
| | | uentry1.getName(), createMods("sn", "newsn")); |
| | | waitOpResult(modOp1, ResultCode.SUCCESS); |
| | | |
| | | // mod 'telephonenumber' of robert (o=test3) |
| | | final ModifyOperation modOp2 = connection.processModify( |
| | | uentry2.getDN(), createMods("telephonenumber", "555555")); |
| | | uentry2.getName(), createMods("telephonenumber", "555555")); |
| | | waitOpResult(modOp2, ResultCode.SUCCESS); |
| | | |
| | | // moddn robert (o=test3) to robert2 (o=test3) |
| | |
| | | |
| | | // Create and publish an update message to add an entry. |
| | | return new AddMsg(csn, |
| | | personWithUUIDEntry.getDN(), |
| | | personWithUUIDEntry.getName(), |
| | | user1entryUUID, |
| | | baseUUID, |
| | | personWithUUIDEntry.getObjectClassAttribute(), |
| | |
| | | ArrayList<DN> returnedDNOrder = new ArrayList<DN>(); |
| | | for (Entry e : internalSearch.getSearchEntries()) |
| | | { |
| | | returnedDNOrder.add(e.getDN()); |
| | | returnedDNOrder.add(e.getName()); |
| | | } |
| | | assertEquals(returnedDNOrder, expectedDNOrder); |
| | | } |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = conn.processAdd(entry.getDN(), |
| | | AddOperation addOperation = conn.processAdd(entry.getName(), |
| | | entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | AddOperation addOperation = conn.processAdd(entry.getDN(), |
| | | AddOperation addOperation = conn.processAdd(entry.getName(), |
| | | entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | |
| | | SearchResultEntry e = entries.get(0); |
| | | //An entry must be returned. |
| | | assertNotNull(e); |
| | | assertTrue(e.getDN().equals(DN.valueOf("cn=test1,o=test"))); |
| | | assertTrue(e.getName().equals(DN.valueOf("cn=test1,o=test"))); |
| | | } |
| | | finally |
| | | { |
| | |
| | | boolean found = false; |
| | | for(SearchResultEntry entry: entries) |
| | | { |
| | | System.out.println("dn from the current entry is " + entry.getDN()); |
| | | if(entry.getDN().equals(dn)) |
| | | System.out.println("dn from the current entry is " + entry.getName()); |
| | | if(entry.getName().equals(dn)) |
| | | { |
| | | found = true; |
| | | } |
| | |
| | | |
| | | // Add the task. |
| | | AddOperation addOperation = |
| | | connection.processAdd(taskEntry.getDN(), |
| | | connection.processAdd(taskEntry.getName(), |
| | | taskEntry.getObjectClasses(), |
| | | taskEntry.getUserAttributes(), |
| | | taskEntry.getOperationalAttributes()); |
| | |
| | | do |
| | | { |
| | | InternalSearchOperation searchOperation = |
| | | connection.processSearch(taskEntry.getDN(), |
| | | connection.processSearch(taskEntry.getName(), |
| | | SearchScope.BASE_OBJECT, |
| | | filter); |
| | | try |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.tasks; |
| | |
| | | |
| | | // Add the task. |
| | | AddOperation addOperation = |
| | | connection.processAdd(taskEntry.getDN(), |
| | | connection.processAdd(taskEntry.getName(), |
| | | taskEntry.getObjectClasses(), |
| | | taskEntry.getUserAttributes(), |
| | | taskEntry.getOperationalAttributes()); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.tools; |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.tools; |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.tools; |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2013 ForgeRock AS |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.tools; |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | AddOperation addOperation = |
| | | conn.processAdd(e.getDN(), e.getObjectClasses(), e.getUserAttributes(), |
| | | conn.processAdd(e.getName(), e.getObjectClasses(), e.getUserAttributes(), |
| | | e.getOperationalAttributes()); |
| | | assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | "userPassword: password"); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertPrivilege(addOperation.getResultCode(), hasPrivilege); |
| | | |
| | | DN dnToRemove = entry.getDN(); |
| | | DN dnToRemove = entry.getName(); |
| | | if (!hasPrivilege) |
| | | { |
| | | dnToRemove = DN.valueOf("cn=Telex Number,cn=Syntaxes,cn=config"); |
| | |
| | | "subtreeSpecification: {}"); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(entry.getDN(), entry.getObjectClasses(), |
| | | conn.processAdd(entry.getName(), entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | assertPrivilege(addOperation.getResultCode(), hasPrivilege); |
| | | |
| | | DN dnToRemove = entry.getDN(); |
| | | DN dnToRemove = entry.getName(); |
| | | if (!hasPrivilege) |
| | | { |
| | | dnToRemove = DN.valueOf("cn=Subentry Target,o=test"); |
| | |
| | | userDN = ""; |
| | | userPassword = ""; |
| | | } |
| | | else if (authNEntry.getDN().toString().equalsIgnoreCase(INTERNAL_ROOT_DN)) |
| | | else if (authNEntry.getName().toString().equalsIgnoreCase(INTERNAL_ROOT_DN)) |
| | | { |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | userDN = authNEntry.getDN().toString(); |
| | | userDN = authNEntry.getName().toString(); |
| | | userPassword = "password"; |
| | | } |
| | | |
| | |
| | | userDN = ""; |
| | | userPassword = ""; |
| | | } |
| | | else if (authNEntry.getDN().toString().equalsIgnoreCase(INTERNAL_ROOT_DN)) |
| | | else if (authNEntry.getName().toString().equalsIgnoreCase(INTERNAL_ROOT_DN)) |
| | | { |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | userDN = authNEntry.getDN().toString(); |
| | | userDN = authNEntry.getName().toString(); |
| | | userPassword = "password"; |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | identifier = authNEntry.getDN().toString(); |
| | | identifier = authNEntry.getName().toString(); |
| | | identifier = identifier.replace(',', '-'); |
| | | identifier = identifier.replace(' ', '-'); |
| | | identifier = identifier.replace('=', '-'); |
| | |
| | | "ds-task-schema-file-name: 05-" + identifier + ".ldif"); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(taskEntry.getDN(), taskEntry.getObjectClasses(), |
| | | conn.processAdd(taskEntry.getName(), taskEntry.getObjectClasses(), |
| | | taskEntry.getUserAttributes(), |
| | | taskEntry.getOperationalAttributes()); |
| | | assertPrivilege(addOperation.getResultCode(), hasPrivilege); |
| | | |
| | | if (hasPrivilege) |
| | | { |
| | | Task task = getCompletedTask(taskEntry.getDN()); |
| | | Task task = getCompletedTask(taskEntry.getName()); |
| | | assertNotNull(task); |
| | | assertTrue(TaskState.isSuccessful(task.getTaskState())); |
| | | } |
| | |
| | | "ds-task-backup-all: TRUE"); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(taskEntry.getDN(), taskEntry.getObjectClasses(), |
| | | conn.processAdd(taskEntry.getName(), taskEntry.getObjectClasses(), |
| | | taskEntry.getUserAttributes(), |
| | | taskEntry.getOperationalAttributes()); |
| | | assertPrivilege(addOperation.getResultCode(), hasPrivilege); |
| | | |
| | | if (hasPrivilege) |
| | | { |
| | | Task task = getCompletedTask(taskEntry.getDN()); |
| | | Task task = getCompletedTask(taskEntry.getName()); |
| | | assertNotNull(task); |
| | | assertTrue(TaskState.isSuccessful(task.getTaskState())); |
| | | } |
| | |
| | | "ds-backup-directory-path: bak" + File.separator + "userRoot"); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(taskEntry.getDN(), taskEntry.getObjectClasses(), |
| | | conn.processAdd(taskEntry.getName(), taskEntry.getObjectClasses(), |
| | | taskEntry.getUserAttributes(), |
| | | taskEntry.getOperationalAttributes()); |
| | | assertPrivilege(addOperation.getResultCode(), hasPrivilege); |
| | | |
| | | if (hasPrivilege) |
| | | { |
| | | Task task = getCompletedTask(taskEntry.getDN()); |
| | | Task task = getCompletedTask(taskEntry.getName()); |
| | | assertNotNull(task); |
| | | assertTrue(TaskState.isSuccessful(task.getTaskState())); |
| | | } |
| | |
| | | "ds-task-export-ldif-file: " + tempFilePath); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(taskEntry.getDN(), taskEntry.getObjectClasses(), |
| | | conn.processAdd(taskEntry.getName(), taskEntry.getObjectClasses(), |
| | | taskEntry.getUserAttributes(), |
| | | taskEntry.getOperationalAttributes()); |
| | | assertPrivilege(addOperation.getResultCode(), hasPrivilege); |
| | | |
| | | if (hasPrivilege) |
| | | { |
| | | Task task = getCompletedTask(taskEntry.getDN()); |
| | | Task task = getCompletedTask(taskEntry.getName()); |
| | | assertNotNull(task); |
| | | assertTrue(TaskState.isSuccessful(task.getTaskState())); |
| | | |
| | |
| | | "ds-task-import-ldif-file: " + path); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(taskEntry.getDN(), taskEntry.getObjectClasses(), |
| | | conn.processAdd(taskEntry.getName(), taskEntry.getObjectClasses(), |
| | | taskEntry.getUserAttributes(), |
| | | taskEntry.getOperationalAttributes()); |
| | | assertPrivilege(addOperation.getResultCode(), hasPrivilege); |
| | | |
| | | if (hasPrivilege) |
| | | { |
| | | Task task = getCompletedTask(taskEntry.getDN()); |
| | | Task task = getCompletedTask(taskEntry.getName()); |
| | | assertNotNull(task); |
| | | assertTrue(TaskState.isSuccessful(task.getTaskState())); |
| | | } |
| | |
| | | "ds-task-rebuild-index: cn"); |
| | | |
| | | AddOperation addOperation = |
| | | conn.processAdd(taskEntry.getDN(), taskEntry.getObjectClasses(), |
| | | conn.processAdd(taskEntry.getName(), taskEntry.getObjectClasses(), |
| | | taskEntry.getUserAttributes(), |
| | | taskEntry.getOperationalAttributes()); |
| | | assertPrivilege(addOperation.getResultCode(), hasPrivilege); |
| | | |
| | | if (hasPrivilege) |
| | | { |
| | | Task task = getCompletedTask(taskEntry.getDN()); |
| | | Task task = getCompletedTask(taskEntry.getName()); |
| | | assertNotNull(task); |
| | | assertTrue(TaskState.isSuccessful(task.getTaskState())); |
| | | } |
| | |
| | | // Try to add the entry. If this fails with the proxy control, then add it |
| | | // with a root connection so we can do other things with it. |
| | | AddOperation addOperation = new AddOperationBasis(conn, nextOperationID(), nextMessageID(), |
| | | controls, e.getDN(), e.getObjectClasses(), |
| | | controls, e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | addOperation.run(); |
| | | assertProxyPrivilege(addOperation.getResultCode(), hasProxyPrivilege); |
| | |
| | | Attributes.create("description", "foo"))); |
| | | |
| | | ModifyOperation modifyOperation = new ModifyOperationBasis(conn, nextOperationID(), nextMessageID(), |
| | | controls, e.getDN(), mods); |
| | | controls, e.getName(), mods); |
| | | modifyOperation.run(); |
| | | assertProxyPrivilege(modifyOperation.getResultCode(), hasProxyPrivilege); |
| | | |
| | | |
| | | // Try to rename the entry. |
| | | ModifyDNOperation modifyDNOperation = new ModifyDNOperationBasis(conn, nextOperationID(), |
| | | nextMessageID(), controls, e.getDN(), |
| | | nextMessageID(), controls, e.getName(), |
| | | RDN.decode("cn=Proxy V1 Test"), true, null); |
| | | modifyDNOperation.run(); |
| | | assertProxyPrivilege(modifyOperation.getResultCode(), hasProxyPrivilege); |
| | | |
| | | DN newEntryDN = e.getDN(); |
| | | DN newEntryDN = e.getName(); |
| | | if (hasProxyPrivilege) |
| | | { |
| | | newEntryDN = modifyDNOperation.getNewDN(); |
| | |
| | | // with a root connection so we can do other things with it. |
| | | AddOperation addOperation = |
| | | new AddOperationBasis(conn, nextOperationID(), nextMessageID(), |
| | | controls, e.getDN(), e.getObjectClasses(), |
| | | controls, e.getName(), e.getObjectClasses(), |
| | | e.getUserAttributes(), e.getOperationalAttributes()); |
| | | addOperation.run(); |
| | | assertProxyPrivilege(addOperation.getResultCode(), hasProxyPrivilege); |
| | |
| | | |
| | | ModifyOperation modifyOperation = |
| | | new ModifyOperationBasis(conn, nextOperationID(), nextMessageID(), |
| | | controls, e.getDN(), mods); |
| | | controls, e.getName(), mods); |
| | | modifyOperation.run(); |
| | | assertProxyPrivilege(modifyOperation.getResultCode(), hasProxyPrivilege); |
| | | |
| | | |
| | | // Try to rename the entry. |
| | | ModifyDNOperation modifyDNOperation = new ModifyDNOperationBasis(conn, nextOperationID(), |
| | | nextMessageID(), controls, e.getDN(), |
| | | nextMessageID(), controls, e.getName(), |
| | | RDN.decode("cn=Proxy V2 Test"), true, null); |
| | | modifyDNOperation.run(); |
| | | assertProxyPrivilege(modifyDNOperation.getResultCode(), hasProxyPrivilege); |
| | | |
| | | DN newEntryDN = e.getDN(); |
| | | DN newEntryDN = e.getName(); |
| | | if (hasProxyPrivilege) |
| | | { |
| | | newEntryDN = modifyDNOperation.getNewDN(); |
| | |
| | | Entry entry = reader.readEntry(); |
| | | Assert.assertNotNull(entry); |
| | | |
| | | Assert.assertEquals(entry.getDN(), DN |
| | | Assert.assertEquals(entry.getName(), DN |
| | | .valueOf("cn=john, dc=foo, dc=com")); |
| | | Assert.assertTrue(entry.hasObjectClass(OC_TOP)); |
| | | Assert.assertTrue(entry.hasObjectClass(OC_PERSON)); |
| | |
| | | |
| | | Assert.assertNotNull(entry); |
| | | |
| | | Assert.assertEquals(entry.getDN(), DN |
| | | Assert.assertEquals(entry.getName(), DN |
| | | .valueOf("cn=anne, dc=foo, dc=com")); |
| | | Assert.assertTrue(entry.hasObjectClass(OC_TOP)); |
| | | Assert.assertTrue(entry.hasObjectClass(OC_PERSON)); |
| | |
| | | Entry readEntry = reader.readEntry(); |
| | | reader.close(); |
| | | |
| | | Assert.assertEquals(readEntry.getDN(), entry.getDN()); |
| | | Assert.assertEquals(readEntry.getName(), entry.getName()); |
| | | } |
| | | |
| | | /** |
| | |
| | | reader.close(); |
| | | |
| | | Assert.assertTrue(add instanceof AddChangeRecordEntry); |
| | | Assert.assertEquals(add.getDN(), entry.getDN()); |
| | | Assert.assertEquals(add.getDN(), entry.getName()); |
| | | } |
| | | |
| | | /** |
| | |
| | | ldifWriter.writeDeleteChangeRecord(entry, false); |
| | | |
| | | String[] expectedLDIF = new String[] { |
| | | "dn: " + entry.getDN(), |
| | | "dn: " + entry.getName(), |
| | | "changetype: delete" |
| | | }; |
| | | |