Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 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 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.store.host.impl; |
Madan Jampani | fd26ffb | 2014-10-13 14:08:55 -0700 | [diff] [blame] | 17 | |
| 18 | import static org.slf4j.LoggerFactory.getLogger; |
| 19 | |
| 20 | import org.apache.felix.scr.annotations.Activate; |
| 21 | import org.apache.felix.scr.annotations.Component; |
| 22 | import org.apache.felix.scr.annotations.Deactivate; |
| 23 | import org.apache.felix.scr.annotations.Service; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 24 | import org.onosproject.net.HostId; |
| 25 | import org.onosproject.net.host.HostClockService; |
| 26 | import org.onosproject.store.Timestamp; |
| 27 | import org.onosproject.store.impl.WallClockTimestamp; |
Madan Jampani | fd26ffb | 2014-10-13 14:08:55 -0700 | [diff] [blame] | 28 | import org.slf4j.Logger; |
| 29 | |
| 30 | /** |
| 31 | * HostClockService to issue Timestamps based on local wallclock time. |
| 32 | */ |
| 33 | @Component(immediate = true) |
| 34 | @Service |
| 35 | public class HostClockManager implements HostClockService { |
| 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 |
Madan Jampani | b5e9b1d | 2014-10-13 14:18:39 -0700 | [diff] [blame] | 50 | public Timestamp getTimestamp(HostId hostId) { |
Madan Jampani | fd26ffb | 2014-10-13 14:08:55 -0700 | [diff] [blame] | 51 | return new WallClockTimestamp(); |
| 52 | } |
| 53 | } |