blob: 2de47bdba4d23e32bb81de9f48bc954ac4b0e520 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
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 HIGUCHI60a190b2014-11-07 16:24:47 -080016package org.onlab.onos.store.serializers.impl;
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070017
Yuta HIGUCHI8ce08732014-10-11 10:40:45 -070018import org.onlab.onos.store.impl.MastershipBasedTimestamp;
Yuta HIGUCHIeecee552014-10-16 14:09:01 -070019import org.onlab.onos.store.impl.Timestamped;
Madan Jampanib5e9b1d2014-10-13 14:18:39 -070020import org.onlab.onos.store.impl.WallClockTimestamp;
Yuta HIGUCHI60a190b2014-11-07 16:24:47 -080021import org.onlab.onos.store.serializers.KryoNamespaces;
Yuta HIGUCHI8d143d22014-10-19 23:15:09 -070022import org.onlab.util.KryoNamespace;
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070023
24public final class DistributedStoreSerializers {
25
26 /**
Yuta HIGUCHI8d143d22014-10-19 23:15:09 -070027 * KryoNamespace which can serialize ON.lab misc classes.
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070028 */
Yuta HIGUCHI8d143d22014-10-19 23:15:09 -070029 public static final KryoNamespace COMMON = KryoNamespace.newBuilder()
30 .register(KryoNamespaces.API)
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070031 .register(Timestamped.class)
32 .register(MastershipBasedTimestamp.class, new MastershipBasedTimestampSerializer())
Madan Jampanib5e9b1d2014-10-13 14:18:39 -070033 .register(WallClockTimestamp.class)
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070034 .build();
35
36 // avoid instantiation
37 private DistributedStoreSerializers() {}
38}