use of org.openstack4j.model.identity.v3.builder.UserBuilder in project camel by apache.
the class UserProducer method messageToUser.
private User messageToUser(Message message) {
User project = message.getBody(User.class);
if (project == null) {
Map headers = message.getHeaders();
UserBuilder builder = Builders.user();
ObjectHelper.notEmpty(message.getHeader(OpenstackConstants.NAME, String.class), "Name");
builder.name(message.getHeader(OpenstackConstants.NAME, String.class));
if (headers.containsKey(KeystoneConstants.DOMAIN_ID)) {
builder.domainId(message.getHeader(KeystoneConstants.DOMAIN_ID, String.class));
}
if (headers.containsKey(KeystoneConstants.DESCRIPTION)) {
builder.description(message.getHeader(KeystoneConstants.DESCRIPTION, String.class));
}
if (headers.containsKey(KeystoneConstants.PASSWORD)) {
builder.password(message.getHeader(KeystoneConstants.PASSWORD, String.class));
}
if (headers.containsKey(KeystoneConstants.EMAIL)) {
builder.email(message.getHeader(KeystoneConstants.EMAIL, String.class));
}
project = builder.build();
}
return project;
}
Aggregations