blob: a0d7d2f7fe57e88291e1ef532b2b004639088145 [file] [log] [blame]
Jonathan Hart5573d322015-01-21 10:13:25 -08001/*
2 * Copyright 2015 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 */
16package org.onosproject.store.intent.impl;
17
18import org.apache.felix.scr.annotations.Activate;
19import org.apache.felix.scr.annotations.Component;
20import org.apache.felix.scr.annotations.Deactivate;
21import org.apache.felix.scr.annotations.Service;
22import org.onosproject.net.intent.IntentClockService;
23import org.onosproject.net.intent.IntentId;
24import org.onosproject.store.Timestamp;
Jonathan Hart63939a32015-05-08 11:57:03 -070025import org.onosproject.store.service.WallClockTimestamp;
Jonathan Hart5573d322015-01-21 10:13:25 -080026import org.slf4j.Logger;
27
28import static org.slf4j.LoggerFactory.getLogger;
29
30/**
31 * IntentClockService that issues timestamps based on local wallclock time.
32 */
33@Component(immediate = true)
34@Service
35public class IntentClockManager implements IntentClockService {
36
37 private final Logger log = getLogger(getClass());
38
39 @Activate
40 public void activate() {
41 log.info("Started");
42 }
43
44 @Deactivate
45 public void deactivate() {
46 log.info("Stopped");
47 }
48
49 @Override
50 public Timestamp getTimestamp(IntentId intentId) {
51 return new WallClockTimestamp();
52 }
53}