use of org.ovirt.engine.api.model.AgentConfiguration in project ovirt-engine by oVirt.
the class OpenStackNetworkProviderMapper method map.
@Mapping(from = OpenstackNetworkProviderProperties.AgentConfiguration.class, to = AgentConfiguration.class)
public static AgentConfiguration map(OpenstackNetworkProviderProperties.AgentConfiguration entity, AgentConfiguration template) {
AgentConfiguration model = template != null ? template : new AgentConfiguration();
if (entity.getNetworkMappings() != null) {
model.setNetworkMappings(entity.getNetworkMappings());
}
OpenstackNetworkProviderProperties.MessagingConfiguration messagingConfiguration = entity.getMessagingConfiguration();
if (messagingConfiguration != null) {
if (messagingConfiguration.getBrokerType() != null) {
model.setBrokerType(map(messagingConfiguration.getBrokerType()));
}
if (messagingConfiguration.getAddress() != null) {
model.setAddress(messagingConfiguration.getAddress());
}
if (messagingConfiguration.getPort() != null) {
model.setPort(messagingConfiguration.getPort());
}
if (messagingConfiguration.getUsername() != null) {
model.setUsername(messagingConfiguration.getUsername());
}
// The password isn't mapped for security reasons.
// if (messagingConfiguration.getPassword() != null) {
// model.setPassword(messagingConfiguration.getPassword());
// }
}
return model;
}
use of org.ovirt.engine.api.model.AgentConfiguration in project ovirt-engine by oVirt.
the class OpenStackNetworkProviderMapperTest method postPopulate.
@Override
protected OpenStackNetworkProvider postPopulate(OpenStackNetworkProvider model) {
model.setType(OpenStackNetworkProviderType.NEUTRON);
model.setPluginType(MappingTestHelper.shuffle(NetworkPluginType.class));
AgentConfiguration agentConfiguration = model.getAgentConfiguration();
agentConfiguration.setBrokerType(MappingTestHelper.shuffle(MessageBrokerType.class));
model.setAutoSync(true);
model.setReadOnly(false);
model.setUnmanaged(true);
return model;
}
Aggregations