Search in sources :

Example 1 with StypeOpenflowBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.StypeOpenflowBuilder in project netvirt by opendaylight.

the class GeniusProvider method bindService.

private void bindService(InstanceIdentifier<BoundServices> id, short serviceId, String serviceName, int servicePriority, short serviceDestTable, BigInteger serviceTableCookie, List<Action> extraActions) {
    InstructionsBuilder isb = extraActions.isEmpty() ? new InstructionsBuilder() : OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(extraActions);
    isb = OpenFlow13Utils.appendGotoTableInstruction(isb, serviceDestTable);
    StypeOpenflow stypeOpenflow = new StypeOpenflowBuilder().setFlowCookie(serviceTableCookie).setFlowPriority(servicePriority).setInstruction(isb.build().getInstruction()).build();
    BoundServices boundServices = new BoundServicesBuilder().setServiceName(serviceName).setServicePriority(serviceId).setServiceType(ServiceTypeFlowBased.class).addAugmentation(StypeOpenflow.class, stypeOpenflow).build();
    LOG.info("Binding Service ID [{}] name [{}] priority [{}] table [{}] cookie [{}] extraActions [{}]", serviceId, serviceName, servicePriority, serviceDestTable, serviceTableCookie, extraActions);
    MDSALUtil.syncWrite(this.dataBroker, LogicalDatastoreType.CONFIGURATION, id, boundServices);
}
Also used : BoundServices(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices) StypeOpenflowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.StypeOpenflowBuilder) StypeOpenflow(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.StypeOpenflow) BoundServicesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServicesBuilder) InstructionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder)

Aggregations

InstructionsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder)1 StypeOpenflow (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.StypeOpenflow)1 StypeOpenflowBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.StypeOpenflowBuilder)1 BoundServices (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices)1 BoundServicesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServicesBuilder)1