001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at
010 * docs/licenses/cddl.txt
011 * or http://www.opensource.org/licenses/cddl1.php.
012 * See the License for the specific language governing permissions
013 * and limitations under the License.
014 *
015 * When distributing Covered Code, include this CDDL HEADER in each
016 * file and include the License file at
017 * docs/licenses/cddl.txt.  If applicable,
018 * add the following below this CDDL HEADER, with the fields enclosed
019 * by brackets "[]" replaced with your own identifying information:
020 *      Portions Copyright [yyyy] [name of copyright owner]
021 *
022 * CDDL HEADER END
023 *
024 *
025 *      Copyright 2010-2017 Ping Identity Corporation
026 */
027package com.unboundid.directory.sdk.common.types;
028
029
030
031import com.unboundid.directory.sdk.common.operation.GenericResult;
032import com.unboundid.util.NotExtensible;
033import com.unboundid.util.ThreadSafety;
034import com.unboundid.util.ThreadSafetyLevel;
035
036
037
038/**
039 * This interface defines a set of methods that may be used to obtain
040 * information about an operation for which processing has been completed.
041 */
042@NotExtensible()
043@ThreadSafety(level=ThreadSafetyLevel.INTERFACE_NOT_THREADSAFE)
044public interface CompletedOperationContext
045       extends OperationContext
046{
047  /**
048   * Retrieves the time that the operation was added to the work queue, if
049   * available.    The value returned will be an offset in milliseconds since
050   * 12:00 a.m. on January 1, 1970.
051   *
052   * @return  The time that the operation was added to the work queue, or -1 if
053   *          the enqueue time is not available.
054   */
055  long getEnqueueTime();
056
057
058
059  /**
060   * Retrieves the time that the operation was removed from the work queue, if
061   * available.    The value returned will be an offset in milliseconds since
062   * 12:00 a.m. on January 1, 1970.
063   *
064   * @return  The time that the operation was removed form the work queue, or -1
065   *          if the dequeue time is not available.
066   */
067  long getDequeueTime();
068
069
070
071  /**
072   * Retrieves the length of time in milliseconds that the operation was held in
073   * the work queue before being picked up for processing by a worker thread.
074   *
075   * @return  The length of time in milliseconds that the operation was held in
076   *          the work queue, or -1 if the queue wait time is not available.
077   */
078  long getQueueWaitTimeMillis();
079
080
081
082  /**
083   * Retrieves the time that the worker thread began processing the operation.
084   * The value returned will be an offset in milliseconds since 12:00 a.m. on
085   * January 1, 1970.
086   *
087   * @return  The time that the worker thread began processing the operation.
088   */
089  long getProcessingStartTime();
090
091
092
093  /**
094   * Retrieves the time that the worker thread completed processing for the
095   * operation.  The value returned will be an offset in milliseconds since
096   * 12:00 a.m. on January 1, 1970.
097   *
098   * @return  The time that the worker thread completed processing for the
099   *          operation.
100   */
101  long getProcessingEndTime();
102
103
104
105  /**
106   * Retrieves the length of time in milliseconds that the worker thread spent
107   * processing the operation.
108   *
109   * @return  The length of time in milliseconds that the worker thread spent
110   *          processing the operation.
111   */
112  long getProcessingTimeMillis();
113
114
115
116  /**
117   * Retrieves the length of time in nanoseconds that the worker thread spent
118   * processing the operation.
119   *
120   * @return  The length of time in nanoseconds that the worker thread spent
121   *          processing the operation.
122   */
123  long getProcessingTimeNanos();
124
125
126
127  /**
128   * Retrieves information about the result of the operation processing.
129   *
130   * @return  Information about the result of the operation processing.
131   */
132  GenericResult getResult();
133}