2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.common.api;
10 import java.io.DataInput;
11 import java.io.DataOutput;
12 import java.io.IOException;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.yangtools.concepts.WritableObject;
17 * The concept of a logical data store, similar to RFC8342.
19 // FIXME: 3.0.0: turn this into an interface so it can be externally-defined?
20 // FIXME: 3.0.0: note that mount points can have different types and policies, which can potentially be mapped
21 public enum LogicalDatastoreType implements WritableObject {
23 * Logical datastore representing operational state of the system and it's components. This datastore is used
24 * to describe operational state of the system and it's operation related data.
29 * <li>contain both {@code config=true} and {@code config=false} nodes</li>
30 * <li>be replicated across all nodes by default, individual shards may have different strategies, which need to
37 * Logical Datastore representing configuration state of the system and it's components. This datastore is used
38 * to describe intended state of the system and intended operation mode.
43 * <li>contain only {@code config=true} nodes</li>
44 * <li>be replicated across all nodes by default, individual shards may have different strategies, which need to
47 * <li>be persisted on all nodes by default, individual shards may have different strategies, which need to
54 private int serialized;
56 LogicalDatastoreType(final int serialized) {
57 this.serialized = serialized;
61 public void writeTo(final DataOutput out) throws IOException {
62 out.writeByte(serialized);
65 public static @NonNull LogicalDatastoreType readFrom(final DataInput in) throws IOException {
66 final byte serialized = in.readByte();
73 throw new IOException("Unknown type " + serialized);