X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fnode%2Futils%2Fstream%2FAbstractLithiumDataInput.java;h=3ef0defdc8d46e3281bb8d8449d3f9cd5a9da435;hb=bd7cfec55803f40773eda2412e7b93a3fefd3f9c;hp=bab9143baebb73fced5888a5afffe7f83dbaafaa;hpb=cfa32c0058c51a993e5b3e390acf49d7aaeac433;p=controller.git diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractLithiumDataInput.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractLithiumDataInput.java index bab9143bae..3ef0defdc8 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractLithiumDataInput.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractLithiumDataInput.java @@ -67,43 +67,43 @@ abstract class AbstractLithiumDataInput extends AbstractNormalizedNodeDataInput private void streamNormalizedNode(final NormalizedNodeStreamWriter writer, final byte nodeType) throws IOException { switch (nodeType) { - case NodeTypes.ANY_XML_NODE: + case LithiumNode.ANY_XML_NODE: streamAnyxml(writer); break; - case NodeTypes.AUGMENTATION_NODE: + case LithiumNode.AUGMENTATION_NODE: streamAugmentation(writer); break; - case NodeTypes.CHOICE_NODE: + case LithiumNode.CHOICE_NODE: streamChoice(writer); break; - case NodeTypes.CONTAINER_NODE: + case LithiumNode.CONTAINER_NODE: streamContainer(writer); break; - case NodeTypes.LEAF_NODE: + case LithiumNode.LEAF_NODE: streamLeaf(writer); break; - case NodeTypes.LEAF_SET: + case LithiumNode.LEAF_SET: streamLeafSet(writer); break; - case NodeTypes.ORDERED_LEAF_SET: + case LithiumNode.ORDERED_LEAF_SET: streamOrderedLeafSet(writer); break; - case NodeTypes.LEAF_SET_ENTRY_NODE: + case LithiumNode.LEAF_SET_ENTRY_NODE: streamLeafSetEntry(writer); break; - case NodeTypes.MAP_ENTRY_NODE: + case LithiumNode.MAP_ENTRY_NODE: streamMapEntry(writer); break; - case NodeTypes.MAP_NODE: + case LithiumNode.MAP_NODE: streamMap(writer); break; - case NodeTypes.ORDERED_MAP_NODE: + case LithiumNode.ORDERED_MAP_NODE: streamOrderedMap(writer); break; - case NodeTypes.UNKEYED_LIST: + case LithiumNode.UNKEYED_LIST: streamUnkeyedList(writer); break; - case NodeTypes.UNKEYED_LIST_ITEM: + case LithiumNode.UNKEYED_LIST_ITEM: streamUnkeyedListItem(writer); break; default: @@ -221,8 +221,8 @@ abstract class AbstractLithiumDataInput extends AbstractNormalizedNodeDataInput writer.startMapEntryNode(entryIdentifier, NormalizedNodeStreamWriter.UNKNOWN_SIZE); // Same loop as commonStreamContainer(), but ... - for (byte nodeType = input.readByte(); nodeType != NodeTypes.END_NODE; nodeType = input.readByte()) { - if (nodeType == NodeTypes.LEAF_NODE) { + for (byte nodeType = input.readByte(); nodeType != LithiumNode.END_NODE; nodeType = input.readByte()) { + if (nodeType == LithiumNode.LEAF_NODE) { // ... leaf nodes may need de-duplication streamLeaf(writer, entryIdentifier); } else { @@ -247,7 +247,7 @@ abstract class AbstractLithiumDataInput extends AbstractNormalizedNodeDataInput } private void commonStreamContainer(final NormalizedNodeStreamWriter writer) throws IOException { - for (byte nodeType = input.readByte(); nodeType != NodeTypes.END_NODE; nodeType = input.readByte()) { + for (byte nodeType = input.readByte(); nodeType != LithiumNode.END_NODE; nodeType = input.readByte()) { streamNormalizedNode(writer, nodeType); } writer.endNode(); @@ -339,54 +339,54 @@ abstract class AbstractLithiumDataInput extends AbstractNormalizedNodeDataInput private Object readObject() throws IOException { byte objectType = input.readByte(); switch (objectType) { - case ValueTypes.BITS_TYPE: + case LithiumValue.BITS_TYPE: return readObjSet(); - case ValueTypes.BOOL_TYPE: + case LithiumValue.BOOL_TYPE: return input.readBoolean(); - case ValueTypes.BYTE_TYPE: + case LithiumValue.BYTE_TYPE: return input.readByte(); - case ValueTypes.INT_TYPE: + case LithiumValue.INT_TYPE: return input.readInt(); - case ValueTypes.LONG_TYPE: + case LithiumValue.LONG_TYPE: return input.readLong(); - case ValueTypes.QNAME_TYPE: + case LithiumValue.QNAME_TYPE: return readQName(); - case ValueTypes.SHORT_TYPE: + case LithiumValue.SHORT_TYPE: return input.readShort(); - case ValueTypes.STRING_TYPE: + case LithiumValue.STRING_TYPE: return input.readUTF(); - case ValueTypes.STRING_BYTES_TYPE: + case LithiumValue.STRING_BYTES_TYPE: return readStringBytes(); - case ValueTypes.BIG_DECIMAL_TYPE: + case LithiumValue.BIG_DECIMAL_TYPE: return new BigDecimal(input.readUTF()); - case ValueTypes.BIG_INTEGER_TYPE: + case LithiumValue.BIG_INTEGER_TYPE: return new BigInteger(input.readUTF()); - case ValueTypes.BINARY_TYPE: + case LithiumValue.BINARY_TYPE: byte[] bytes = new byte[input.readInt()]; input.readFully(bytes); return bytes; - case ValueTypes.YANG_IDENTIFIER_TYPE: + case LithiumValue.YANG_IDENTIFIER_TYPE: return readYangInstanceIdentifierInternal(); - case ValueTypes.EMPTY_TYPE: + case LithiumValue.EMPTY_TYPE: // Leaf nodes no longer allow null values and thus we no longer emit null values. Previously, the "empty" // yang type was represented as null so we translate an incoming null value to Empty. It was possible for // a BI user to set a string leaf to null and we're rolling the dice here but the chances for that are // very low. We'd have to know the yang type but, even if we did, we can't let a null value pass upstream // so we'd have to drop the leaf which might cause other issues. - case ValueTypes.NULL_TYPE: + case LithiumValue.NULL_TYPE: return Empty.getInstance(); default: @@ -429,13 +429,13 @@ abstract class AbstractLithiumDataInput extends AbstractNormalizedNodeDataInput int type = input.readByte(); switch (type) { - case PathArgumentTypes.AUGMENTATION_IDENTIFIER: + case LithiumPathArgument.AUGMENTATION_IDENTIFIER: return readAugmentationIdentifier(); - case PathArgumentTypes.NODE_IDENTIFIER: + case LithiumPathArgument.NODE_IDENTIFIER: return readNodeIdentifier(); - case PathArgumentTypes.NODE_IDENTIFIER_WITH_PREDICATES: + case LithiumPathArgument.NODE_IDENTIFIER_WITH_PREDICATES: return readNormalizedNodeWithPredicates(); - case PathArgumentTypes.NODE_IDENTIFIER_WITH_VALUE: + case LithiumPathArgument.NODE_IDENTIFIER_WITH_VALUE: return new NodeWithValue<>(readQName(), readObject()); default: // FIXME: throw hard error