8c3622a8c950c32fd7f7430e7a8df6f158cdeb7c
[openflowplugin.git] / applications / statistics-manager / src / test / java / test / mock / util / EntityOwnershipServiceMock.java
1 package test.mock.util;
2
3 import com.google.common.base.Optional;
4 import org.opendaylight.controller.md.sal.common.api.clustering.*;
5
6 import javax.annotation.Nonnull;
7
8 /**
9  * Created by vishnoianil on 1/13/16.
10  */
11 public class EntityOwnershipServiceMock implements EntityOwnershipService {
12     @Override
13     public EntityOwnershipCandidateRegistration registerCandidate(@Nonnull Entity entity) throws CandidateAlreadyRegisteredException {
14         return null;
15     }
16
17     @Override
18     public EntityOwnershipListenerRegistration registerListener(@Nonnull String entityType, @Nonnull EntityOwnershipListener listener) {
19         return null;
20     }
21
22     @Override
23     public Optional<EntityOwnershipState> getOwnershipState(@Nonnull Entity forEntity) {
24         return Optional.of(new EntityOwnershipState(true,true));
25     }
26
27     @Override
28     public boolean isCandidateRegistered(@Nonnull Entity entity) {
29         return true;
30     }
31 }