Yair Zaslavsky has posted comments on this change.
Change subject: core: Adding AddExternalJobCommand command
......................................................................
Patch Set 3: (3 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddExternalJobCommand.java
Line 20: public class AddExternalJobCommand<T extends AddExternalJobParameters>
extends CommandBase<T> {
Line 21: /**
Line 22: *
Line 23: */
Line 24: private static final long serialVersionUID = 1L;
I think that adding the external job itself should not be a monitored command,
am I mistaken here?
Line 25:
Line 26: public AddExternalJobCommand(T parameters) {
Line 27: super(parameters);
Line 28: }
Line 30:
Line 31: @Override
Line 32: protected boolean canDoAction() {
Line 33: boolean retValue = true;
Line 34: if (getParameters().getDescription().trim().length()==0) {
StringUtils.isEmpty ?
Line 35:
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_EMPTY_DESCRIPTION);
Line 36: retValue = false;
Line 37: }
Line 38: return retValue;
Line 46: job.setAutoCleared(getParameters().isAutoCleared());
Line 47: Guid id = job.getId();
Line 48: job.setExternal(true);
Line 49: JobRepositoryFactory.getJobRepository().saveJob(job);
Line 50: if (DbFacade.getInstance().getJobDao().get(id) != null) {
For mocking (even if not now) purposes I would rather have a getJobDao() method
instead of explicit singleton call here.
Line 51: setActionReturnValue(id);
Line 52: setSucceeded(true);
Line 53: }
Line 54: else {
--
To view, visit http://gerrit.ovirt.org/15226
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Id1b95a094dc586e6ebbdacd44e0a034e91604386
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches