public abstract class ConeErrorPolicy
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
static ConeErrorPolicy |
ABORT |
An error during a cone search results in a failure of the task.
|
static ConeErrorPolicy |
IGNORE |
Errors during cone searches are treated as if the search had
returned with no results.
|
static ConeErrorPolicy |
RETRY |
If an error occurs during a cone search it is retried until a non-error
result is obtained.
|
Modifier | Constructor | Description |
---|---|---|
protected |
ConeErrorPolicy(java.lang.String name) |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
static ConeErrorPolicy |
createAdviceAbortPolicy(java.lang.String name,
java.lang.String extraAdvice) |
Returns a policy like
ABORT , except that if an error occurs,
the IOException thrown is populated with some custom text. |
static ConeErrorPolicy |
createRetryPolicy(java.lang.String name,
int nTry) |
Constructs an error policy which will retry the search a fixed
number of times.
|
abstract uk.ac.starlink.table.StarTable |
performConeSearch(ConeSearcher cs,
double ra,
double dec,
double sr) |
Uses the given cone searcher object to perform an actual cone search.
|
java.lang.String |
toString() |
Returns this object's name.
|
public static final ConeErrorPolicy ABORT
public static final ConeErrorPolicy IGNORE
public static final ConeErrorPolicy RETRY
protected ConeErrorPolicy(java.lang.String name)
name
- policy namepublic java.lang.String toString()
toString
in class java.lang.Object
public abstract uk.ac.starlink.table.StarTable performConeSearch(ConeSearcher cs, double ra, double dec, double sr) throws java.io.IOException, java.lang.InterruptedException
performSearch
method.
Implementations are expected to check for thread interruption status and throw an InterruptedException if interruption has happened. They should do this in such a way that the cone search query is not performed (especially multiple times) following an interruption.
cs
- cone searcher providing basic cone search capabilitiesra
- right ascension in degrees of search region centredec
- declination in degrees of search region centresr
- search radius in degreesjava.io.IOException
- if an IO error occursjava.lang.InterruptedException
- if the thread was interruptedConeSearcher.performSearch(double, double, double)
public static ConeErrorPolicy createRetryPolicy(java.lang.String name, int nTry)
name
- policy namenTry
- maximum number of attempts;
if <=0 will retry indefinitelypublic static ConeErrorPolicy createAdviceAbortPolicy(java.lang.String name, java.lang.String extraAdvice)
ABORT
, except that if an error occurs,
the IOException thrown is populated with some custom text.name
- policy nameextraAdvice
- advice to user in case of cone search failureCopyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.