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
9 package org.opendaylight.controller.cluster.datastore.messages;
11 import org.opendaylight.controller.cluster.datastore.util.InstanceIdentifierUtils;
12 import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
13 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
15 public class DeleteData implements SerializableMessage {
17 public static final Class<ShardTransactionMessages.DeleteData> SERIALIZABLE_CLASS = ShardTransactionMessages.DeleteData.class;
19 private final YangInstanceIdentifier path;
21 public DeleteData(final YangInstanceIdentifier path) {
25 public YangInstanceIdentifier getPath() {
29 @Override public Object toSerializable() {
30 return ShardTransactionMessages.DeleteData.newBuilder()
31 .setInstanceIdentifierPathArguments(InstanceIdentifierUtils.toSerializable(path)).build();
34 public static DeleteData fromSerializable(final Object serializable){
35 ShardTransactionMessages.DeleteData o = (ShardTransactionMessages.DeleteData) serializable;
36 return new DeleteData(InstanceIdentifierUtils.fromSerializable(o.getInstanceIdentifierPathArguments()));