blob: 5ef8aaf729885a66111e973af4e537ca06007993 [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
Yuta HIGUCHI91768e32014-11-22 05:06:35 -080026
27 public static final int STORE_CUSTOM_BEGIN = KryoNamespaces.BEGIN_USER_CUSTOM_ID + 10;
28
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070029 /**
Yuta HIGUCHI8d143d22014-10-19 23:15:09 -070030 * KryoNamespace which can serialize ON.lab misc classes.
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070031 */
Yuta HIGUCHI91768e32014-11-22 05:06:35 -080032 public static final KryoNamespace STORE_COMMON = KryoNamespace.newBuilder()
Yuta HIGUCHI8d143d22014-10-19 23:15:09 -070033 .register(KryoNamespaces.API)
Yuta HIGUCHI91768e32014-11-22 05:06:35 -080034 .nextId(KryoNamespaces.BEGIN_USER_CUSTOM_ID)
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070035 .register(Timestamped.class)
Yuta HIGUCHI91768e32014-11-22 05:06:35 -080036 .register(new MastershipBasedTimestampSerializer(), MastershipBasedTimestamp.class)
Madan Jampanib5e9b1d2014-10-13 14:18:39 -070037 .register(WallClockTimestamp.class)
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070038 .build();
39
40 // avoid instantiation
41 private DistributedStoreSerializers() {}
42}