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