use of org.openstack4j.model.identity.v3.builder.ProjectBuilder in project camel by apache.
the class ProjectProducer method messageToProject.
private Project messageToProject(Message message) {
Project project = message.getBody(Project.class);
if (project == null) {
Map headers = message.getHeaders();
ProjectBuilder builder = Builders.project();
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.PARENT_ID)) {
builder.parentId(message.getHeader(KeystoneConstants.PARENT_ID, String.class));
}
project = builder.build();
}
return project;
}
Aggregations