vishesh92 commented on code in PR #13032:
URL: https://github.com/apache/cloudstack/pull/13032#discussion_r3387015429
##########
framework/extensions/src/main/java/org/apache/cloudstack/framework/extensions/manager/ExtensionsManagerImpl.java:
##########
@@ -1765,4 +2338,104 @@ protected void runInContext() {
}
}
}
+
+ @Override
+ public String getExtensionScriptPath(Extension extension) {
+ if (extension == null) {
+ return null;
+ }
+ return
externalProvisioner.getExtensionPath(extension.getRelativePath());
+ }
+
+ @Override
+ public Extension getExtensionForPhysicalNetworkAndProvider(long
physicalNetworkId, String providerName) {
+ if (StringUtils.isBlank(providerName)) {
+ return null;
+ }
+ ExtensionVO ext = extensionDao.findByName(providerName);
+ if (ext == null) {
+ return null;
+ }
+
+ ExtensionResourceMapVO map =
extensionResourceMapDao.findResourceByExtensionIdAndResourceIdAndType(
+ ext.getId(), physicalNetworkId,
ExtensionResourceMap.ResourceType.PhysicalNetwork);
+ if (map != null) {
+ return ext;
+ }
+ return null;
+ }
+
+ @Override
+ public Map<String, String>
getAllResourceMapDetailsForExtensionOnPhysicalNetwork(long physicalNetworkId,
long extensionId) {
+ ExtensionResourceMapVO map =
extensionResourceMapDao.findResourceByExtensionIdAndResourceIdAndType(
+ extensionId, physicalNetworkId,
ExtensionResourceMap.ResourceType.PhysicalNetwork);
+ if (map == null) {
+ return new HashMap<>();
+ }
+
+ Map<String, String> details =
extensionResourceMapDetailsDao.listDetailsKeyPairs(map.getId());
+ return details != null ? details : new HashMap<>();
+ }
+
+ @Override
+ public boolean isNetworkExtensionProvider(String providerName) {
+ if (StringUtils.isBlank(providerName)) {
+ return false;
+ }
+ return extensionDao.findByNameAndType(providerName,
Extension.Type.NetworkOrchestrator) != null;
+ }
+
+ @Override
+ public boolean usesNetworkExtensionIsolation(String providerName) {
+ Extension extension = extensionDao.findByName(providerName);
+ if (extension == null) {
+ return false;
+ }
+ Map<String, String> extDetails =
extensionDetailsDao.listDetailsKeyPairs(extension.getId());
+ if (MapUtils.isEmpty(extDetails)) {
+ return false;
+ }
+ return
NETWORK_EXTENSION_ISOLATION_METHOD.equalsIgnoreCase(extDetails.get(NETWORK_ISOLATION_METHOD_DETAIL_KEY));
+ }
+
+ @Override
+ public List<Extension> listExtensionsByType(Extension.Type type) {
+ if (type == null) {
+ return new ArrayList<>();
+ }
+ List<ExtensionVO> extensions = extensionDao.listByType(type);
+ if (CollectionUtils.isEmpty(extensions)) {
+ return new ArrayList<>();
+ }
+ return new ArrayList<>(extensions);
+ }
+
+ @Override
+ public Map<Service, Map<Capability, String>>
getNetworkCapabilitiesForProvider(Long physicalNetworkId,
+ String providerName) {
+ if (StringUtils.isBlank(providerName)) {
+ return new HashMap<>();
+ }
+ Extension extension = null;
+ if (physicalNetworkId != null) {
+ extension =
getExtensionForPhysicalNetworkAndProvider(physicalNetworkId, providerName);
+ }
+ if (extension == null) {
+ // Search across all physical networks
+ List<ExtensionVO> networkOrchExtensions =
extensionDao.listByType(Extension.Type.NetworkOrchestrator);
Review Comment:
this might require a change in the dao method to check for case insensitive
names.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]