blob: d2de5ad111440da6343ac62372fbb9265bdc5853 [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 HIGUCHI9ee60f62014-10-09 10:00:01 -070016package org.onlab.onos.store.serializers;
17
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 HIGUCHI8d143d22014-10-19 23:15:09 -070021import org.onlab.util.KryoNamespace;
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070022
23public final class DistributedStoreSerializers {
24
25 /**
Yuta HIGUCHI8d143d22014-10-19 23:15:09 -070026 * KryoNamespace which can serialize ON.lab misc classes.
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070027 */
Yuta HIGUCHI8d143d22014-10-19 23:15:09 -070028 public static final KryoNamespace COMMON = KryoNamespace.newBuilder()
29 .register(KryoNamespaces.API)
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070030 .register(Timestamped.class)
31 .register(MastershipBasedTimestamp.class, new MastershipBasedTimestampSerializer())
Madan Jampanib5e9b1d2014-10-13 14:18:39 -070032 .register(WallClockTimestamp.class)
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070033 .build();
34
35 // avoid instantiation
36 private DistributedStoreSerializers() {}
37}