Search in sources :

Example 41 with Uri

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri in project openflowplugin by opendaylight.

the class LLDPPacketPuntEnforcer method createSendToControllerInstructions.

private static InstructionsBuilder createSendToControllerInstructions() {
    final List<Action> actionList = new ArrayList<>();
    ActionBuilder ab = new ActionBuilder();
    OutputActionBuilder output = new OutputActionBuilder();
    output.setMaxLength(OFConstants.OFPCML_NO_BUFFER);
    Uri value = new Uri(OutputPortValues.CONTROLLER.toString());
    output.setOutputNodeConnector(value);
    ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
    ab.setOrder(0);
    ab.setKey(new ActionKey(0));
    actionList.add(ab.build());
    // Create an Apply Action
    ApplyActionsBuilder aab = new ApplyActionsBuilder();
    aab.setAction(actionList);
    // Wrap our Apply Action in an Instruction
    InstructionBuilder ib = new InstructionBuilder();
    ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
    ib.setOrder(0);
    ib.setKey(new InstructionKey(0));
    // Put our Instruction in a list of Instructions
    InstructionsBuilder isb = new InstructionsBuilder();
    List<Instruction> instructions = new ArrayList<>();
    instructions.add(ib.build());
    isb.setInstruction(instructions);
    return isb;
}
Also used : OutputActionCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCaseBuilder) InstructionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder) Action(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action) OutputActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder) ActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder) ArrayList(java.util.ArrayList) InstructionKey(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey) ActionKey(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey) Instruction(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction) Uri(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri) InstructionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder) ApplyActionsCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder) OutputActionBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder) ApplyActionsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder)

Example 42 with Uri

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri in project openflowplugin by opendaylight.

the class GroupForwarder method add.

@Override
public Future<RpcResult<AddGroupOutput>> add(final InstanceIdentifier<Group> identifier, final Group addDataObj, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
    final Group group = addDataObj;
    final AddGroupInputBuilder builder = new AddGroupInputBuilder(group);
    builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
    builder.setGroupRef(new GroupRef(identifier));
    builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
    return this.provider.getSalGroupService().addGroup(builder.build());
}
Also used : StaleGroup(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.StaleGroup) Group(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group) NodeRef(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef) GroupRef(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef) Uri(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri) AddGroupInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInputBuilder)

Example 43 with Uri

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri 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");
}
Also used : StaleGroup(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.StaleGroup) Group(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group) NodeRef(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) RemoveGroupInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInputBuilder) GroupRef(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupRef) Uri(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri)

Example 44 with Uri

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri in project openflowplugin by opendaylight.

the class TableForwarder method update.

@Override
public void update(final InstanceIdentifier<TableFeatures> identifier, final TableFeatures original, final TableFeatures update, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
    LOG.debug("Received the Table Update request [Tbl id, node Id, original, upd" + " " + identifier + " " + nodeIdent + " " + original + " " + update);
    final TableFeatures originalTableFeatures = original;
    TableFeatures updatedTableFeatures;
    if (null == update) {
        updatedTableFeatures = original;
    } else {
        updatedTableFeatures = update;
    }
    final UpdateTableInputBuilder builder = new UpdateTableInputBuilder();
    builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
    // TODO: reconsider model - this particular field is not used in service
    // implementation
    builder.setTableRef(new TableRef(identifier));
    builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
    builder.setUpdatedTable(new UpdatedTableBuilder().setTableFeatures(Collections.singletonList(updatedTableFeatures)).build());
    builder.setOriginalTable(new OriginalTableBuilder().setTableFeatures(Collections.singletonList(originalTableFeatures)).build());
    LOG.debug("Invoking SalTableService ");
    if (this.provider.getSalTableService() != null) {
        LOG.debug(" Handle to SalTableServices" + this.provider.getSalTableService());
    }
    final Future<RpcResult<UpdateTableOutput>> resultFuture = this.provider.getSalTableService().updateTable(builder.build());
    JdkFutures.addErrorLogging(resultFuture, LOG, "updateTable");
}
Also used : NodeRef(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef) OriginalTableBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.table.update.OriginalTableBuilder) TableFeatures(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) UpdatedTableBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.table.update.UpdatedTableBuilder) UpdateTableInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableInputBuilder) Uri(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri) TableRef(org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableRef)

Example 45 with Uri

use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri in project openflowplugin by opendaylight.

the class FlowForwarder method remove.

@Override
public void remove(final InstanceIdentifier<Flow> identifier, final Flow removeDataObj, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
    final TableKey tableKey = identifier.firstKeyOf(Table.class, TableKey.class);
    if (tableIdValidationPrecondition(tableKey, removeDataObj)) {
        final RemoveFlowInputBuilder builder = new RemoveFlowInputBuilder(removeDataObj);
        builder.setFlowRef(new FlowRef(identifier));
        builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
        builder.setFlowTable(new FlowTableRef(nodeIdent.child(Table.class, tableKey)));
        // This method is called only when a given flow object has been
        // removed from datastore. So FRM always needs to set strict flag
        // into remove-flow input so that only a flow entry associated with
        // a given flow object is removed.
        builder.setTransactionUri(new Uri(provider.getNewTransactionId())).setStrict(Boolean.TRUE);
        final Future<RpcResult<RemoveFlowOutput>> resultFuture = provider.getSalFlowService().removeFlow(builder.build());
        JdkFutures.addErrorLogging(resultFuture, LOG, "removeFlow");
    }
}
Also used : NodeRef(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef) FlowTableRef(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowTableRef) FlowRef(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowRef) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) RemoveFlowInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInputBuilder) TableKey(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey) Uri(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri)

Aggregations

Uri (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri)61 ArrayList (java.util.ArrayList)29 OutputActionCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCaseBuilder)26 OutputActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder)26 ActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder)22 Action (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action)19 ActionKey (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey)18 GroupActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.group.action._case.GroupActionBuilder)17 PushMplsActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.mpls.action._case.PushMplsActionBuilder)16 PushPbbActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.pbb.action._case.PushPbbActionBuilder)16 SetMplsTtlActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.mpls.ttl.action._case.SetMplsTtlActionBuilder)16 PopMplsActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.mpls.action._case.PopMplsActionBuilder)15 PopPbbActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.pbb.action._case.PopPbbActionBuilder)15 PopVlanActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.vlan.action._case.PopVlanActionBuilder)15 PushVlanActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.push.vlan.action._case.PushVlanActionBuilder)15 SetNwTtlActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.nw.ttl.action._case.SetNwTtlActionBuilder)15 SetQueueActionBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.queue.action._case.SetQueueActionBuilder)15 NodeRef (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef)14 NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)9 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)9