Search in sources :

Example 1 with RemoveGroupInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInputBuilder in project openflowplugin by opendaylight.

the class BundleAddMessageConverter method convertBundleGroupCase.

private BundleGroupModCase convertBundleGroupCase(final BundleInnerMessage messageCase, final VersionDatapathIdConvertorData data) throws ConversionException {
    Optional<GroupModInputBuilder> groupModInput = Optional.empty();
    final Class clazz = messageCase.getImplementedInterface();
    if (clazz.equals(BundleAddGroupCase.class)) {
        groupModInput = CONVERTER_EXECUTOR.convert(new AddGroupInputBuilder(((BundleAddGroupCase) messageCase).getAddGroupCaseData()).build(), data);
    } else if (clazz.equals(BundleUpdateGroupCase.class)) {
        groupModInput = CONVERTER_EXECUTOR.convert(new UpdatedGroupBuilder(((BundleUpdateGroupCase) messageCase).getUpdateGroupCaseData()).build(), data);
    } else if (clazz.equals(BundleRemoveGroupCase.class)) {
        groupModInput = CONVERTER_EXECUTOR.convert(new RemoveGroupInputBuilder(((BundleRemoveGroupCase) messageCase).getRemoveGroupCaseData()).build(), data);
    }
    if (groupModInput.isPresent()) {
        return new BundleGroupModCaseBuilder().setGroupModCaseData(new GroupModCaseDataBuilder(groupModInput.get().setXid(xid).build()).build()).build();
    } else {
        throw new ConversionException("BundleGroupCase conversion unsuccessful.");
    }
}
Also used : ConversionException(org.opendaylight.openflowplugin.extension.api.exception.ConversionException) BundleRemoveGroupCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.bundle.inner.message.grouping.bundle.inner.message.BundleRemoveGroupCase) BundleAddGroupCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.bundle.inner.message.grouping.bundle.inner.message.BundleAddGroupCase) BundleUpdateGroupCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.bundle.inner.message.grouping.bundle.inner.message.BundleUpdateGroupCase) RemoveGroupInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInputBuilder) GroupModInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GroupModInputBuilder) UpdatedGroupBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.UpdatedGroupBuilder) GroupModCaseDataBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.bundle.add.message.grouping.bundle.inner.message.bundle.group.mod._case.GroupModCaseDataBuilder) AddGroupInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInputBuilder) BundleGroupModCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.bundle.add.message.grouping.bundle.inner.message.BundleGroupModCaseBuilder)

Example 2 with RemoveGroupInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInputBuilder in project openflowplugin by opendaylight.

the class SalGroupServiceImplTest method removeGroup.

private void removeGroup() throws Exception {
    final GroupId dummyGroupId = new GroupId(DUMMY_GROUP_ID);
    RemoveGroupInput removeGroupInput = new RemoveGroupInputBuilder().setGroupId(dummyGroupId).build();
    this.<RemoveGroupOutput>mockSuccessfulFuture();
    salGroupService.removeGroup(removeGroupInput);
    verify(mockedRequestContextStack).createRequestContext();
}
Also used : RemoveGroupInput(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInput) RemoveGroupOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupOutput) RemoveGroupInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInputBuilder) GroupId(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId)

Example 3 with RemoveGroupInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInputBuilder in project openflowplugin by opendaylight.

the class GroupForwarder method removeWithResult.

// TODO: Pull this into ForwardingRulesCommiter and override it here
@Override
public Future<RpcResult<RemoveGroupOutput>> removeWithResult(final InstanceIdentifier<Group> identifier, final Group removeDataObj, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
    final Group group = removeDataObj;
    final RemoveGroupInputBuilder builder = new RemoveGroupInputBuilder(group);
    builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
    builder.setGroupRef(new GroupRef(identifier));
    builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
    return this.provider.getSalGroupService().removeGroup(builder.build());
}
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) RemoveGroupInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInputBuilder) GroupRef(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef) Uri(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri)

Example 4 with RemoveGroupInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInputBuilder in project openflowplugin by opendaylight.

the class GroupForwarder method remove.

@Override
public Future<RpcResult<RemoveGroupOutput>> remove(final InstanceIdentifier<Group> identifier, final Group removeDataObj, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
    LOG.trace("Forwarding Table REMOVE request [Tbl id, node Id {} {}", identifier, nodeIdent);
    final RemoveGroupInputBuilder builder = new RemoveGroupInputBuilder(removeDataObj);
    builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
    builder.setGroupRef(new GroupRef(identifier));
    // fix group removal - no buckets allowed
    builder.setBuckets(null);
    return salGroupService.removeGroup(builder.build());
}
Also used : NodeRef(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef) RemoveGroupInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInputBuilder) GroupRef(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef)

Example 5 with RemoveGroupInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInputBuilder in project openflowplugin by opendaylight.

the class GroupForwarder method remove.

@Override
public void remove(final InstanceIdentifier<Group> identifier, final Group removeDataObj, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
    final Group group = removeDataObj;
    final RemoveGroupInputBuilder builder = new RemoveGroupInputBuilder(group);
    builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
    builder.setGroupRef(new GroupRef(identifier));
    builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
    final Future<RpcResult<RemoveGroupOutput>> resultFuture = this.provider.getSalGroupService().removeGroup(builder.build());
    JdkFutures.addErrorLogging(resultFuture, LOG, "removeGroup");
}
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) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) RemoveGroupInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInputBuilder) GroupRef(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef) Uri(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri)

Aggregations

RemoveGroupInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInputBuilder)6 GroupRef (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef)3 NodeRef (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef)3 Uri (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri)2 RemoveGroupInput (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInput)2 RemoveGroupOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupOutput)2 Group (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group)2 StaleGroup (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.StaleGroup)2 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)2 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)1 ArrayList (java.util.ArrayList)1 ConversionException (org.opendaylight.openflowplugin.extension.api.exception.ConversionException)1 AddGroupInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInputBuilder)1 UpdatedGroupBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.UpdatedGroupBuilder)1 GroupId (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId)1 BatchFailedGroupsOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.batch.group.output.list.grouping.BatchFailedGroupsOutput)1 BatchRemoveGroups (org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.remove.groups.batch.input.BatchRemoveGroups)1 GroupModInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GroupModInputBuilder)1 BundleAddGroupCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.bundle.inner.message.grouping.bundle.inner.message.BundleAddGroupCase)1 BundleRemoveGroupCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.bundle.inner.message.grouping.bundle.inner.message.BundleRemoveGroupCase)1