use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.UpdatedGroup in project openflowplugin by opendaylight.
the class SalGroupServiceImplTest method updateGroup.
private void updateGroup() {
final UpdatedGroup updatedGroup = new UpdatedGroupBuilder().setGroupId(new GroupId(DUMMY_GROUP_ID)).build();
final OriginalGroup originalGroup = new OriginalGroupBuilder().setGroupId(new GroupId(DUMMY_GROUP_ID)).build();
final UpdateGroupInput updateGroupInput = new UpdateGroupInputBuilder().setUpdatedGroup(updatedGroup).setOriginalGroup(originalGroup).build();
this.<UpdateGroupOutput>mockSuccessfulFuture();
salGroupService.updateGroup(updateGroupInput);
verify(mockedRequestContextStack).createRequestContext();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.UpdatedGroup in project openflowplugin by opendaylight.
the class GroupForwarder method update.
@Override
public void update(final InstanceIdentifier<Group> identifier, final Group original, final Group update, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
final Group originalGroup = original;
final Group updatedGroup = update;
final UpdateGroupInputBuilder builder = new UpdateGroupInputBuilder();
builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
builder.setGroupRef(new GroupRef(identifier));
builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
builder.setUpdatedGroup(new UpdatedGroupBuilder(updatedGroup).build());
builder.setOriginalGroup(new OriginalGroupBuilder(originalGroup).build());
final Future<RpcResult<UpdateGroupOutput>> resultFuture = this.provider.getSalGroupService().updateGroup(builder.build());
JdkFutures.addErrorLogging(resultFuture, LOG, "updateGroup");
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.UpdatedGroup in project openflowplugin by opendaylight.
the class GroupConvertor method convert.
@Override
public GroupModInputBuilder convert(Group source, VersionDatapathIdConvertorData data) {
GroupModInputBuilder groupModInputBuilder = new GroupModInputBuilder();
if (source instanceof AddGroupInput) {
groupModInputBuilder.setCommand(GroupModCommand.OFPGCADD);
} else if (source instanceof RemoveGroupInput) {
groupModInputBuilder.setCommand(GroupModCommand.OFPGCDELETE);
} else if (source instanceof UpdatedGroup) {
groupModInputBuilder.setCommand(GroupModCommand.OFPGCMODIFY);
}
if (GroupTypes.GroupAll.equals(source.getGroupType())) {
groupModInputBuilder.setType(GroupType.OFPGTALL);
}
if (GroupTypes.GroupSelect.equals(source.getGroupType())) {
groupModInputBuilder.setType(GroupType.OFPGTSELECT);
}
if (GroupTypes.GroupIndirect.equals(source.getGroupType())) {
groupModInputBuilder.setType(GroupType.OFPGTINDIRECT);
}
if (GroupTypes.GroupFf.equals(source.getGroupType())) {
groupModInputBuilder.setType(GroupType.OFPGTFF);
}
groupModInputBuilder.setGroupId(new GroupId(source.getGroupId().getValue()));
// During group deletion do not push the buckets
if (groupModInputBuilder.getCommand() != GroupModCommand.OFPGCDELETE) {
if (source.getBuckets() != null && source.getBuckets().getBucket().size() != 0) {
Collections.sort(source.getBuckets().getBucket(), COMPARATOR);
List<BucketsList> bucketLists = salToOFBucketList(source.getBuckets(), data.getVersion(), source.getGroupType().getIntValue(), data.getDatapathId());
groupModInputBuilder.setBucketsList(bucketLists);
}
}
groupModInputBuilder.setVersion(data.getVersion());
return groupModInputBuilder;
}
Aggregations