Bug 5596 Initial commit failed
[openflowplugin.git] / applications / forwardingrules-manager / src / test / java / test / mock / util / EntityOwnershipServiceMock.java
1 /*
2  * Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package test.mock.util;
10
11 import com.google.common.base.Optional;
12 import org.opendaylight.controller.md.sal.common.api.clustering.*;
13
14 import javax.annotation.Nonnull;
15
16 /**
17  * Created by vishnoianil on 2/4/16.
18  */
19 public class EntityOwnershipServiceMock implements EntityOwnershipService {
20     @Override
21     public EntityOwnershipCandidateRegistration registerCandidate(@Nonnull Entity entity) throws CandidateAlreadyRegisteredException {
22         return null;
23     }
24
25     @Override
26     public EntityOwnershipListenerRegistration registerListener(@Nonnull String entityType, @Nonnull EntityOwnershipListener listener) {
27         return null;
28     }
29
30     @Override
31     public Optional<EntityOwnershipState> getOwnershipState(@Nonnull Entity forEntity) {
32         return Optional.of(new EntityOwnershipState(true, true));
33     }
34
35     @Override
36     public boolean isCandidateRegistered(@Nonnull Entity entity) {
37         return false;
38     }
39 }