| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2006 Sun Microsystems, Inc. |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.core; |
| | | |
| | |
| | | |
| | | 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.messages.CoreMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | |
| | |
| | | extends Operation |
| | | implements PreParseAbandonOperation, PostOperationAbandonOperation |
| | | { |
| | | /** |
| | | * The fully-qualified name of this class for debugging purposes. |
| | | */ |
| | | private static final String CLASS_NAME = |
| | | "org.opends.server.core.AbandonOperation"; |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | super(clientConnection, operationID, messageID, requestControls); |
| | | |
| | | assert debugConstructor(CLASS_NAME, String.valueOf(clientConnection), |
| | | String.valueOf(operationID), |
| | | String.valueOf(messageID), |
| | | String.valueOf(requestControls), |
| | | String.valueOf(idToAbandon)); |
| | | |
| | | this.idToAbandon = idToAbandon; |
| | | } |
| | |
| | | */ |
| | | public final int getIDToAbandon() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getIDToAbandon"); |
| | | |
| | | return idToAbandon; |
| | | } |
| | |
| | | @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 OperationType getOperationType() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getOperationType"); |
| | | |
| | | // Note that no debugging will be done in this method because it is a likely |
| | | // candidate for being called by the logging subsystem. |
| | |
| | | @Override() |
| | | public final String[][] getRequestLogElements() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getRequestLogElements"); |
| | | |
| | | // Note that no debugging will be done in this method because it is a likely |
| | | // candidate for being called by the logging subsystem. |
| | |
| | | @Override() |
| | | public final List<Control> getResponseControls() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getResponseControls"); |
| | | |
| | | // An abandon operation can never have a response, so just return an empty |
| | | // list. |
| | |
| | | @Override() |
| | | public final void run() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "run"); |
| | | |
| | | setResultCode(ResultCode.UNDEFINED); |
| | | |
| | |
| | | @Override() |
| | | public final CancelResult cancel(CancelRequest cancelRequest) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "cancel", String.valueOf(cancelRequest)); |
| | | |
| | | cancelRequest.addResponseMessage(getMessage(MSGID_CANNOT_CANCEL_ABANDON)); |
| | | return CancelResult.CANNOT_CANCEL; |
| | |
| | | @Override() |
| | | public final CancelRequest getCancelRequest() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getCancelRequest"); |
| | | |
| | | return null; |
| | | } |
| | |
| | | @Override() |
| | | boolean setCancelRequest(CancelRequest cancelRequest) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "setCancelRequest", |
| | | String.valueOf(cancelRequest)); |
| | | |
| | | // Abandon operations cannot be canceled. |
| | | return false; |
| | |
| | | @Override() |
| | | public final void toString(StringBuilder buffer) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "toString", "java.lang.StringBuilder"); |
| | | |
| | | buffer.append("AbandonOperation(connID="); |
| | | buffer.append(clientConnection.getConnectionID()); |