private void recordEvent(Fixture fixture) { String message = null; if (fixture.getTaskExecutionStatus() == TaskExecutionStatus.SUCCESS) { message = "Successfully executed task " + result.getTaskType() + " for fixture " + fixture.getDisplayName(); } else { message = "Failure executing task " + result.getTaskType() + " for fixture " + fixture.getDisplayName() + ", message: " + ((result.getExceptionMessage() == null) ? result.getExceptionMessage() : "(no message)"); } eventLogService.logEvent( "Task Execution", fixture.getIpAddress(), ((fixture.getAsset() != null) ? fixture.getAsset().getMacAddress() : null), message); }
/** {@inheritDoc} */ @Override protected void onValidate() throws Exception { super.onValidate(); Assert.notNull(result, "Task result is required."); Assert.notNull(result.getFixture(), "Task result must have a fixture"); }