blob: c24e99fac31d33208816194886ec9c763b09c4ce [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07003 *
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'Connor6de2e202015-05-21 14:30:41 -070016package org.onosproject.store.serializers.custom;
Yuta HIGUCHI9ee60f62014-10-09 10:00:01 -070017
Brian O'Connorabafb502014-12-02 22:26:20 -080018import org.onosproject.store.impl.MastershipBasedTimestamp;
19import org.onosproject.store.impl.Timestamped;
Jonathan Hart63939a32015-05-08 11:57:03 -070020import org.onosproject.store.service.WallClockTimestamp;
Brian O'Connorabafb502014-12-02 22:26:20 -080021import org.onosproject.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 /**
Thomas Vachuskaa10137c2018-04-03 16:45:59 -070030 * KryoNamespace which can serialize ONF 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}