Commit 7642383d authored by neelesh thakur's avatar neelesh thakur
Browse files

use configuration properties instead of @Lazy

parent 5babb1f9
Pipeline #38843 passed with stages
in 11 minutes and 1 second
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<groupId>org.opengroup.osdu</groupId> <groupId>org.opengroup.osdu</groupId>
<artifactId>core-lib-azure</artifactId> <artifactId>core-lib-azure</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>0.9.0-SNAPSHOT</version> <version>0.9.0-SNAPSHOT-partition</version>
<name>core-lib-azure</name> <name>core-lib-azure</name>
<properties> <properties>
......
...@@ -5,7 +5,7 @@ import org.opengroup.osdu.azure.partition.PartitionInfoAzure; ...@@ -5,7 +5,7 @@ import org.opengroup.osdu.azure.partition.PartitionInfoAzure;
import org.opengroup.osdu.azure.partition.PartitionServiceClient; import org.opengroup.osdu.azure.partition.PartitionServiceClient;
import org.opengroup.osdu.common.Validators; import org.opengroup.osdu.common.Validators;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.identity.DefaultAzureCredentialBuilder;
...@@ -16,7 +16,7 @@ import com.azure.security.keyvault.keys.cryptography.CryptographyClientBuilder; ...@@ -16,7 +16,7 @@ import com.azure.security.keyvault.keys.cryptography.CryptographyClientBuilder;
* Implementation for CryptographyClientFactory. * Implementation for CryptographyClientFactory.
*/ */
@Component @Component
@Lazy @ConditionalOnProperty(value = "service.cryptography.enabled", havingValue = "true", matchIfMissing = true)
public class CryptographyClientFactoryImpl implements CryptographyClientFactory { public class CryptographyClientFactoryImpl implements CryptographyClientFactory {
@Autowired @Autowired
......
...@@ -25,14 +25,14 @@ import org.opengroup.osdu.core.common.partition.PartitionException; ...@@ -25,14 +25,14 @@ import org.opengroup.osdu.core.common.partition.PartitionException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/** /**
* Implementation for IEventGridTopicClientFactory. * Implementation for IEventGridTopicClientFactory.
*/ */
@Component @Component
@Lazy @ConditionalOnProperty(value = "service.eventgrid.topic.enabled", havingValue = "true", matchIfMissing = true)
public class EventGridTopicClientFactoryImpl implements IEventGridTopicClientFactory { public class EventGridTopicClientFactoryImpl implements IEventGridTopicClientFactory {
private static final Logger LOGGER = LoggerFactory.getLogger(EventGridTopicClientFactoryImpl.class.getName()); private static final Logger LOGGER = LoggerFactory.getLogger(EventGridTopicClientFactoryImpl.class.getName());
......
...@@ -25,7 +25,7 @@ import org.opengroup.osdu.core.common.model.http.AppException; ...@@ -25,7 +25,7 @@ import org.opengroup.osdu.core.common.model.http.AppException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.net.URI; import java.net.URI;
...@@ -58,7 +58,7 @@ import java.util.List; ...@@ -58,7 +58,7 @@ import java.util.List;
* </pre> * </pre>
*/ */
@Component @Component
@Lazy @ConditionalOnProperty(value = "service.eventgrid.topic.enabled", havingValue = "true", matchIfMissing = true)
public class EventGridTopicStore { public class EventGridTopicStore {
private static final Logger LOGGER = LoggerFactory.getLogger(CosmosStoreBulkOperations.class.getName()); private static final Logger LOGGER = LoggerFactory.getLogger(CosmosStoreBulkOperations.class.getName());
......
...@@ -6,7 +6,7 @@ import org.opengroup.osdu.azure.partition.PartitionServiceClient; ...@@ -6,7 +6,7 @@ import org.opengroup.osdu.azure.partition.PartitionServiceClient;
import org.opengroup.osdu.azure.util.AzureTokenCredentialsService; import org.opengroup.osdu.azure.util.AzureTokenCredentialsService;
import org.opengroup.osdu.common.Validators; import org.opengroup.osdu.common.Validators;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.microsoft.azure.credentials.AzureTokenCredentials; import com.microsoft.azure.credentials.AzureTokenCredentials;
...@@ -17,7 +17,7 @@ import com.microsoft.rest.LogLevel; ...@@ -17,7 +17,7 @@ import com.microsoft.rest.LogLevel;
* Interface for Event Grid Manager Factory to return appropriate EventGridManager based on the data partition id. * Interface for Event Grid Manager Factory to return appropriate EventGridManager based on the data partition id.
*/ */
@Component @Component
@Lazy @ConditionalOnProperty(value = "service.eventgrid.manager.enabled", havingValue = "true", matchIfMissing = true)
public class EventGridManagerFactoryImpl implements EventGridManagerFactory { public class EventGridManagerFactoryImpl implements EventGridManagerFactory {
@Autowired @Autowired
......
Supports Markdown
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