| | |
| | | |
| | | import static org.opends.server.core.CoreConstants.*; |
| | | import static org.opends.server.loggers.Access.*; |
| | | import static org.opends.server.loggers.Debug.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugCought; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugEnabled; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.messages.CoreMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | |
| | | implements PreParseCompareOperation, PreOperationCompareOperation, |
| | | PostOperationCompareOperation, PostResponseCompareOperation |
| | | { |
| | | /** |
| | | * The fully-qualified name of this class for debugging purposes. |
| | | */ |
| | | private static final String CLASS_NAME = |
| | | "org.opends.server.core.CompareOperation"; |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | super(clientConnection, operationID, messageID, requestControls); |
| | | |
| | | assert debugConstructor(CLASS_NAME, |
| | | new String[] |
| | | { |
| | | String.valueOf(clientConnection), |
| | | String.valueOf(operationID), |
| | | String.valueOf(messageID), |
| | | String.valueOf(requestControls), |
| | | String.valueOf(rawEntryDN), |
| | | String.valueOf(rawAttributeType), |
| | | String.valueOf(assertionValue) |
| | | }); |
| | | |
| | | this.rawEntryDN = rawEntryDN; |
| | | this.rawAttributeType = rawAttributeType; |
| | |
| | | { |
| | | super(clientConnection, operationID, messageID, requestControls); |
| | | |
| | | assert debugConstructor(CLASS_NAME, |
| | | new String[] |
| | | { |
| | | String.valueOf(clientConnection), |
| | | String.valueOf(operationID), |
| | | String.valueOf(messageID), |
| | | String.valueOf(requestControls), |
| | | String.valueOf(entryDN), |
| | | String.valueOf(attributeType), |
| | | String.valueOf(assertionValue) |
| | | }); |
| | | |
| | | this.entryDN = entryDN; |
| | | this.attributeType = attributeType; |
| | |
| | | */ |
| | | public final ByteString getRawEntryDN() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getRawEntryDN"); |
| | | |
| | | return rawEntryDN; |
| | | } |
| | |
| | | */ |
| | | public final void setRawEntryDN(ByteString rawEntryDN) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "setRawEntryDN"); |
| | | |
| | | this.rawEntryDN = rawEntryDN; |
| | | |
| | |
| | | */ |
| | | public final DN getEntryDN() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getEntryDN"); |
| | | |
| | | return entryDN; |
| | | } |
| | |
| | | */ |
| | | public final String getRawAttributeType() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getRawAttributeType"); |
| | | |
| | | return rawAttributeType; |
| | | } |
| | |
| | | */ |
| | | public final void setRawAttributeType(String rawAttributeType) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "setRawAttributeType", |
| | | String.valueOf(rawAttributeType)); |
| | | |
| | | this.rawAttributeType = rawAttributeType; |
| | | |
| | |
| | | */ |
| | | public final AttributeType getAttributeType() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getAttributeType"); |
| | | |
| | | return attributeType; |
| | | } |
| | |
| | | */ |
| | | public final ByteString getAssertionValue() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getAssertionValue"); |
| | | |
| | | return assertionValue; |
| | | } |
| | |
| | | */ |
| | | public final void setAssertionValue(ByteString assertionValue) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "setAssertionValue", |
| | | String.valueOf(assertionValue)); |
| | | |
| | | this.assertionValue = assertionValue; |
| | | } |
| | |
| | | */ |
| | | public final Entry getEntryToCompare() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getEntryToCompare"); |
| | | |
| | | return entry; |
| | | } |
| | |
| | | @Override() |
| | | public final long getProcessingStartTime() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getProcessingStartTime"); |
| | | |
| | | return processingStartTime; |
| | | } |
| | |
| | | @Override() |
| | | public final long getProcessingStopTime() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getProcessingStopTime"); |
| | | |
| | | return processingStopTime; |
| | | } |
| | |
| | | @Override() |
| | | public final long getProcessingTime() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getProcessingTime"); |
| | | |
| | | return (processingStopTime - processingStartTime); |
| | | } |
| | |
| | | @Override() |
| | | public final List<Control> getResponseControls() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getResponseControls"); |
| | | |
| | | return responseControls; |
| | | } |
| | |
| | | @Override() |
| | | public final void run() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "run"); |
| | | |
| | | setResultCode(ResultCode.UNDEFINED); |
| | | |
| | |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | assert debugException(CLASS_NAME, "run", de); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, de); |
| | | } |
| | | |
| | | setResultCode(de.getResultCode()); |
| | | appendErrorMessage(de.getErrorMessage()); |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "run", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | break; |
| | | } |
| | | |
| | |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | assert debugException(CLASS_NAME, "run", de); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, de); |
| | | } |
| | | |
| | | setResultCode(de.getResultCode()); |
| | | appendErrorMessage(de.getErrorMessage()); |
| | |
| | | } |
| | | catch (LDAPException le) |
| | | { |
| | | assert debugException(CLASS_NAME, "run", le); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, le); |
| | | } |
| | | |
| | | setResultCode(ResultCode.valueOf(le.getResultCode())); |
| | | appendErrorMessage(le.getMessage()); |
| | |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | assert debugException(CLASS_NAME, "run", de); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, de); |
| | | } |
| | | |
| | | setResultCode(ResultCode.PROTOCOL_ERROR); |
| | | |
| | |
| | | } |
| | | catch (LDAPException le) |
| | | { |
| | | assert debugException(CLASS_NAME, "run", le); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, le); |
| | | } |
| | | |
| | | setResultCode(ResultCode.valueOf(le.getResultCode())); |
| | | appendErrorMessage(le.getMessage()); |
| | |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | assert debugException(CLASS_NAME, "run", de); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, de); |
| | | } |
| | | |
| | | setResultCode(de.getResultCode()); |
| | | appendErrorMessage(de.getErrorMessage()); |
| | |
| | | } |
| | | catch (LDAPException le) |
| | | { |
| | | assert debugException(CLASS_NAME, "run", le); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, le); |
| | | } |
| | | |
| | | setResultCode(ResultCode.valueOf(le.getResultCode())); |
| | | appendErrorMessage(le.getMessage()); |
| | |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | assert debugException(CLASS_NAME, "run", de); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, de); |
| | | } |
| | | |
| | | setResultCode(de.getResultCode()); |
| | | appendErrorMessage(de.getErrorMessage()); |
| | |
| | | @Override() |
| | | public final CancelResult cancel(CancelRequest cancelRequest) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "cancel", String.valueOf(cancelRequest)); |
| | | |
| | | this.cancelRequest = cancelRequest; |
| | | |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "cancel", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |
| | | cancelResult = getCancelResult(); |
| | |
| | | @Override() |
| | | public final CancelRequest getCancelRequest() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getCancelRequest"); |
| | | |
| | | return cancelRequest; |
| | | } |
| | |
| | | @Override() |
| | | boolean setCancelRequest(CancelRequest cancelRequest) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "setCancelRequest", |
| | | String.valueOf(cancelRequest)); |
| | | |
| | | this.cancelRequest = cancelRequest; |
| | | return true; |
| | |
| | | @Override() |
| | | public final void toString(StringBuilder buffer) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "toString", "java.lang.StringBuilder"); |
| | | |
| | | buffer.append("CompareOperation(connID="); |
| | | buffer.append(clientConnection.getConnectionID()); |