use of org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties.MessagingConfiguration in project ovirt-engine by oVirt.
the class NeutronAgentModel method flush.
public void flush(Provider<OpenstackNetworkProviderProperties> provider) {
OpenstackNetworkProviderProperties properties = provider.getAdditionalProperties();
if (properties == null) {
properties = new OpenstackNetworkProviderProperties();
provider.setAdditionalProperties(properties);
}
properties.setPluginType(NetworkProviderPluginTranslator.getPluginNameForDisplayString(getPluginType().getSelectedItem()));
if (!isPluginConfigurationAvailable().getEntity()) {
properties.setAgentConfiguration(null);
} else {
AgentConfiguration agentConfiguration = properties.getAgentConfiguration();
if (agentConfiguration == null) {
agentConfiguration = new AgentConfiguration();
properties.setAgentConfiguration(agentConfiguration);
}
agentConfiguration.setNetworkMappings(getInterfaceMappings().getEntity());
MessagingConfiguration messagingConfiguration = agentConfiguration.getMessagingConfiguration();
if (messagingConfiguration == null) {
messagingConfiguration = new MessagingConfiguration();
agentConfiguration.setMessagingConfiguration(messagingConfiguration);
}
messagingConfiguration.setAddress(getMessagingServer().getEntity());
String port = getMessagingServerPort().getEntity();
messagingConfiguration.setPort(port == null ? null : Integer.valueOf(port));
messagingConfiguration.setUsername(getMessagingServerUsername().getEntity());
messagingConfiguration.setPassword(getMessagingServerPassword().getEntity());
messagingConfiguration.setBrokerType(getBrokerType().getSelectedItem());
}
}
use of org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties.MessagingConfiguration in project ovirt-engine by oVirt.
the class NeutronAgentModel method init.
public void init(Provider<OpenstackNetworkProviderProperties> provider, ProviderType type) {
OpenstackNetworkProviderProperties properties = provider.getAdditionalProperties();
NetworkProviderPluginTranslator translator = NetworkProviderPluginTranslator.getTranslatorByProviderType(type);
String pluginName = translator.getDisplayStringForPluginName(properties == null ? translator.getDefault() : properties.getPluginType());
List<String> displayItems = translator.getPresetDisplayStrings();
getPluginType().setItems(displayItems);
getPluginType().setSelectedItem(pluginName);
pluginValidator = translator.getPluginValidator();
if (properties != null) {
AgentConfiguration agentConfiguration = properties.getAgentConfiguration();
if (agentConfiguration != null) {
getInterfaceMappings().setEntity(agentConfiguration.getNetworkMappings());
MessagingConfiguration messagingConfiguration = agentConfiguration.getMessagingConfiguration();
if (messagingConfiguration != null) {
getBrokerType().setSelectedItem(messagingConfiguration.getBrokerType());
getMessagingServer().setEntity(messagingConfiguration.getAddress());
Integer port = messagingConfiguration.getPort();
getMessagingServerPort().setEntity(port == null ? null : Integer.toString(port));
getMessagingServerUsername().setEntity(messagingConfiguration.getUsername());
getMessagingServerPassword().setEntity(messagingConfiguration.getPassword());
}
}
}
}
use of org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties.MessagingConfiguration in project ovirt-engine by oVirt.
the class NetworkProviderValidatorTest method mockMessagingConfiguration.
private void mockMessagingConfiguration() {
mockProviderAdditionalProperties();
MessagingConfiguration messagingConfiguration = mock(MessagingConfiguration.class);
when(getProviderAgentConfiguration().getMessagingConfiguration()).thenReturn(messagingConfiguration);
}
Aggregations