| | |
| | | import org.opends.server.protocols.asn1.ASN1Element; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.protocols.asn1.ASN1Sequence; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugCaught; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugEnabled; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.LDAPException; |
| | | import org.opends.server.types.RawModification; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.messages.ProtocolMessages.*; |
| | | import static org.opends.server.protocols.ldap.LDAPConstants.*; |
| | |
| | | public class ModifyRequestProtocolOp |
| | | extends ProtocolOp |
| | | { |
| | | |
| | | |
| | | |
| | | // The set of modifications for this modify request. |
| | | private ArrayList<LDAPModification> modifications; |
| | | private ArrayList<RawModification> modifications; |
| | | |
| | | // The DN for this modify request. |
| | | private ASN1OctetString dn; |
| | |
| | | public ModifyRequestProtocolOp(ASN1OctetString dn) |
| | | { |
| | | this.dn = dn; |
| | | this.modifications = new ArrayList<LDAPModification>(); |
| | | this.modifications = new ArrayList<RawModification>(); |
| | | } |
| | | |
| | | |
| | |
| | | * @param modifications The set of modifications for this modify request. |
| | | */ |
| | | public ModifyRequestProtocolOp(ASN1OctetString dn, |
| | | ArrayList<LDAPModification> modifications) |
| | | ArrayList<RawModification> modifications) |
| | | { |
| | | this.dn = dn; |
| | | |
| | | if (modifications == null) |
| | | { |
| | | this.modifications = new ArrayList<LDAPModification>(); |
| | | this.modifications = new ArrayList<RawModification>(); |
| | | } |
| | | else |
| | | { |
| | |
| | | * |
| | | * @return The set of modifications for this modify request. |
| | | */ |
| | | public ArrayList<LDAPModification> getModifications() |
| | | public ArrayList<RawModification> getModifications() |
| | | { |
| | | return modifications; |
| | | } |
| | |
| | | |
| | | ArrayList<ASN1Element> modElements = |
| | | new ArrayList<ASN1Element>(modifications.size()); |
| | | for (LDAPModification mod : modifications) |
| | | for (RawModification mod : modifications) |
| | | { |
| | | modElements.add(mod.encode()); |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | ArrayList<LDAPModification> modifications; |
| | | ArrayList<RawModification> modifications; |
| | | try |
| | | { |
| | | ArrayList<ASN1Element> modElements = |
| | | elements.get(1).decodeAsSequence().elements(); |
| | | modifications = new ArrayList<LDAPModification>(modElements.size()); |
| | | modifications = new ArrayList<RawModification>(modElements.size()); |
| | | for (ASN1Element e : modElements) |
| | | { |
| | | modifications.add(LDAPModification.decode(e)); |
| | |
| | | |
| | | if (! modifications.isEmpty()) |
| | | { |
| | | Iterator<LDAPModification> iterator = modifications.iterator(); |
| | | Iterator<RawModification> iterator = modifications.iterator(); |
| | | iterator.next().toString(buffer); |
| | | |
| | | while (iterator.hasNext()) |
| | |
| | | buffer.append(" Modifications:"); |
| | | buffer.append(EOL); |
| | | |
| | | for (LDAPModification mod : modifications) |
| | | for (RawModification mod : modifications) |
| | | { |
| | | mod.toString(buffer, indent+4); |
| | | } |