use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.
the class GroupStatsService method buildRequest.
@Override
protected OfHeader buildRequest(final Xid xid, final GetGroupStatisticsInput input) throws ServiceException {
final MultipartRequestGroupCaseBuilder caseBuilder = new MultipartRequestGroupCaseBuilder();
final MultipartRequestGroupBuilder mprGroupBuild = new MultipartRequestGroupBuilder();
mprGroupBuild.setGroupId(new GroupId(input.getGroupId().getValue()));
caseBuilder.setMultipartRequestGroup(mprGroupBuild.build());
final MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(MultipartType.OFPMPGROUP, xid.getValue(), getVersion());
mprInput.setMultipartRequestBody(caseBuilder.build());
return mprInput.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.
the class MeterStatsService method buildRequest.
@Override
protected OfHeader buildRequest(final Xid xid, final GetMeterStatisticsInput input) throws ServiceException {
MultipartRequestMeterCaseBuilder caseBuilder = new MultipartRequestMeterCaseBuilder();
MultipartRequestMeterBuilder mprMeterBuild = new MultipartRequestMeterBuilder();
mprMeterBuild.setMeterId(new MeterId(input.getMeterId().getValue()));
caseBuilder.setMultipartRequestMeter(mprMeterBuild.build());
MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(MultipartType.OFPMPMETER, xid.getValue(), getVersion());
mprInput.setMultipartRequestBody(caseBuilder.build());
return mprInput.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.
the class PortStatsService method buildRequest.
@Override
protected OfHeader buildRequest(final Xid xid, final GetNodeConnectorStatisticsInput input) throws ServiceException {
MultipartRequestPortStatsCaseBuilder caseBuilder = new MultipartRequestPortStatsCaseBuilder();
MultipartRequestPortStatsBuilder mprPortStatsBuilder = new MultipartRequestPortStatsBuilder();
// Set specific port
final short version = getVersion();
mprPortStatsBuilder.setPortNo(InventoryDataServiceUtil.portNumberfromNodeConnectorId(OpenflowVersion.get(version), input.getNodeConnectorId()));
caseBuilder.setMultipartRequestPortStats(mprPortStatsBuilder.build());
MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(MultipartType.OFPMPPORTSTATS, xid.getValue(), version);
mprInput.setMultipartRequestBody(caseBuilder.build());
return mprInput.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.
the class FlowDirectStatisticsService method buildRequest.
@Override
protected OfHeader buildRequest(final Xid xid, final GetFlowStatisticsInput input) {
final MultipartRequestFlowBuilder mprFlowRequestBuilder = new MultipartRequestFlowBuilder();
if (input.getTableId() != null) {
mprFlowRequestBuilder.setTableId(input.getTableId());
} else {
mprFlowRequestBuilder.setTableId(OFConstants.OFPTT_ALL);
}
if (input.getOutPort() != null) {
mprFlowRequestBuilder.setOutPort(input.getOutPort().longValue());
} else {
mprFlowRequestBuilder.setOutPort(OFConstants.OFPP_ANY);
}
if (input.getOutGroup() != null) {
mprFlowRequestBuilder.setOutGroup(input.getOutGroup());
} else {
mprFlowRequestBuilder.setOutGroup(OFConstants.OFPG_ANY);
}
if (input.getCookie() != null) {
mprFlowRequestBuilder.setCookie(input.getCookie().getValue());
} else {
mprFlowRequestBuilder.setCookie(OFConstants.DEFAULT_COOKIE);
}
if (input.getCookieMask() != null) {
mprFlowRequestBuilder.setCookieMask(input.getCookieMask().getValue());
} else {
mprFlowRequestBuilder.setCookieMask(OFConstants.DEFAULT_COOKIE_MASK);
}
// convert and inject match
final Optional<Object> conversionMatch = getConvertorExecutor().convert(input.getMatch(), data);
MatchInjector.inject(conversionMatch, mprFlowRequestBuilder, data.getVersion());
return RequestInputUtils.createMultipartHeader(getMultipartType(), xid.getValue(), getVersion()).setMultipartRequestBody(new MultipartRequestFlowCaseBuilder().setMultipartRequestFlow(mprFlowRequestBuilder.build()).build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.
the class AllFlowsInAllTablesService method buildRequest.
@Override
protected OfHeader buildRequest(final Xid xid, final GetAllFlowsStatisticsFromAllFlowTablesInput input) throws ServiceException {
final MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(MultipartType.OFPMPFLOW, xid.getValue(), getVersion());
mprInput.setMultipartRequestBody(flowCase);
return mprInput.build();
}
Aggregations