private IntuitRetryPolicyHandler getRetryHandler ( ) throws FMSException { IntuitRetryPolicyHandler handler = null ; String policy = Config . getProperty ( Config . RETRY_MODE ) ; if ( policy . equalsIgnoreCase ( "fixed" ) ) { String retryCountStr = Config . getProperty ( Config . RETRY_FIXED_COUNT ) ; String retryIntervalStr = Config . getProperty ( Config . RETRY_FIXED_INTERVAL ) ; try { handler = new IntuitRetryPolicyHandler ( Integer . parseInt ( retryCountStr ) , Integer . parseInt ( retryIntervalStr ) ) ; } catch ( NumberFormatException e ) { throw new ConfigurationException ( e ) ; } } else if ( policy . equalsIgnoreCase ( "incremental" ) ) { String retryCountStr = Config . getProperty ( Config . RETRY_INCREMENTAL_COUNT ) ; String retryIntervalStr = Config . getProperty ( Config . RETRY_INCREMENTAL_INTERVAL ) ; String retryIncrementStr = Config . getProperty ( Config . RETRY_INCREMENTAL_INCREMENT ) ; try { handler = new IntuitRetryPolicyHandler ( Integer . parseInt ( retryCountStr ) , Integer . parseInt ( retryIntervalStr ) , Integer . parseInt ( retryIncrementStr ) ) ; } catch ( NumberFormatException e ) { throw new ConfigurationException ( e ) ; } } else if ( policy . equalsIgnoreCase ( "exponential" ) ) { String retryCountStr = Config . getProperty ( Config . RETRY_EXPONENTIAL_COUNT ) ; String minBackoffStr = Config . getProperty ( Config . RETRY_EXPONENTIAL_MIN_BACKOFF ) ; String maxBackoffStr = Config . getProperty ( Config . RETRY_EXPONENTIAL_MAX_BACKOFF ) ; String deltaBackoffStr = Config . getProperty ( Config . RETRY_EXPONENTIAL_DELTA_BACKOFF ) ; try { handler = new IntuitRetryPolicyHandler ( Integer . parseInt ( retryCountStr ) , Integer . parseInt ( minBackoffStr ) , Integer . parseInt ( maxBackoffStr ) , Integer . parseInt ( deltaBackoffStr ) ) ; } catch ( NumberFormatException e ) { throw new ConfigurationException ( e ) ; } } return handler ; }
Method to get the retry handler which is used to retry to establish the HTTP connection