X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fapi%2FOFConstants.java;h=37aac3072444d78034c821f4ace7f058b3cb27b0;hb=777c94332871b8c34f56f7f2010de1536cb759ba;hp=07b43308f78963badb30b33e3623873163c3ebbc;hpb=e24d613b2b6f151c424750e062215baab60880f1;p=openflowplugin.git diff --git a/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/OFConstants.java b/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/OFConstants.java index 07b43308f7..37aac30724 100644 --- a/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/OFConstants.java +++ b/openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/OFConstants.java @@ -7,11 +7,11 @@ */ package org.opendaylight.openflowplugin.api; -import com.google.common.collect.ImmutableList; import java.util.List; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match; import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder; +import org.opendaylight.yangtools.yang.common.ErrorTag; import org.opendaylight.yangtools.yang.common.Uint16; import org.opendaylight.yangtools.yang.common.Uint32; import org.opendaylight.yangtools.yang.common.Uint64; @@ -21,11 +21,6 @@ import org.opendaylight.yangtools.yang.common.Uint8; * OFP related constants. */ public final class OFConstants { - - private OFConstants() { - throw new UnsupportedOperationException("OF plugin Constants holder class"); - } - /** enum ofp_port_no, reserved port: process with normal L2/L3 switching. */ public static final short OFPP_NORMAL = (short)0xfffa; /** enum ofp_port_no, reserved port: all physical ports except input port. */ @@ -34,9 +29,9 @@ public final class OFConstants { public static final short OFPP_LOCAL = (short)0xfffe; /** openflow protocol 1.0 - version identifier. */ - public static final short OFP_VERSION_1_0 = 0x01; + public static final Uint8 OFP_VERSION_1_0 = Uint8.ONE; /** openflow protocol 1.3 - version identifier. */ - public static final short OFP_VERSION_1_3 = 0x04; + public static final Uint8 OFP_VERSION_1_3 = Uint8.valueOf(0x04); public static final String OF_URI_PREFIX = "openflow:"; @@ -68,23 +63,21 @@ public final class OFConstants { public static final Uint32 OFP_NO_BUFFER = Uint32.valueOf(0xffffffffL).intern(); /** enum ofp_controller_max_len: indicates that no buffering should be applied and the whole packet is to be * sent to the controller. */ - public static final Integer OFPCML_NO_BUFFER = 0xffff; + public static final Uint16 OFPCML_NO_BUFFER = Uint16.MAX_VALUE; public static final int MAC_ADDRESS_LENGTH = 6; - public static final int SIZE_OF_LONG_IN_BYTES = 8; public static final int SIGNUM_UNSIGNED = 1; /** RpcError application tag. */ - public static final String APPLICATION_TAG = "OPENFLOW_PLUGIN"; - /** RpcError tag - timeout. */ - public static final String ERROR_TAG_TIMEOUT = "TIMOUT"; + public static final ErrorTag APPLICATION_TAG = new ErrorTag("OPENFLOW_PLUGIN"); /** Persistent ID of OpenFlowPlugin configuration file. */ public static final String CONFIG_FILE_ID = "org.opendaylight.openflowplugin"; /** supported version ordered by height (highest version is at the beginning). */ - public static final List VERSION_ORDER = ImmutableList - .builder() - .add((short) 0x04, (short) 0x01) - .build(); + public static final List VERSION_ORDER = List.of(OFP_VERSION_1_3, OFP_VERSION_1_0); + + private OFConstants() { + // Hidden on purpose + } }