Search in sources :

Example 1 with BoundServicesBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServicesBuilder in project genius by opendaylight.

the class InterfaceServiceUtil method buildServiceInfo.

public static ServicesInfo buildServiceInfo(String serviceName, int servicePriority) {
    List<BoundServices> boundService = new ArrayList<>();
    boundService.add(new BoundServicesBuilder().setServicePriority((short) servicePriority).setServiceName(serviceName).build());
    return new ServicesInfoBuilder().setBoundServices(boundService).setKey(new ServicesInfoKey(serviceName, ServiceModeIngress.class)).build();
}
Also used : BoundServices(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices) ServicesInfoKey(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfoKey) ServicesInfoBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfoBuilder) ArrayList(java.util.ArrayList) BoundServicesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServicesBuilder)

Example 2 with BoundServicesBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServicesBuilder 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

BoundServices (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices)2 BoundServicesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServicesBuilder)2 ArrayList (java.util.ArrayList)1 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 ServicesInfoBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfoBuilder)1 ServicesInfoKey (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfoKey)1