src/main/java/com/digitalglobe/util/maven/plugin/CloudFormationDeployMavenPlugin.java
/**
     * This function test to see if the current region condition is satisfied and the current region exclusion is not satisfied.
     * If the current region mapping and exclusion are null, then it is assumed that there are no region restrictions and the mapping
     * is allowed.  A validRegion or an excludeRegion may be specified but not both.  One must be null.  Both parameter can be null.
     * If the region is specified and it matches the current region then it is satisfied and the mapping is allowed
     * to continue.  If an region is excluded and the current region matches the exclusion, the template is not allowed to continue.
     * The current region is set by the deploymentRegionOverride, if set.  Otherwise, the current region is set from the default
     * credentials chain.
     *
     * @param validRegion is the value of the region where the mapping is allowed.  It may be null.
     * @param excludeRegion is the value of a region where the mapping is excluded.  It may be null.
     * @return a flag signaling if the mapping is allowed or not.
     * @throws MojoExecutionException when the specified region is not null and not a valid region.
     */
This function test to see if the current region condition is satisfied and the current region exclusion is not satisfied.
If the current region mapping and exclusion are null, then it is assumed that there are no region restrictions and the mapping
is allowed.  A validRegion or an excludeRegion may be specified but not both.  One must be null.  Both parameter can be null.
If the region is specified and it matches the current region then it is satisfied and the mapping is allowed
to continue.  If an region is excluded and the current region matches the exclusion, the template is not allowed to continue.
The current region is set by the deploymentRegionOverride, if set.  Otherwise, the current region is set from the default
credentials chain.

@param validRegion is the value of the region where the mapping is allowed.  It may be null.
@param excludeRegion is the value of a region where the mapping is excluded.  It may be null.
@return a flag signaling if the mapping is allowed or not.
@throws MojoExecutionException when the specified region is not null and not a valid region.
This function test to see if the current region condition is satisfied and the current region exclusion is not satisfied . If the current region mapping and exclusion are null then it is assumed that there are no region restrictions and the mapping is allowed . A validRegion or an excludeRegion may be specified but not both . One must be null . Both parameter can be null . If the region is specified and it matches the current region then it is satisfied and the mapping is allowed to continue . If an region is excluded and the current region matches the exclusion the template is not allowed to continue . The current region is set by the deploymentRegionOverride if set . Otherwise the current region is set from the default credentials chain . @param validRegion is the value of the region where the mapping is allowed . It may be null . @param excludeRegion is the value of a region where the mapping is excluded . It may be null . @return a flag signaling if the mapping is allowed or not . @throws MojoExecutionException when the specified region is not null and not a valid region .
private boolean testRegionCondition(String validRegion, String excludeRegion) throws MojoExecutionException {
        boolean result = true;
        if((validRegion != null) || (excludeRegion != null)) {
            if((validRegion != null) && (excludeRegion != null))
                throw new MojoExecutionException("Can not specifiy a valid region and a region exclusion.");
            Region region = validRegion != null ? Region.of(validRegion) : null;
            if((region == null) && (validRegion != null)) throw new MojoExecutionException("Invalid region specified.");
            Region exclusion = excludeRegion != null ? Region.of(excludeRegion) : null;
            if((exclusion == null) && (excludeRegion != null)) throw new MojoExecutionException("Invalid exclusion specified.");
            Region currentRegion = effectiveRegion();
            result = ((validRegion != null) && (region == currentRegion)) ||
                    ((excludeRegion != null) && (exclusion != currentRegion));
        }
        return result;
    }
private boolean testRegionCondition ( String validRegion , String excludeRegion ) throws MojoExecutionException { boolean result = true ; if ( ( validRegion != null ) || ( excludeRegion != null ) ) { if ( ( validRegion != null ) && ( excludeRegion != null ) ) throw new MojoExecutionException ( "Can not specifiy a valid region and a region exclusion." ) ; Region region = validRegion != null ? Region . of ( validRegion ) : null ; if ( ( region == null ) && ( validRegion != null ) ) throw new MojoExecutionException ( "Invalid region specified." ) ; Region exclusion = excludeRegion != null ? Region . of ( excludeRegion ) : null ; if ( ( exclusion == null ) && ( excludeRegion != null ) ) throw new MojoExecutionException ( "Invalid exclusion specified." ) ; Region currentRegion = effectiveRegion ( ) ; result = ( ( validRegion != null ) && ( region == currentRegion ) ) || ( ( excludeRegion != null ) && ( exclusion != currentRegion ) ) ; } return result ; }
This function test to see if the current region condition is satisfied and the current region exclusion is not satisfied.
This function test to see if the current region condition is satisfied and the current region exclusion is not satisfied .