X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=mdsalutil%2Fmdsalutil-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fvpnservice%2Fmdsalutil%2FMDSALUtil.java;h=27afd5c35c72ff6987db65c35aa625dd207fa231;hb=3510292a1184e25751f8690ea49a8c2312bba4b3;hp=1d10a69aca89c0432ba754c4cd27936ac1c1ec45;hpb=2c26fc05da6ff7672ae63d58bbc3d676ab319034;p=vpnservice.git diff --git a/mdsalutil/mdsalutil-api/src/main/java/org/opendaylight/vpnservice/mdsalutil/MDSALUtil.java b/mdsalutil/mdsalutil-api/src/main/java/org/opendaylight/vpnservice/mdsalutil/MDSALUtil.java index 1d10a69a..27afd5c3 100644 --- a/mdsalutil/mdsalutil-api/src/main/java/org/opendaylight/vpnservice/mdsalutil/MDSALUtil.java +++ b/mdsalutil/mdsalutil-api/src/main/java/org/opendaylight/vpnservice/mdsalutil/MDSALUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others. All rights reserved. + * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, @@ -38,9 +38,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.M import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCase; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.GoToTableCaseBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.WriteMetadataCaseBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActions; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.go.to.table._case.GoToTableBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.write.metadata._case.WriteMetadataBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder; @@ -244,7 +246,7 @@ public class MDSALUtil { return EMPTY_Instructions; } - protected static Match buildMatches(List listMatchInfo) { + public static Match buildMatches(List listMatchInfo) { if (listMatchInfo != null) { MatchBuilder matchBuilder = new MatchBuilder(); Map, Object> mapMatchBuilder = new HashMap, Object>(); @@ -361,6 +363,14 @@ public class MDSALUtil { .build()).setKey(new InstructionKey(instructionKey)).build(); } + public static Instruction buildAndGetGotoTableInstruction(short tableId, int instructionKey) { + return new InstructionBuilder() + .setInstruction( + new GoToTableCaseBuilder().setGoToTable( + new GoToTableBuilder().setTableId(tableId).build()).build()) + .setKey(new InstructionKey(instructionKey)).build(); + } + public static Optional read(LogicalDatastoreType datastoreType, InstanceIdentifier path, DataBroker broker) { @@ -473,8 +483,11 @@ public class MDSALUtil { NodeConnectorRef ref) { Optional nc = (Optional) read( dataBroker, - LogicalDatastoreType.CONFIGURATION, ref.getValue()); - return nc.get().getId(); + LogicalDatastoreType.OPERATIONAL, ref.getValue()); + if(nc.isPresent()){ + return nc.get().getId(); + } + return null; } }