public class OptionsImpl extends Object implements Options
DEFAULT_FORMAT_ASK, DEFAULT_FORMAT_GRAPH, DEFAULT_FORMAT_SELECT, DEFAULT_HALT_BEHAVIOUR, DEFAULT_LIMIT, DEFAULT_MAX_DELAY, DEFAULT_PARALLEL_THREADS, DEFAULT_SANITY_CHECKS, DEFAULT_TIMEOUT
Constructor and Description |
---|
OptionsImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(ProgressListener listener)
Adds a Progress Listener if it is not already registered
|
<T extends Options> |
copy()
Makes a copy of the options
|
protected void |
copyStandardOptions(OptionsImpl copy)
Copies standard options across from this instance
|
boolean |
getAllowCompression()
Gets whether the client will allow the server to return Deflate/GZip
compressed responses
|
HttpAuthenticator |
getAuthenticator()
Gets the HTTP authenticator in use
|
String |
getCustomEndpoint(String name)
Gets a custom endpoint
|
Map<String,String> |
getCustomEndpoints()
Gets an unmodifiable copy of the defined custom endpoints
|
Map<String,Object> |
getCustomSettings()
Gets a map that may be used to get/set custom settings
|
Dataset |
getDataset()
Gets a dataset that is used for in-memory queries and updates
|
boolean |
getEnsureAbsoluteURIs()
Gets whether the API should ensure that relative URIs are presented as
absolute URIs to services the harness interacts with
|
ExecutorService |
getExecutor()
Gets the in-use executor for running queries and query mixes in threads
using the Java concurrent framework
|
long |
getGlobalOrder()
Gets the Global Run Order
|
String |
getGraphStoreEndpoint()
Gets the SPARQL graph store protocol endpoint that is in use
|
boolean |
getHaltAny()
Gets Halt on Any behavior
|
HaltBehaviour |
getHaltBehaviour()
Gets the Halting Behaviour
|
boolean |
getHaltOnError()
Gets the Halt on Error behavior
|
boolean |
getHaltOnTimeout()
Gets the Halt on Timeout behavior
|
long |
getLimit()
Gets the LIMIT to impose on queries
|
List<ProgressListener> |
getListeners()
Gets the Progress Listeners registered
|
int |
getMaxDelay()
Gets the maximum delay between operations
|
OperationMixRunner |
getMixRunner()
Gets the operation mix runner to use, if
null is returned then
the default DefaultOperationMixRunner should be used |
boolean |
getNoCount()
Gets whether query results are counted or just thrown away
|
OperationMix |
getOperationMix()
Gets the Query Mix that is used
|
OperationRunner |
getOperationRunner()
Gets the operation runner to use, if
null is returned then the
default OperationRunner should be used |
int |
getParallelThreads()
Gets the number of parallel threads used for testing
|
String |
getQueryEndpoint()
Gets the SPARQL query endpoint that is in use
|
boolean |
getRandomizeOrder()
Gets whether operation order should be randomized
|
String |
getResultsAskFormat()
Gets the Results format used for operations that make ASK queries
|
String |
getResultsGraphFormat()
Gets the Results format used for operations that make CONSTRUCT/DESCRIBE
queries or that retrieve RDF graphs
|
String |
getResultsSelectFormat()
Gets the Results format used for operations that make SELECT queries
|
int |
getSanityCheckLevel()
Gets the Sanity Checking Level
|
OperationMix |
getSetupMix()
Gets the setup mix to be run,
null indicates no setup mix is
requested. |
OperationMix |
getTeardownMix()
Gets the tear down mix to be run,
null indicates no tear down mix
is requested. |
int |
getTimeout()
Gets the timeout for operations, a zero/negative value indicates no
timeout
|
String |
getUpdateEndpoint()
Gets the SPARQL Update endpoint that is in use
|
void |
removeListener(ProgressListener listener)
Removes a Progress Listener if it is registered
|
void |
resetGlobalOrder()
Resets the global run order
|
void |
setAllowCompression(boolean allowed)
Sets whether the client will allow the server to return Deflate/GZip
compressed responses
|
void |
setAuthenticator(HttpAuthenticator authenticator)
Sets the HTTP authenticator used
|
void |
setCustomEndpoint(String name,
String endpoint)
Sets a custom defined endpoint
|
void |
setDataset(Dataset dataset)
Sets a dataset to be used for in-memory queries and updates
|
void |
setEnsureAbsoluteURIs(boolean ensureAbsolute)
Sets whether the API should ensure that relative URIs are presented as
absolute URIs to services the harness interacts with
|
void |
setGraphStoreEndpoint(String endpoint)
Gets the SPARQL graph store protocol endpoint that is in use
|
void |
setHaltAny(boolean halt)
Sets Halt on Any behavior, if set to true sets Halt on Error and Halt on
Timeout to true as well
|
void |
setHaltBehaviour(HaltBehaviour behaviour)
Sets the Halting Behaviour
|
void |
setHaltOnError(boolean halt)
Sets the Halt on Error behavior
|
void |
setHaltOnTimeout(boolean halt)
Sets the Halt on Timeout behavior
|
void |
setLimit(long limit)
Sets the LIMIT to impose on queries
|
void |
setMaxDelay(int milliseconds)
Sets the maximum delay between operations
|
void |
setMixRunner(OperationMixRunner runner)
Sets the operation mix runner to use, if set to
null then the
default DefaultOperationMixRunner should be used |
void |
setNoCount(boolean noCount)
Sets whether query results are counted or just thrown away
|
void |
setOperationMix(OperationMix queries)
Sets the Query Mix to use
|
void |
setOperationRunner(OperationRunner runner)
Sets the operation runner to use, if set to
null then the default
DefaultOperationRunner should be used |
void |
setParallelThreads(int threads)
Sets the number of parallel threads used for testing
|
void |
setQueryEndpoint(String endpoint)
Sets the SPARQL query endpoint to be used
|
void |
setRandomizeOrder(boolean randomize)
Sets whether operation order should be randomized
|
void |
setResultsAskFormat(String contentType)
Sets the Results format to be used for operations that make ASK queries
|
void |
setResultsGraphFormat(String contentType)
Sets the Results format used for operations that CONSTRUCT/DESCRIBE
queries or that retrieve RDF graphs
|
void |
setResultsSelectFormat(String contentType)
Sets the Results format to be used for operations that make SELECT
queries
|
void |
setSanityCheckLevel(int level)
Sets the Sanity Checking level
|
void |
setSetupMix(OperationMix mix)
Sets the setup mix that will be run once before testing starts.
|
void |
setTeardownMix(OperationMix mix)
Sets the tear down mix that will be run once after testing completes
successfully.
|
void |
setTimeout(int timeout)
Sets the timeout for operations, a zero/negative value indicates no
timeout
|
void |
setUpdateEndpoint(String endpoint)
Sets the SPARQL update endpoint that is in use
|
public void addListener(ProgressListener listener)
Options
addListener
in interface Options
listener
- Progress Listenerpublic <T extends Options> T copy()
Options
While this is guaranteed to take a copy of primitive typed properties there is no guarantee that it takes a copy of reference types so changing some properties will still affect the original options. This method is primarily intended for use in cases where you need to tweak an option without interfering with other consumers of the options which is particularly relevant when running multi-threaded testing.
protected final void copyStandardOptions(OptionsImpl copy)
Primarily intended for use by derived implementations which extend the basic options to make it easier for them to create copies of themselves.
copy
- Copy to copy topublic boolean getAllowCompression()
Options
getAllowCompression
in interface Options
public HttpAuthenticator getAuthenticator()
Options
getAuthenticator
in interface Options
public String getCustomEndpoint(String name)
Options
getCustomEndpoint
in interface Options
name
- Endpoint namepublic Map<String,String> getCustomEndpoints()
Options
Custom endpoints are a more specific form of the
Options.getCustomSettings()
and provide a slightly more user friendly
and type safe interface when the custom setting to be defined has a
string value.
getCustomEndpoints
in interface Options
public Map<String,Object> getCustomSettings()
Options
This is provided so custom operations may be created that can share state
or that need custom settings to be provided and can't modify/extend the
standard Options
interface since they want to run with existing
standard runners.
getCustomSettings
in interface Options
public Dataset getDataset()
Options
getDataset
in interface Options
public boolean getEnsureAbsoluteURIs()
Options
getEnsureAbsoluteURIs
in interface Options
public ExecutorService getExecutor()
Options
getExecutor
in interface Options
public long getGlobalOrder()
Options
Called elsewhere so that mix runs and operation runs record what order they were run in
getGlobalOrder
in interface Options
public String getGraphStoreEndpoint()
Options
getGraphStoreEndpoint
in interface Options
public boolean getHaltAny()
Options
getHaltAny
in interface Options
public HaltBehaviour getHaltBehaviour()
Options
getHaltBehaviour
in interface Options
public boolean getHaltOnError()
Options
getHaltOnError
in interface Options
public boolean getHaltOnTimeout()
Options
getHaltOnTimeout
in interface Options
public long getLimit()
Options
public List<ProgressListener> getListeners()
Options
getListeners
in interface Options
public int getMaxDelay()
Options
getMaxDelay
in interface Options
public OperationMixRunner getMixRunner()
Options
null
is returned then
the default DefaultOperationMixRunner
should be usedgetMixRunner
in interface Options
public boolean getNoCount()
Options
getNoCount
in interface Options
public OperationMix getOperationMix()
Options
getOperationMix
in interface Options
public OperationRunner getOperationRunner()
Options
null
is returned then the
default OperationRunner
should be usedgetOperationRunner
in interface Options
public int getParallelThreads()
Options
getParallelThreads
in interface Options
public String getQueryEndpoint()
Options
getQueryEndpoint
in interface Options
public boolean getRandomizeOrder()
Options
getRandomizeOrder
in interface Options
public String getResultsAskFormat()
Options
getResultsAskFormat
in interface Options
public String getResultsGraphFormat()
Options
getResultsGraphFormat
in interface Options
public String getResultsSelectFormat()
Options
getResultsSelectFormat
in interface Options
public int getSanityCheckLevel()
Options
getSanityCheckLevel
in interface Options
public OperationMix getSetupMix()
Options
null
indicates no setup mix is
requested.
Operations in a setup mix are guaranteed to be run exactly in the order given. >
getSetupMix
in interface Options
public OperationMix getTeardownMix()
Options
null
indicates no tear down mix
is requested.
Operations in a tear down mix are guaranteed to be run exactly in the order given.
getTeardownMix
in interface Options
public int getTimeout()
Options
getTimeout
in interface Options
public String getUpdateEndpoint()
Options
getUpdateEndpoint
in interface Options
public void removeListener(ProgressListener listener)
Options
removeListener
in interface Options
listener
- Progress Listenerpublic void resetGlobalOrder()
Options
Useful for runners that incorporate warmups into their runs
resetGlobalOrder
in interface Options
public void setAllowCompression(boolean allowed)
Options
setAllowCompression
in interface Options
allowed
- Whether Deflate/GZip compression is allowedpublic void setAuthenticator(HttpAuthenticator authenticator)
Options
setAuthenticator
in interface Options
authenticator
- HTTP authenticatorpublic void setCustomEndpoint(String name, String endpoint)
Options
setCustomEndpoint
in interface Options
name
- Nameendpoint
- Endpoint URIpublic void setDataset(Dataset dataset)
Options
setDataset
in interface Options
dataset
- Datasetpublic void setEnsureAbsoluteURIs(boolean ensureAbsolute)
Options
setEnsureAbsoluteURIs
in interface Options
public void setGraphStoreEndpoint(String endpoint)
Options
setGraphStoreEndpoint
in interface Options
public void setHaltAny(boolean halt)
Options
setHaltAny
in interface Options
halt
- Whether any issue should cause benchmarking to abortpublic void setHaltBehaviour(HaltBehaviour behaviour)
Options
setHaltBehaviour
in interface Options
behaviour
- Halting Behaviourpublic void setHaltOnError(boolean halt)
Options
setHaltOnError
in interface Options
halt
- Whether an error should cause benchmarking to abortpublic void setHaltOnTimeout(boolean halt)
Options
setHaltOnTimeout
in interface Options
halt
- Whether a timeout should cause benchmarking to abortpublic void setLimit(long limit)
Options
Values less than or equal to zero mean existing limits are left unchanged, non-zero values will be imposed iff existing limit is greater than the set limit
public void setMaxDelay(int milliseconds)
Options
setMaxDelay
in interface Options
milliseconds
- Maximum Delay in millisecondspublic void setMixRunner(OperationMixRunner runner)
Options
null
then the
default DefaultOperationMixRunner
should be usedsetMixRunner
in interface Options
runner
- Operation mix runnerpublic void setNoCount(boolean noCount)
Options
Currently enabling this only applies to SELECT queries as only SELECT queries stream the results currently, future versions of this tool will also stream CONSTRUCT/DESCRIBE results but this is yet to be implemented
setNoCount
in interface Options
noCount
- Whether query results are countedpublic void setOperationMix(OperationMix queries)
Options
setOperationMix
in interface Options
queries
- Query Mixpublic void setOperationRunner(OperationRunner runner)
Options
null
then the default
DefaultOperationRunner
should be usedsetOperationRunner
in interface Options
runner
- Operation runnerpublic void setParallelThreads(int threads)
Options
setParallelThreads
in interface Options
threads
- Number of Parallel Threadspublic void setQueryEndpoint(String endpoint)
Options
setQueryEndpoint
in interface Options
endpoint
- SPARQL query endpoint URIpublic void setRandomizeOrder(boolean randomize)
Options
setRandomizeOrder
in interface Options
randomize
- Whether operation order should be randompublic void setResultsAskFormat(String contentType)
Options
setResultsAskFormat
in interface Options
contentType
- MIME Type for ASK resultspublic void setResultsGraphFormat(String contentType)
Options
setResultsGraphFormat
in interface Options
contentType
- MIME Type for CONSTRUCT/DESCRIBE results and RDF graphspublic void setResultsSelectFormat(String contentType)
Options
setResultsSelectFormat
in interface Options
contentType
- MIME Type for SELECT resultspublic void setSanityCheckLevel(int level)
Options
setSanityCheckLevel
in interface Options
level
- Sanity Check Levelpublic void setSetupMix(OperationMix mix)
Options
Operations in a setup mix are guaranteed to be run exactly in the order given. >
setSetupMix
in interface Options
mix
- Setup mixpublic void setTeardownMix(OperationMix mix)
Options
Operations in a tear down mix are guaranteed to be run exactly in the order given.
setTeardownMix
in interface Options
mix
- Tear down mixpublic void setTimeout(int timeout)
Options
setTimeout
in interface Options
timeout
- Timeout in secondspublic void setUpdateEndpoint(String endpoint)
Options
setUpdateEndpoint
in interface Options
endpoint
- SPARQL update endpoint URICopyright © 2015. All rights reserved.