agave-apps/apps-core/src/main/java/org/iplantc/service/apps/queue/actions/CloneAction.java
/**
     * Adjust the default queue settings on a {@link Software} instance based on 
     * the execution system parameters.
     *  
     * @param software
     */
Adjust the default queue settings on a  Software instance based on
the execution system parameters.

@param software
Adjust the default queue settings on a Software instance based on the execution system parameters . @param software
protected void recalculateDefaultQueueSettings(Software software) {
        if (StringUtils.isNotEmpty(software.getDefaultQueue())) 
        {
            BatchQueue batchQueue = null;
            if (StringUtils.equals(software.getExecutionSystem().getSystemId(), getEntity().getExecutionSystem().getSystemId())) {
            }
            else 
            {
                if ((batchQueue = software.getExecutionSystem().getQueue(software.getDefaultQueue())) == null) {
                    batchQueue = software.getExecutionSystem().getDefaultQueue();
                }
                if (batchQueue != null) {
                    software.setDefaultQueue(batchQueue.getName());
                    if (StringUtils.isNotEmpty(software.getDefaultMaxRunTime())) {
                        if (TimeUtils.compareRequestedJobTimes(software.getDefaultMaxRunTime(), batchQueue.getMaxRequestedTime()) > 0) {
                            software.setDefaultMaxRunTime(batchQueue.getMaxRequestedTime());
                        }
                    }
                    if (software.getDefaultNodes() != null) {
                        if (batchQueue.getMaxNodes() > 0) {
                            if (software.getDefaultNodes() > batchQueue.getMaxNodes()) {
                                software.setDefaultNodes(batchQueue.getMaxNodes());
                            }   
                        }
                    }
                    if (software.getDefaultProcessorsPerNode() != null) {
                        if (batchQueue.getMaxProcessorsPerNode() > 0) {
                            if (software.getDefaultProcessorsPerNode() > batchQueue.getMaxProcessorsPerNode()) {
                                software.setDefaultNodes(batchQueue.getMaxProcessorsPerNode());
                            }   
                        }
                    }
                    if (software.getDefaultMemoryPerNode() != null) {
                        if (batchQueue.getMaxMemoryPerNode() > 0) {
                            if (software.getDefaultMemoryPerNode() > batchQueue.getMaxMemoryPerNode()) {
                                software.setDefaultMemoryPerNode(batchQueue.getMaxMemoryPerNode());
                            }   
                        }
                    }
                }
            }
        }
    }
protected void recalculateDefaultQueueSettings ( Software software ) { if ( StringUtils . isNotEmpty ( software . getDefaultQueue ( ) ) ) { BatchQueue batchQueue = null ; if ( StringUtils . equals ( software . getExecutionSystem ( ) . getSystemId ( ) , getEntity ( ) . getExecutionSystem ( ) . getSystemId ( ) ) ) { } else { if ( ( batchQueue = software . getExecutionSystem ( ) . getQueue ( software . getDefaultQueue ( ) ) ) == null ) { batchQueue = software . getExecutionSystem ( ) . getDefaultQueue ( ) ; } if ( batchQueue != null ) { software . setDefaultQueue ( batchQueue . getName ( ) ) ; if ( StringUtils . isNotEmpty ( software . getDefaultMaxRunTime ( ) ) ) { if ( TimeUtils . compareRequestedJobTimes ( software . getDefaultMaxRunTime ( ) , batchQueue . getMaxRequestedTime ( ) ) > 0 ) { software . setDefaultMaxRunTime ( batchQueue . getMaxRequestedTime ( ) ) ; } } if ( software . getDefaultNodes ( ) != null ) { if ( batchQueue . getMaxNodes ( ) > 0 ) { if ( software . getDefaultNodes ( ) > batchQueue . getMaxNodes ( ) ) { software . setDefaultNodes ( batchQueue . getMaxNodes ( ) ) ; } } } if ( software . getDefaultProcessorsPerNode ( ) != null ) { if ( batchQueue . getMaxProcessorsPerNode ( ) > 0 ) { if ( software . getDefaultProcessorsPerNode ( ) > batchQueue . getMaxProcessorsPerNode ( ) ) { software . setDefaultNodes ( batchQueue . getMaxProcessorsPerNode ( ) ) ; } } } if ( software . getDefaultMemoryPerNode ( ) != null ) { if ( batchQueue . getMaxMemoryPerNode ( ) > 0 ) { if ( software . getDefaultMemoryPerNode ( ) > batchQueue . getMaxMemoryPerNode ( ) ) { software . setDefaultMemoryPerNode ( batchQueue . getMaxMemoryPerNode ( ) ) ; } } } } } } }
Adjust the default queue settings on a {@link Software} instance based on
 the execution system parameters.
Adjust the default queue settings on a { @link Software } instance based on the execution system parameters .
// if the old app had a default queue that does not exist on the new execution // system, set the default queue to the new system default queue  // if the execution system has changed, leave them be // if the execution system has changed, we need to update // if the software default queue does not exist on the execution system