public final class ThreadManager extends Object
Modifier and Type | Field and Description |
---|---|
protected PSSession |
_session
The user connecting to the server.
|
static int |
DEFAULT_THREAD_DELAY_SECONDS
Default thread delay in seconds
|
static int |
DEFAULT_THREAD_TIMEOUT_SECONDS
Default thread timeout in seconds
|
Constructor and Description |
---|
ThreadManager(PSSession session) |
Modifier and Type | Method and Description |
---|---|
PSThreadStatus |
checkProgress(PSThreadStatus status)
Check the progress of a process thread defined by the status provided.
|
PSThreadStatus |
completeThread(PSThreadStatus currentStatus)
Wait for a thread to complete.
|
PSThreadStatus |
completeThread(PSThreadStatus currentStatus,
int delay,
int timeout)
Wait for a thread to complete.
|
PSSession |
session() |
public static final int DEFAULT_THREAD_DELAY_SECONDS
public static final int DEFAULT_THREAD_TIMEOUT_SECONDS
protected final PSSession _session
public ThreadManager(PSSession session)
session
- the session to use for PS connectionspublic PSThreadStatus checkProgress(PSThreadStatus status) throws APIException
status
- the current statusAPIException
- If connecting to PageSeeder failedpublic PSThreadStatus completeThread(PSThreadStatus currentStatus) throws APIException
currentStatus
- the current status of the threadAPIException
- if there was an error polling the thread or the timeout was triggeredpublic PSThreadStatus completeThread(PSThreadStatus currentStatus, int delay, int timeout) throws APIException
currentStatus
- the current status of the threaddelay
- the delay between each thread progress polltimeout
- the timeout for the thread completionAPIException
- if there was an error polling the thread or the timeout was triggeredpublic PSSession session()
Copyright © 2016 Allette Systems. All rights reserved.