blob: 62f00aaf6a5b3867ffcb0ba9bcee3ec980eb33f0 [file] [log] [blame]
Shankara-Huaweid5823ab2016-11-22 10:14:52 +05301/*
2 * Copyright 2016-present Open Networking Laboratory
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 */
16
17package org.onosproject.yms.app.ymsm;
18
19import org.onosproject.core.ApplicationId;
20import org.onosproject.core.CoreService;
21import org.onosproject.core.IdGenerator;
22import org.onosproject.core.Version;
23
24import java.util.Set;
25import java.util.concurrent.atomic.AtomicLong;
26
27/**
28 * Represents implementation of CoreService interfaces.
29 */
30public class MockCoreService implements CoreService {
31 @Override
32 public Version version() {
33 return null;
34 }
35
36 @Override
37 public Set<ApplicationId> getAppIds() {
38 return null;
39 }
40
41 @Override
42 public ApplicationId getAppId(Short id) {
43 return null;
44 }
45
46 @Override
47 public ApplicationId getAppId(String name) {
48 return null;
49 }
50
51 @Override
52 public ApplicationId registerApplication(String name) {
53 return null;
54 }
55
56 @Override
57 public ApplicationId registerApplication(String name,
58 Runnable preDeactivate) {
59 return null;
60 }
61
62 @Override
63 public IdGenerator getIdGenerator(String topic) {
64 return new IdGenerator() {
65 private AtomicLong counter = new AtomicLong(0);
66
67 @Override
68 public long getNewId() {
69 return counter.getAndIncrement();
70 }
71 };
72 }
73}