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 | */ |
Yuta HIGUCHI | 9ee60f6 | 2014-10-09 10:00:01 -0700 | [diff] [blame] | 16 | package org.onlab.onos.store.serializers; |
| 17 | |
Yuta HIGUCHI | 8ce0873 | 2014-10-11 10:40:45 -0700 | [diff] [blame] | 18 | import org.onlab.onos.store.impl.MastershipBasedTimestamp; |
Yuta HIGUCHI | eecee55 | 2014-10-16 14:09:01 -0700 | [diff] [blame] | 19 | import org.onlab.onos.store.impl.Timestamped; |
Madan Jampani | b5e9b1d | 2014-10-13 14:18:39 -0700 | [diff] [blame] | 20 | import org.onlab.onos.store.impl.WallClockTimestamp; |
Yuta HIGUCHI | 8d143d2 | 2014-10-19 23:15:09 -0700 | [diff] [blame] | 21 | import org.onlab.util.KryoNamespace; |
Yuta HIGUCHI | 9ee60f6 | 2014-10-09 10:00:01 -0700 | [diff] [blame] | 22 | |
| 23 | public final class DistributedStoreSerializers { |
| 24 | |
| 25 | /** |
Yuta HIGUCHI | 8d143d2 | 2014-10-19 23:15:09 -0700 | [diff] [blame] | 26 | * KryoNamespace which can serialize ON.lab misc classes. |
Yuta HIGUCHI | 9ee60f6 | 2014-10-09 10:00:01 -0700 | [diff] [blame] | 27 | */ |
Yuta HIGUCHI | 8d143d2 | 2014-10-19 23:15:09 -0700 | [diff] [blame] | 28 | public static final KryoNamespace COMMON = KryoNamespace.newBuilder() |
| 29 | .register(KryoNamespaces.API) |
Yuta HIGUCHI | 9ee60f6 | 2014-10-09 10:00:01 -0700 | [diff] [blame] | 30 | .register(Timestamped.class) |
| 31 | .register(MastershipBasedTimestamp.class, new MastershipBasedTimestampSerializer()) |
Madan Jampani | b5e9b1d | 2014-10-13 14:18:39 -0700 | [diff] [blame] | 32 | .register(WallClockTimestamp.class) |
Yuta HIGUCHI | 9ee60f6 | 2014-10-09 10:00:01 -0700 | [diff] [blame] | 33 | .build(); |
| 34 | |
| 35 | // avoid instantiation |
| 36 | private DistributedStoreSerializers() {} |
| 37 | } |