Search in sources :

Example 1 with GroupBuilder

use of org.openstack4j.model.identity.v3.builder.GroupBuilder in project camel by apache.

the class GroupProducer method messageToGroup.

private Group messageToGroup(Message message) {
    Group group = message.getBody(Group.class);
    if (group == null) {
        Map headers = message.getHeaders();
        GroupBuilder builder = Builders.group();
        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));
        }
        group = builder.build();
    }
    return group;
}
Also used : Group(org.openstack4j.model.identity.v3.Group) GroupBuilder(org.openstack4j.model.identity.v3.builder.GroupBuilder) Map(java.util.Map)

Aggregations

Map (java.util.Map)1 Group (org.openstack4j.model.identity.v3.Group)1 GroupBuilder (org.openstack4j.model.identity.v3.builder.GroupBuilder)1