2 * Copyright (c) 2016 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.controller.cluster.datastore;
10 import org.opendaylight.controller.cluster.access.concepts.ClientIdentifier;
11 import org.opendaylight.controller.cluster.access.concepts.FrontendIdentifier;
12 import org.opendaylight.controller.cluster.access.concepts.FrontendType;
13 import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier;
14 import org.opendaylight.controller.cluster.access.concepts.MemberName;
15 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
17 public final class MockIdentifiers {
18 public static ClientIdentifier clientIdentifier(final Class<?> clazz, final String memberName) {
19 return ClientIdentifier.create(FrontendIdentifier.create(MemberName.forName(memberName),
20 FrontendType.forName(clazz.getSimpleName())), 0);
23 public static LocalHistoryIdentifier historyIdentifier(final Class<?> clazz, final String memberName) {
24 return new LocalHistoryIdentifier(clientIdentifier(clazz, memberName), 0);
27 public static TransactionIdentifier transactionIdentifier(final Class<?> clazz, final String memberName) {
28 return new TransactionIdentifier(historyIdentifier(clazz, memberName), 0);