blob: 129fec5f3334ae9d8a2e37db925d52f635f798fe [file] [log] [blame]
Jian Liae3fcff2018-07-30 11:55:44 +09001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
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.openstacktelemetry.impl;
17
18import com.google.common.collect.ImmutableSet;
19import com.google.common.collect.Sets;
20import org.onosproject.openstacktelemetry.api.FlowInfo;
21import org.onosproject.openstacktelemetry.api.OpenstackTelemetryService;
22import org.onosproject.openstacktelemetry.api.TelemetryService;
23
24import java.util.Set;
25
26/**
27 * A mock up test class of openstack telemetry service.
28 */
29public class OpenstackTelemetryServiceAdapter implements OpenstackTelemetryService {
30
31 Set<TelemetryService> services = Sets.newConcurrentHashSet();
32
33 @Override
34 public void addTelemetryService(TelemetryService telemetryService) {
35 services.add(telemetryService);
36 }
37
38 @Override
39 public void removeTelemetryService(TelemetryService telemetryService) {
40 services.remove(telemetryService);
41 }
42
43 @Override
44 public void publish(Set<FlowInfo> flowInfos) {
45
46 }
47
48 @Override
49 public Set<TelemetryService> telemetryServices() {
50 return ImmutableSet.copyOf(services);
51 }
52}