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.");
}
}
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();
}
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());
}
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());
}
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");
}
Aggregations