protected void verifyPrecondition() throws CommandException, PreconditionException {
// if the action has been updated, quit this command
Timestamp actionCheckTs = new Timestamp(System.currentTimeMillis() - actionCheckDelay * 1000);
Timestamp cactionLmt = coordAction.getLastModifiedTimestamp();
if (cactionLmt.after(actionCheckTs)) {
throw new PreconditionException(ErrorCode.E1100, "The coord action :" + actionId
+ " has been udated. Ignore CoordActionCheckCommand!");
}
if (coordAction.getStatus().equals(CoordinatorAction.Status.SUCCEEDED)
|| coordAction.getStatus().equals(CoordinatorAction.Status.FAILED)
|| coordAction.getStatus().equals(CoordinatorAction.Status.KILLED)) {
throw new PreconditionException(ErrorCode.E1100, "The coord action [" + actionId + "] must not have status "
+ CoordinatorAction.Status.SUCCEEDED.name() + ", " + CoordinatorAction.Status.FAILED.name()
+ ", or " + CoordinatorAction.Status.KILLED.name() + " but has status [" + coordAction.getStatus().name()
+ "]");
}
}