Search in sources :

Example 1 with UpdatedGroup

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();
}
Also used : OriginalGroup(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.OriginalGroup) UpdateGroupOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupOutput) OriginalGroupBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.OriginalGroupBuilder) UpdateGroupInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupInputBuilder) UpdatedGroup(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.UpdatedGroup) UpdatedGroupBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.UpdatedGroupBuilder) UpdateGroupInput(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupInput) GroupId(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId)

Example 2 with UpdatedGroup

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");
}
Also used : StaleGroup(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.StaleGroup) Group(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group) NodeRef(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef) OriginalGroupBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.OriginalGroupBuilder) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) UpdateGroupInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupInputBuilder) GroupRef(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef) UpdatedGroupBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.UpdatedGroupBuilder) Uri(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri)

Example 3 with UpdatedGroup

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;
}
Also used : RemoveGroupInput(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInput) AddGroupInput(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInput) GroupModInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GroupModInputBuilder) UpdatedGroup(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.UpdatedGroup) BucketsList(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsList) GroupId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.GroupId)

Aggregations

UpdateGroupInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupInputBuilder)2 OriginalGroupBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.OriginalGroupBuilder)2 UpdatedGroup (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.UpdatedGroup)2 UpdatedGroupBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.UpdatedGroupBuilder)2 Uri (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri)1 AddGroupInput (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInput)1 RemoveGroupInput (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInput)1 UpdateGroupInput (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupInput)1 UpdateGroupOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupOutput)1 OriginalGroup (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.OriginalGroup)1 GroupId (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId)1 GroupRef (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef)1 Group (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group)1 StaleGroup (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.StaleGroup)1 NodeRef (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef)1 GroupId (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.GroupId)1 GroupModInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GroupModInputBuilder)1 BucketsList (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.buckets.grouping.BucketsList)1 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)1