public class ValidationManager extends Object
MessageSender
using a set of MessageValidator
instances.Constructor and Description |
---|
ValidationManager()
Creates a new validator manager.
|
Modifier and Type | Method and Description |
---|---|
void |
addValidator(String validatorId,
MessageValidator messageValidator)
Adds a new message validator.
|
MessageValidator |
getValidator(String validatorId)
Gets the validator with the given id.
|
List<MessageValidator> |
getValidators(List<String> validatorIds)
Get all the validators requested in the list of ids.
|
boolean |
isAllMessagesValid() |
boolean |
isEnabled()
Is validation facility enabled?
|
boolean |
isFastForward()
Determines whether the validation process is performed in a fast forward mode.
|
boolean |
isFinished()
Determines whether the validation process finished already.
|
int |
messagesToBeValidated()
Gets the number of messages that needs to be validated.
|
void |
setEnabled(boolean enabled)
Enables/disables validation.
|
void |
setFastForward(boolean fastForward)
Enables/disables the fast forward mode of the validation.
|
void |
setQueueFile(File queueFile)
Sets a different location of the file queue for storing message responses.
|
void |
startValidation()
Starts the validation process.
|
void |
submitValidationTask(ValidationTask validationTask)
Submits a new validation task.
|
void |
terminateNow()
Interrupts the validator thread immediately.
|
void |
waitForValidation()
Wait for the validation to be finished.
|
public ValidationManager() throws PerfCakeException
PerfCakeException
- When it was not possible to initialize the message store.public void setQueueFile(File queueFile) throws PerfCakeException
queueFile
- The new location of the file queue.PerfCakeException
- When it was not possible to initialize the file queue or there is a running validation.public void addValidator(String validatorId, MessageValidator messageValidator)
validatorId
- A string id of the new validator.messageValidator
- A validator instance.public MessageValidator getValidator(String validatorId)
validatorId
- A string id of the validator.public List<MessageValidator> getValidators(List<String> validatorIds)
validatorIds
- A list of ids of validators to be returned.public void startValidation()
public void waitForValidation() throws InterruptedException
InterruptedException
- If the validator thread was interrupted.public void terminateNow()
public void submitValidationTask(ValidationTask validationTask)
validationTask
- The new validation task to be processed.public int messagesToBeValidated()
public boolean isEnabled()
true
if validation is enabled.public void setEnabled(boolean enabled)
enabled
- Specifies whether we want the validation to be enabled.public boolean isFinished()
true
if the validation finished or was not started yet.public boolean isFastForward()
Unless specified in the scenario, the validation thread has some sleep for it not to influence measurement. At the end, when there is nothing else to do, we can go through the remaining responses faster.
The fast forward mode removes the sleep.
true
if the sleep period is disabled.public void setFastForward(boolean fastForward)
fastForward
- true
to enable the fast forward mode.public boolean isAllMessagesValid()
Copyright © 2010–2017 PerfCake Community. All rights reserved.