// The cache key is "tenantId:cloudId"
private static Map<String,NeutronCacheEntry> neutronClientCache = new HashMap<>();
- // Fetch cloud configuration each time (may be cached in CloudConfig class)
- private CloudConfig cloudConfig;
+ private CloudConfigFactory cloudConfigFactory;
private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
private String msoPropID;
};
public MsoNeutronUtils(String msoPropID, CloudConfigFactory cloudConfigFactory) {
- cloudConfig = cloudConfigFactory.getCloudConfig();
+ this.cloudConfigFactory = cloudConfigFactory;
this.msoPropID = msoPropID;
}
+
+ protected CloudConfigFactory getCloudConfigFactory() {
+ return cloudConfigFactory;
+ }
/**
* Create a network with the specified parameters in the given cloud/tenant.
throws MsoException
{
// Obtain the cloud site information where we will create the stack
- CloudSite cloudSite = cloudConfig.getCloudSite(cloudSiteId).orElseThrow(
+ CloudSite cloudSite = getCloudConfigFactory().getCloudConfig().getCloudSite(cloudSiteId).orElseThrow(
() -> new MsoCloudSiteNotFound(cloudSiteId));
Quantum neutronClient = getNeutronClient (cloudSite, tenantId);
LOGGER.debug("In queryNetwork");
// Obtain the cloud site information
- CloudSite cloudSite = cloudConfig.getCloudSite(cloudSiteId).orElseThrow(
+ CloudSite cloudSite = getCloudConfigFactory().getCloudConfig().getCloudSite(cloudSiteId).orElseThrow(
() -> new MsoCloudSiteNotFound(cloudSiteId));
Quantum neutronClient = getNeutronClient (cloudSite, tenantId);
public boolean deleteNetwork(String networkId, String tenantId, String cloudSiteId) throws MsoException
{
// Obtain the cloud site information where we will create the stack
- CloudSite cloudSite = cloudConfig.getCloudSite(cloudSiteId).orElseThrow(
+ CloudSite cloudSite = getCloudConfigFactory().getCloudConfig().getCloudSite(cloudSiteId).orElseThrow(
() -> new MsoCloudSiteNotFound(cloudSiteId));
Quantum neutronClient = getNeutronClient (cloudSite, tenantId);
try {
throws MsoException
{
// Obtain the cloud site information where we will create the stack
- CloudSite cloudSite = cloudConfig.getCloudSite(cloudSiteId).orElseThrow(
+ CloudSite cloudSite = getCloudConfigFactory().getCloudConfig().getCloudSite(cloudSiteId).orElseThrow(
() -> new MsoCloudSiteNotFound(cloudSiteId));
Quantum neutronClient = getNeutronClient (cloudSite, tenantId);
// Check that the network exists