private boolean isExternalNetworkProviderReadOnly(Provider<?> provider) { OpenstackNetworkProviderProperties properties = (OpenstackNetworkProviderProperties) provider.getAdditionalProperties(); if (properties.getReadOnly()){ return true; } return false; }
/** * Check if any of the providers in externalProviderIds is read only * @param providers providers retrieved from the backend * @param externalProviderIds Set of all external provider id's to which the removed networks belong * @return true if any of the providers is read only */ protected boolean checkForRemoveExternalNetworkAvailability( List<Provider> providers, Set<Guid> externalProviderIds) { for (Provider provider : providers) { if (externalProviderIds.contains(provider.getId())) { OpenstackNetworkProviderProperties properties = (OpenstackNetworkProviderProperties) provider.getAdditionalProperties(); if (properties.getReadOnly()) { // If any of the providers is read only, abort return true; } } } return false; }
private void setCommandExecutionAllowedForProvider(Provider provider){ OpenstackNetworkProviderProperties properties = (OpenstackNetworkProviderProperties) provider.getAdditionalProperties(); if (properties != null && properties.getReadOnly()){ setCommandExecutionAllowed(false); return; } setCommandExecutionAllowed(true); }
private void setReadOnlyEntity() { boolean isReadOnlyAware = getType().getSelectedItem().isReadOnlyAware(); if (isReadOnlyAware && getIsUnmanaged().getEntity()) { getReadOnly().setEntity(false); } else if (isReadOnlyAware) { OpenstackNetworkProviderProperties properties = (OpenstackNetworkProviderProperties) provider.getAdditionalProperties(); getReadOnly().setEntity(properties != null ? properties.getReadOnly() : true); } }
model.setAgentConfiguration(map(additionalProperties.getAgentConfiguration(), null)); model.setReadOnly(additionalProperties.getReadOnly()); model.setAutoSync(additionalProperties.getAutoSync());
OpenstackNetworkProviderProperties networkProperties = (OpenstackNetworkProviderProperties) entity.getAdditionalProperties(); readOnly = networkProperties.getReadOnly(); pluginType = networkProperties.getPluginType(); agentConfiguration = networkProperties.getAgentConfiguration();