blob: 42e20516f7c332f898037926df949ed0d47c1409 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.documentapi;
import com.yahoo.messagebus.Trace;
/**
* A session for tracking progress for and potentially receiving data from a visitor.
*
* @author Thomas Gundersen
*/
public interface VisitorSession extends VisitorControlSession {
/**
* Checks if visiting is done.
*
* @return True if visiting is done (either by error or success).
*/
boolean isDone();
/**
* Retrieves the last progress token gotten for this visitor.
*
* @return The progress token.
*/
ProgressToken getProgress();
/**
* Returns the tracing information so far about the visitor.
*
* @return Returns the trace.
*/
Trace getTrace();
/**
* Waits until visiting is done, or the given timeout (in ms) expires.
* Will wait forever if timeout is 0.
*
* @param timeoutMs The maximum amount of milliseconds to wait.
* @return True if visiting is done (either by error or success).
* @throws InterruptedException If an interrupt signal was received while waiting.
*/
boolean waitUntilDone(long timeoutMs) throws InterruptedException;
}
|