Roy Golan has posted comments on this change.

Change subject: core: patterned pool names support
......................................................................


Patch Set 4: (2 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java
Line 61:     protected Map<Guid, List<DiskImage>> storageToDisksMap;
Line 62:     protected Map<Guid, StorageDomain> destStorages = new 
HashMap<Guid, StorageDomain>();
Line 63:     private boolean _addVmsSucceded = true;
Line 64: 
Line 65:     private static final Pattern PATTERNED_POOL_NAME_PATTERN = 
Pattern.compile("^.*?([" + VmPool.MASK_CHARACTER + "]+).*?$");
lets keep the commands clean with SRP. create a class for the name generator 
and it will be easily tested and reused.
Line 66: 
Line 67:     /**
Line 68:      * Constructor for command creation when compensation is applied 
on startup
Line 69:      * @param commandId


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/ValidationUtils.java
Line 35:     public static final String NULLABLE_MAC_ADDRESS = 
"^((\\d|([a-f]|[A-F])){2}:){5}(\\d|([a-f]|[A-F])){2}$|^$";
Line 36:     /** Invalid mac address (for now just checking 00:00:00:00:00:00 */
Line 37:     public static final String INVALID_NULLABLE_MAC_ADDRESS = 
"^(00:){5}00$";
Line 38:     /** the mask will be replaced with zero-padded number in the 
generated names of the VMs in the pool,
Line 39:      * see AddVmPoolWithVmsCommandTest#validateGenerateVmName and 
PoolNameValidationTest for valid and invalid expressions of this pattern */
some examples are needed for easy reading:

e.g 

 ABC???DEF = ABC001DEF
 ABC?? = ABC01
 ?A = 1A

and state whats the case for
 ?A? = 

and so on...
Line 40:     public static final String POOL_NAME_PATTERN = "^[\\p{L}0-9._-]+[" 
+ VmPool.MASK_CHARACTER + "]*[\\p{L}0-9._-]*$|^[\\p{L}0-9._-]*[" + 
VmPool.MASK_CHARACTER + "]*[\\p{L}0-9._-]+$";
Line 41: 
Line 42:     private static final Validator validator = 
Validation.buildDefaultValidatorFactory().getValidator();
Line 43: 


--
To view, visit http://gerrit.ovirt.org/11986
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I81a1ffb6324fb728b2584677dd654ac79b679cd8
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skriva...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to