blob: 2670817c0ba33746593176c8a101c7b3c2bf73c7 [file] [log] [blame]
Ray Milkeycd6ab182016-02-03 11:13:09 -08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Ray Milkeycd6ab182016-02-03 11:13:09 -08003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.net.link;
17
18import java.util.Set;
19
20import org.onosproject.net.provider.ProviderId;
21
22import com.google.common.collect.ImmutableSet;
23
24/**
25 * Testing adapter for the LinkProviderRegistry API.
26 */
27public class LinkProviderRegistryAdapter implements LinkProviderRegistry {
28
29 LinkProviderServiceAdapter providerService = null;
30
31 @Override
32 public LinkProviderService register(LinkProvider provider) {
33 providerService = new LinkProviderServiceAdapter(provider);
34 return providerService;
35 }
36
37 @Override
38 public void unregister(LinkProvider provider) {
39 }
40
41 @Override
42 public Set<ProviderId> getProviders() {
43 return ImmutableSet.of(providerService.provider().id());
44 }
45
46 public LinkProviderServiceAdapter registeredProvider() {
47 return providerService;
48 }
49}