Commit 80673486 authored by Ronak Sakhuja's avatar Ronak Sakhuja
Browse files

Added check for negative values

parent c98e478b
package org.opengroup.osdu.azure.di;
/** Copyright © Microsoft Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
**/
package org.opengroup.osdu.azure.di;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
......@@ -11,7 +24,6 @@ import org.springframework.context.annotation.Configuration;
*/
@Configuration
@ConfigurationProperties("azure.eventgrid.topic")
@Getter
@Setter
public class EventGridTopicRetryConfiguration {
......@@ -19,6 +31,16 @@ public class EventGridTopicRetryConfiguration {
private int longRunningOperationRetryTimeout = DEFAULT_INT_VALUE;
/**
* Fetches value of Long Running Operation Retry Timeout.
* @return Value of longRunningOperationRetryTimeout greater than 0, else -1
*/
public int getLongRunningOperationRetryTimeout() {
if (this.longRunningOperationRetryTimeout < 0) {
return DEFAULT_INT_VALUE;
}
return this.longRunningOperationRetryTimeout;
}
/**
* Used to check if timeout is configured in application.properties.
* @return True if retry is configured.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment