Search in sources :

Example 51 with OfHeader

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.

the class AllGroupsStatsService method buildRequest.

@Override
protected OfHeader buildRequest(final Xid xid, final GetAllGroupStatisticsInput input) throws ServiceException {
    // Create multipart request header
    final MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(MultipartType.OFPMPGROUP, xid.getValue(), getVersion());
    // Set request body to main multipart request
    mprInput.setMultipartRequestBody(GROUP_CASE);
    // Send the request, no cookies associated, use any connection
    return mprInput.build();
}
Also used : MultipartRequestInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder)

Example 52 with OfHeader

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.

the class AllQueuesAllPortsService method buildRequest.

@Override
protected OfHeader buildRequest(final Xid xid, final GetAllQueuesStatisticsFromAllPortsInput input) throws ServiceException {
    // Set request body to main multipart request
    MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(MultipartType.OFPMPQUEUE, xid.getValue(), getVersion());
    mprInput.setMultipartRequestBody(QUEUE_CASE);
    return mprInput.build();
}
Also used : MultipartRequestInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder)

Example 53 with OfHeader

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.

the class GroupFeaturesService method buildRequest.

@Override
protected OfHeader buildRequest(final Xid xid, final GetGroupFeaturesInput input) throws ServiceException {
    final MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(MultipartType.OFPMPGROUPFEATURES, xid.getValue(), getVersion());
    mprInput.setMultipartRequestBody(GROUP_FEAT_CASE);
    return mprInput.build();
}
Also used : MultipartRequestInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder)

Example 54 with OfHeader

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.

the class OpendaylightFlowTableStatisticsServiceImpl method buildRequest.

@Override
protected OfHeader buildRequest(final Xid xid, final GetFlowTablesStatisticsInput input) throws ServiceException {
    // Create multipart request body for fetch all the group stats
    final MultipartRequestTableCaseBuilder multipartRequestTableCaseBuilder = new MultipartRequestTableCaseBuilder();
    final MultipartRequestTableBuilder multipartRequestTableBuilder = new MultipartRequestTableBuilder();
    multipartRequestTableBuilder.setEmpty(true);
    multipartRequestTableCaseBuilder.setMultipartRequestTable(multipartRequestTableBuilder.build());
    // Set request body to main multipart request
    final MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(MultipartType.OFPMPTABLE, xid.getValue(), getVersion());
    mprInput.setMultipartRequestBody(multipartRequestTableCaseBuilder.build());
    return mprInput.build();
}
Also used : MultipartRequestInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder) MultipartRequestTableCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestTableCaseBuilder) MultipartRequestTableBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.table._case.MultipartRequestTableBuilder)

Example 55 with OfHeader

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.

the class SingleLayerGroupService method buildRequest.

@Override
protected OfHeader buildRequest(final Xid xid, final Group input) throws ServiceException {
    final GroupMessageBuilder groupMessageBuilder = new GroupMessageBuilder(input);
    final Class<? extends DataContainer> clazz = input.getImplementedInterface();
    if (clazz.equals(AddGroupInput.class)) {
        groupMessageBuilder.setCommand(GroupModCommand.OFPGCADD);
    } else if (clazz.equals(UpdatedGroup.class)) {
        groupMessageBuilder.setCommand(GroupModCommand.OFPGCMODIFY);
    } else if (clazz.equals(RemoveGroupInput.class) || clazz.equals(OriginalGroup.class)) {
        groupMessageBuilder.setCommand(GroupModCommand.OFPGCDELETE);
    }
    return groupMessageBuilder.setVersion(getVersion()).setXid(xid.getValue()).build();
}
Also used : RemoveGroupInput(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInput) OriginalGroup(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.OriginalGroup) GroupMessageBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupMessageBuilder) UpdatedGroup(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.group.update.UpdatedGroup)

Aggregations

OfHeader (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader)30 Test (org.junit.Test)23 MultipartRequestInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartRequestInputBuilder)17 Xid (org.opendaylight.openflowplugin.api.openflow.device.Xid)10 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)5 ExecutionException (java.util.concurrent.ExecutionException)3 ServiceException (org.opendaylight.openflowplugin.impl.services.util.ServiceException)3 GroupMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupMessage)3 MultipartType (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType)3 FutureCallback (com.google.common.util.concurrent.FutureCallback)2 List (java.util.List)2 Future (java.util.concurrent.Future)2 Function (java.util.function.Function)2 OFDeserializer (org.opendaylight.openflowjava.protocol.api.extensibility.OFDeserializer)2 TypeVersionKey (org.opendaylight.openflowplugin.extension.api.TypeVersionKey)2 ConversionException (org.opendaylight.openflowplugin.extension.api.exception.ConversionException)2 ConverterNotFoundException (org.opendaylight.openflowplugin.extension.api.exception.ConverterNotFoundException)2 ConvertorExecutor (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor)2 PortMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortMessage)2 FlowMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowMessage)2