2 * Copyright (c) 2021 PANTHEON.tech, s.r.o. 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.eos.akka.owner.supervisor.command;
10 import com.google.common.collect.ImmutableMap;
11 import com.google.common.collect.ImmutableSetMultimap;
12 import java.io.Serializable;
15 import org.opendaylight.mdsal.eos.dom.api.DOMEntity;
17 public final class GetEntitiesBackendReply extends OwnerSupervisorReply implements Serializable {
18 private static final long serialVersionUID = 1L;
20 private final ImmutableSetMultimap<DOMEntity, String> candidates;
21 private final ImmutableMap<DOMEntity, String> owners;
23 public GetEntitiesBackendReply(final Map<DOMEntity, String> owners, final Map<DOMEntity, Set<String>> candidates) {
24 final ImmutableSetMultimap.Builder<DOMEntity, String> builder = ImmutableSetMultimap.builder();
25 for (Map.Entry<DOMEntity, Set<String>> entry : candidates.entrySet()) {
26 builder.putAll(entry.getKey(), entry.getValue());
28 this.candidates = builder.build();
29 this.owners = ImmutableMap.copyOf(owners);
32 public ImmutableSetMultimap<DOMEntity, String> getCandidates() {
36 public ImmutableMap<DOMEntity, String> getOwners() {