| | |
| | | import org.opends.server.schema.UserPasswordSyntax; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.protocols.ldap.LDAPAttribute; |
| | | import org.opends.server.protocols.ldap.LDAPException; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.AttributeValue; |
| | |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.ErrorLogCategory; |
| | | import org.opends.server.types.ErrorLogSeverity; |
| | | import org.opends.server.types.LDAPException; |
| | | import org.opends.server.types.LockManager; |
| | | import org.opends.server.types.ObjectClass; |
| | | import org.opends.server.types.Operation; |
| | | import org.opends.server.types.OperationType; |
| | | import org.opends.server.types.Privilege; |
| | | import org.opends.server.types.RawAttribute; |
| | | import org.opends.server.types.RDN; |
| | | import org.opends.server.types.ResultCode; |
| | | import org.opends.server.types.SearchFilter; |
| | |
| | | implements PreParseAddOperation, PreOperationAddOperation, |
| | | PostOperationAddOperation, PostResponseAddOperation |
| | | { |
| | | |
| | | |
| | | |
| | | // The set of response controls to send to the client. |
| | | private ArrayList<Control> responseControls; |
| | | |
| | |
| | | // The set of attributes (including the objectclass attribute) in a raw, |
| | | // unprocessed form as provided in the request. One or more of these |
| | | // attributes may be invalid. |
| | | private List<LDAPAttribute> rawAttributes; |
| | | private List<RawAttribute> rawAttributes; |
| | | |
| | | // The set of operational attributes for the entry to add. |
| | | private Map<AttributeType,List<Attribute>> operationalAttributes; |
| | |
| | | */ |
| | | public AddOperation(ClientConnection clientConnection, long operationID, |
| | | int messageID, List<Control> requestControls, |
| | | ByteString rawEntryDN, List<LDAPAttribute> rawAttributes) |
| | | ByteString rawEntryDN, List<RawAttribute> rawAttributes) |
| | | { |
| | | super(clientConnection, operationID, messageID, requestControls); |
| | | |
| | |
| | | |
| | | rawEntryDN = new ASN1OctetString(entryDN.toString()); |
| | | |
| | | rawAttributes = new ArrayList<LDAPAttribute>(); |
| | | rawAttributes = new ArrayList<RawAttribute>(); |
| | | |
| | | ArrayList<ASN1OctetString> ocValues = new ArrayList<ASN1OctetString>(); |
| | | for (String s : objectClasses.values()) |
| | |
| | | * @return The set of attributes in their raw, unparsed form as read from the |
| | | * client request. |
| | | */ |
| | | public final List<LDAPAttribute> getRawAttributes() |
| | | public final List<RawAttribute> getRawAttributes() |
| | | { |
| | | return rawAttributes; |
| | | } |
| | |
| | | * @param rawAttribute The attribute to add to the set of raw attributes for |
| | | * this add operation. |
| | | */ |
| | | public final void addRawAttribute(LDAPAttribute rawAttribute) |
| | | public final void addRawAttribute(RawAttribute rawAttribute) |
| | | { |
| | | rawAttributes.add(rawAttribute); |
| | | |
| | |
| | | * |
| | | * @param rawAttributes The set of raw attributes for this add operation. |
| | | */ |
| | | public final void setRawAttributes(List<LDAPAttribute> rawAttributes) |
| | | public final void setRawAttributes(List<RawAttribute> rawAttributes) |
| | | { |
| | | this.rawAttributes = rawAttributes; |
| | | |
| | |
| | | objectClasses = new HashMap<ObjectClass,String>(); |
| | | userAttributes = new HashMap<AttributeType,List<Attribute>>(); |
| | | operationalAttributes = new HashMap<AttributeType,List<Attribute>>(); |
| | | for (LDAPAttribute a : rawAttributes) |
| | | for (RawAttribute a : rawAttributes) |
| | | { |
| | | try |
| | | { |
| | |
| | | ErrorLogSeverity.SEVERE_ERROR, |
| | | MSGID_ADD_SYNCH_CONFLICT_RESOLUTION_FAILED, |
| | | getConnectionID(), getOperationID(), |
| | | stackTraceToSingleLineString(de)); |
| | | getExceptionMessage(de)); |
| | | |
| | | setResponseData(de); |
| | | break addProcessing; |
| | |
| | | logError(ErrorLogCategory.SYNCHRONIZATION, |
| | | ErrorLogSeverity.SEVERE_ERROR, |
| | | MSGID_ADD_SYNCH_PREOP_FAILED, getConnectionID(), |
| | | getOperationID(), stackTraceToSingleLineString(de)); |
| | | getOperationID(), getExceptionMessage(de)); |
| | | |
| | | setResponseData(de); |
| | | break addProcessing; |
| | |
| | | logError(ErrorLogCategory.SYNCHRONIZATION, |
| | | ErrorLogSeverity.SEVERE_ERROR, |
| | | MSGID_ADD_SYNCH_POSTOP_FAILED, getConnectionID(), |
| | | getOperationID(), stackTraceToSingleLineString(de)); |
| | | getOperationID(), getExceptionMessage(de)); |
| | | |
| | | setResponseData(de); |
| | | break; |
| | |
| | | } |
| | | |
| | | int msgID = MSGID_ADD_ERROR_NOTIFYING_CHANGE_LISTENER; |
| | | String message = getMessage(msgID, stackTraceToSingleLineString(e)); |
| | | String message = getMessage(msgID, getExceptionMessage(e)); |
| | | logError(ErrorLogCategory.CORE_SERVER, ErrorLogSeverity.SEVERE_ERROR, |
| | | message, msgID); |
| | | } |
| | |
| | | |
| | | int msgID = MSGID_ADD_ERROR_NOTIFYING_PERSISTENT_SEARCH; |
| | | String message = getMessage(msgID, String.valueOf(persistentSearch), |
| | | stackTraceToSingleLineString(e)); |
| | | getExceptionMessage(e)); |
| | | logError(ErrorLogCategory.CORE_SERVER, ErrorLogSeverity.SEVERE_ERROR, |
| | | message, msgID); |
| | | |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | boolean setCancelRequest(CancelRequest cancelRequest) |
| | | protected boolean setCancelRequest(CancelRequest cancelRequest) |
| | | { |
| | | this.cancelRequest = cancelRequest; |
| | | return true; |