Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
Ray Milkey | 34c9590 | 2015-04-15 09:47:53 -0700 | [diff] [blame] | 2 | * Copyright 2014-2015 Open Networking Laboratory |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.store.serializers; |
Yuta HIGUCHI | 03fec1f | 2014-10-03 09:13:50 -0700 | [diff] [blame] | 17 | |
Jonathan Hart | 4572785 | 2015-01-28 13:35:54 -0800 | [diff] [blame] | 18 | import com.google.common.collect.ImmutableList; |
| 19 | import com.google.common.collect.ImmutableMap; |
| 20 | import com.google.common.collect.ImmutableSet; |
Madan Jampani | 86940d9 | 2015-05-06 11:47:57 -0700 | [diff] [blame] | 21 | |
Jonathan Hart | 4572785 | 2015-01-28 13:35:54 -0800 | [diff] [blame] | 22 | import org.onlab.packet.ChassisId; |
| 23 | import org.onlab.packet.Ip4Address; |
| 24 | import org.onlab.packet.Ip4Prefix; |
| 25 | import org.onlab.packet.Ip6Address; |
| 26 | import org.onlab.packet.Ip6Prefix; |
| 27 | import org.onlab.packet.IpAddress; |
| 28 | import org.onlab.packet.IpPrefix; |
| 29 | import org.onlab.packet.MacAddress; |
| 30 | import org.onlab.packet.VlanId; |
Sho SHIMIZU | 63feca7 | 2015-05-07 10:44:25 -0700 | [diff] [blame] | 31 | import org.onlab.util.Bandwidth; |
Marc De Leenheer | bb38235 | 2015-04-23 18:20:34 -0700 | [diff] [blame] | 32 | import org.onlab.util.Frequency; |
Jonathan Hart | 4572785 | 2015-01-28 13:35:54 -0800 | [diff] [blame] | 33 | import org.onlab.util.KryoNamespace; |
Thomas Vachuska | 90b453f | 2015-01-30 18:57:14 -0800 | [diff] [blame] | 34 | import org.onosproject.app.ApplicationState; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 35 | import org.onosproject.cluster.ControllerNode; |
| 36 | import org.onosproject.cluster.DefaultControllerNode; |
| 37 | import org.onosproject.cluster.Leadership; |
| 38 | import org.onosproject.cluster.LeadershipEvent; |
| 39 | import org.onosproject.cluster.NodeId; |
| 40 | import org.onosproject.cluster.RoleInfo; |
Changhoon Yoon | 32b9370 | 2015-05-15 04:41:15 +0900 | [diff] [blame] | 41 | import org.onosproject.core.ApplicationRole; |
Thomas Vachuska | 90b453f | 2015-01-30 18:57:14 -0800 | [diff] [blame] | 42 | import org.onosproject.core.DefaultApplication; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 43 | import org.onosproject.core.DefaultApplicationId; |
| 44 | import org.onosproject.core.DefaultGroupId; |
Thomas Vachuska | 90b453f | 2015-01-30 18:57:14 -0800 | [diff] [blame] | 45 | import org.onosproject.core.Version; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 46 | import org.onosproject.mastership.MastershipTerm; |
Marc De Leenheer | bb38235 | 2015-04-23 18:20:34 -0700 | [diff] [blame] | 47 | import org.onosproject.net.Annotations; |
Sho SHIMIZU | 014c33a | 2015-04-30 11:40:37 -0700 | [diff] [blame] | 48 | import org.onosproject.net.ChannelSpacing; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 49 | import org.onosproject.net.ConnectPoint; |
| 50 | import org.onosproject.net.DefaultAnnotations; |
| 51 | import org.onosproject.net.DefaultDevice; |
| 52 | import org.onosproject.net.DefaultEdgeLink; |
| 53 | import org.onosproject.net.DefaultLink; |
| 54 | import org.onosproject.net.DefaultPath; |
| 55 | import org.onosproject.net.DefaultPort; |
| 56 | import org.onosproject.net.Device; |
| 57 | import org.onosproject.net.DeviceId; |
| 58 | import org.onosproject.net.Element; |
Sho SHIMIZU | 014c33a | 2015-04-30 11:40:37 -0700 | [diff] [blame] | 59 | import org.onosproject.net.GridType; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 60 | import org.onosproject.net.HostId; |
| 61 | import org.onosproject.net.HostLocation; |
Sho SHIMIZU | 91210a7 | 2015-04-29 12:54:28 -0700 | [diff] [blame] | 62 | import org.onosproject.net.IndexedLambda; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 63 | import org.onosproject.net.Link; |
| 64 | import org.onosproject.net.LinkKey; |
Marc De Leenheer | bb38235 | 2015-04-23 18:20:34 -0700 | [diff] [blame] | 65 | import org.onosproject.net.OchPort; |
Sho SHIMIZU | 91210a7 | 2015-04-29 12:54:28 -0700 | [diff] [blame] | 66 | import org.onosproject.net.OchSignal; |
Ayaka Koshibe | bcb0237 | 2015-06-01 10:56:42 -0700 | [diff] [blame] | 67 | import org.onosproject.net.OchSignalType; |
Marc De Leenheer | bb38235 | 2015-04-23 18:20:34 -0700 | [diff] [blame] | 68 | import org.onosproject.net.OduCltPort; |
Sho SHIMIZU | 91210a7 | 2015-04-29 12:54:28 -0700 | [diff] [blame] | 69 | import org.onosproject.net.OduSignalType; |
Marc De Leenheer | bb38235 | 2015-04-23 18:20:34 -0700 | [diff] [blame] | 70 | import org.onosproject.net.OmsPort; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 71 | import org.onosproject.net.Port; |
| 72 | import org.onosproject.net.PortNumber; |
| 73 | import org.onosproject.net.device.DefaultDeviceDescription; |
| 74 | import org.onosproject.net.device.DefaultPortDescription; |
Thomas Vachuska | fdbc4c2 | 2015-05-29 15:53:01 -0700 | [diff] [blame] | 75 | import org.onosproject.net.device.DefaultPortStatistics; |
Marc De Leenheer | 01cb1a9 | 2015-05-13 09:23:44 -0700 | [diff] [blame] | 76 | import org.onosproject.net.device.OchPortDescription; |
| 77 | import org.onosproject.net.device.OduCltPortDescription; |
| 78 | import org.onosproject.net.device.OmsPortDescription; |
Thomas Vachuska | fdbc4c2 | 2015-05-29 15:53:01 -0700 | [diff] [blame] | 79 | import org.onosproject.net.device.PortStatistics; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 80 | import org.onosproject.net.flow.CompletedBatchOperation; |
| 81 | import org.onosproject.net.flow.DefaultFlowEntry; |
| 82 | import org.onosproject.net.flow.DefaultFlowRule; |
| 83 | import org.onosproject.net.flow.DefaultTrafficSelector; |
| 84 | import org.onosproject.net.flow.DefaultTrafficTreatment; |
| 85 | import org.onosproject.net.flow.FlowEntry; |
| 86 | import org.onosproject.net.flow.FlowId; |
Brian O'Connor | 72cb19a | 2015-01-16 16:14:41 -0800 | [diff] [blame] | 87 | import org.onosproject.net.flow.FlowRule; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 88 | import org.onosproject.net.flow.FlowRuleBatchEntry; |
Brian O'Connor | 72cb19a | 2015-01-16 16:14:41 -0800 | [diff] [blame] | 89 | import org.onosproject.net.flow.FlowRuleBatchEvent; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 90 | import org.onosproject.net.flow.FlowRuleBatchOperation; |
Brian O'Connor | 72cb19a | 2015-01-16 16:14:41 -0800 | [diff] [blame] | 91 | import org.onosproject.net.flow.FlowRuleBatchRequest; |
Madan Jampani | 87e276b | 2015-06-02 10:49:47 -0700 | [diff] [blame] | 92 | import org.onosproject.net.flow.FlowRuleEvent; |
jcc | 3d4e14a | 2015-04-21 11:32:05 +0800 | [diff] [blame] | 93 | import org.onosproject.net.flow.FlowRuleExtPayLoad; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 94 | import org.onosproject.net.flow.StoredFlowEntry; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 95 | import org.onosproject.net.flow.criteria.Criterion; |
Sho SHIMIZU | fbc80e5 | 2015-04-28 10:41:58 -0700 | [diff] [blame] | 96 | import org.onosproject.net.flow.criteria.EthCriterion; |
| 97 | import org.onosproject.net.flow.criteria.EthTypeCriterion; |
| 98 | import org.onosproject.net.flow.criteria.IPCriterion; |
| 99 | import org.onosproject.net.flow.criteria.IPDscpCriterion; |
| 100 | import org.onosproject.net.flow.criteria.IPEcnCriterion; |
| 101 | import org.onosproject.net.flow.criteria.IPProtocolCriterion; |
| 102 | import org.onosproject.net.flow.criteria.IPv6ExthdrFlagsCriterion; |
| 103 | import org.onosproject.net.flow.criteria.IPv6FlowLabelCriterion; |
| 104 | import org.onosproject.net.flow.criteria.IPv6NDLinkLayerAddressCriterion; |
| 105 | import org.onosproject.net.flow.criteria.IPv6NDTargetAddressCriterion; |
| 106 | import org.onosproject.net.flow.criteria.IcmpCodeCriterion; |
| 107 | import org.onosproject.net.flow.criteria.IcmpTypeCriterion; |
| 108 | import org.onosproject.net.flow.criteria.Icmpv6CodeCriterion; |
| 109 | import org.onosproject.net.flow.criteria.Icmpv6TypeCriterion; |
Sho SHIMIZU | efc2e28 | 2015-05-04 15:26:23 -0700 | [diff] [blame] | 110 | import org.onosproject.net.flow.criteria.IndexedLambdaCriterion; |
Sho SHIMIZU | fbc80e5 | 2015-04-28 10:41:58 -0700 | [diff] [blame] | 111 | import org.onosproject.net.flow.criteria.LambdaCriterion; |
| 112 | import org.onosproject.net.flow.criteria.MetadataCriterion; |
| 113 | import org.onosproject.net.flow.criteria.MplsCriterion; |
Sho SHIMIZU | 084c4ca | 2015-05-04 11:52:51 -0700 | [diff] [blame] | 114 | import org.onosproject.net.flow.criteria.OchSignalCriterion; |
Sho SHIMIZU | b5e6de6 | 2015-05-04 12:13:44 -0700 | [diff] [blame] | 115 | import org.onosproject.net.flow.criteria.OchSignalTypeCriterion; |
Sho SHIMIZU | fbc80e5 | 2015-04-28 10:41:58 -0700 | [diff] [blame] | 116 | import org.onosproject.net.flow.criteria.OpticalSignalTypeCriterion; |
| 117 | import org.onosproject.net.flow.criteria.PortCriterion; |
| 118 | import org.onosproject.net.flow.criteria.SctpPortCriterion; |
| 119 | import org.onosproject.net.flow.criteria.TcpPortCriterion; |
| 120 | import org.onosproject.net.flow.criteria.UdpPortCriterion; |
| 121 | import org.onosproject.net.flow.criteria.VlanIdCriterion; |
| 122 | import org.onosproject.net.flow.criteria.VlanPcpCriterion; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 123 | import org.onosproject.net.flow.instructions.Instructions; |
| 124 | import org.onosproject.net.flow.instructions.L0ModificationInstruction; |
| 125 | import org.onosproject.net.flow.instructions.L2ModificationInstruction; |
| 126 | import org.onosproject.net.flow.instructions.L3ModificationInstruction; |
| 127 | import org.onosproject.net.host.DefaultHostDescription; |
| 128 | import org.onosproject.net.host.HostDescription; |
| 129 | import org.onosproject.net.intent.ConnectivityIntent; |
Brian O'Connor | a751537 | 2015-03-25 14:45:34 -0700 | [diff] [blame] | 130 | import org.onosproject.net.intent.FlowRuleIntent; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 131 | import org.onosproject.net.intent.HostToHostIntent; |
| 132 | import org.onosproject.net.intent.Intent; |
| 133 | import org.onosproject.net.intent.IntentId; |
| 134 | import org.onosproject.net.intent.IntentOperation; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 135 | import org.onosproject.net.intent.IntentState; |
Jonathan Hart | 5ec32ba | 2015-02-05 13:33:58 -0800 | [diff] [blame] | 136 | import org.onosproject.net.intent.Key; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 137 | import org.onosproject.net.intent.LinkCollectionIntent; |
Michele Santuari | 4b6019e | 2014-12-19 11:31:45 +0100 | [diff] [blame] | 138 | import org.onosproject.net.intent.MplsIntent; |
| 139 | import org.onosproject.net.intent.MplsPathIntent; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 140 | import org.onosproject.net.intent.MultiPointToSinglePointIntent; |
Marc De Leenheer | 8c2caac | 2015-05-28 16:37:33 -0700 | [diff] [blame] | 141 | import org.onosproject.net.intent.OpticalCircuitIntent; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 142 | import org.onosproject.net.intent.OpticalConnectivityIntent; |
| 143 | import org.onosproject.net.intent.OpticalPathIntent; |
| 144 | import org.onosproject.net.intent.PathIntent; |
| 145 | import org.onosproject.net.intent.PointToPointIntent; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 146 | import org.onosproject.net.intent.SinglePointToMultiPointIntent; |
Jonathan Hart | 4572785 | 2015-01-28 13:35:54 -0800 | [diff] [blame] | 147 | import org.onosproject.net.intent.constraint.AnnotationConstraint; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 148 | import org.onosproject.net.intent.constraint.BandwidthConstraint; |
| 149 | import org.onosproject.net.intent.constraint.BooleanConstraint; |
| 150 | import org.onosproject.net.intent.constraint.LambdaConstraint; |
| 151 | import org.onosproject.net.intent.constraint.LatencyConstraint; |
| 152 | import org.onosproject.net.intent.constraint.LinkTypeConstraint; |
| 153 | import org.onosproject.net.intent.constraint.ObstacleConstraint; |
| 154 | import org.onosproject.net.intent.constraint.WaypointConstraint; |
| 155 | import org.onosproject.net.link.DefaultLinkDescription; |
| 156 | import org.onosproject.net.packet.DefaultOutboundPacket; |
alshabib | 4294778 | 2015-03-31 14:59:06 -0700 | [diff] [blame] | 157 | import org.onosproject.net.packet.DefaultPacketRequest; |
| 158 | import org.onosproject.net.packet.PacketPriority; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 159 | import org.onosproject.net.provider.ProviderId; |
Brian O'Connor | 6de2e20 | 2015-05-21 14:30:41 -0700 | [diff] [blame] | 160 | import org.onosproject.net.resource.link.BandwidthResource; |
| 161 | import org.onosproject.net.resource.link.BandwidthResourceAllocation; |
| 162 | import org.onosproject.net.resource.link.BandwidthResourceRequest; |
| 163 | import org.onosproject.net.resource.link.DefaultLinkResourceAllocations; |
| 164 | import org.onosproject.net.resource.link.DefaultLinkResourceRequest; |
| 165 | import org.onosproject.net.resource.link.LambdaResource; |
| 166 | import org.onosproject.net.resource.link.LambdaResourceAllocation; |
| 167 | import org.onosproject.net.resource.link.LambdaResourceRequest; |
| 168 | import org.onosproject.net.resource.link.LinkResourceRequest; |
| 169 | import org.onosproject.net.resource.link.MplsLabel; |
| 170 | import org.onosproject.net.resource.link.MplsLabelResourceAllocation; |
| 171 | import org.onosproject.net.resource.link.MplsLabelResourceRequest; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 172 | import org.onosproject.store.Timestamp; |
Madan Jampani | e97fec4 | 2015-02-17 10:53:42 -0800 | [diff] [blame] | 173 | import org.onosproject.store.service.Versioned; |
Yuta HIGUCHI | 03fec1f | 2014-10-03 09:13:50 -0700 | [diff] [blame] | 174 | |
Jonathan Hart | 4572785 | 2015-01-28 13:35:54 -0800 | [diff] [blame] | 175 | import java.net.URI; |
| 176 | import java.time.Duration; |
| 177 | import java.util.ArrayList; |
| 178 | import java.util.Arrays; |
| 179 | import java.util.Collections; |
| 180 | import java.util.HashMap; |
| 181 | import java.util.HashSet; |
| 182 | import java.util.LinkedList; |
| 183 | import java.util.Optional; |
Madan Jampani | 86940d9 | 2015-05-06 11:47:57 -0700 | [diff] [blame] | 184 | import java.util.concurrent.ConcurrentHashMap; |
| 185 | import java.util.concurrent.CopyOnWriteArraySet; |
Yuta HIGUCHI | 47c4088 | 2014-10-10 18:44:37 -0700 | [diff] [blame] | 186 | |
Yuta HIGUCHI | 8d143d2 | 2014-10-19 23:15:09 -0700 | [diff] [blame] | 187 | public final class KryoNamespaces { |
Yuta HIGUCHI | 03fec1f | 2014-10-03 09:13:50 -0700 | [diff] [blame] | 188 | |
Yuta HIGUCHI | 1aa249c | 2014-11-05 17:40:28 -0800 | [diff] [blame] | 189 | public static final KryoNamespace BASIC = KryoNamespace.newBuilder() |
Yuta HIGUCHI | 91768e3 | 2014-11-22 05:06:35 -0800 | [diff] [blame] | 190 | .nextId(KryoNamespace.FLOATING_ID) |
| 191 | .register(byte[].class) |
| 192 | .register(new ImmutableListSerializer(), |
| 193 | ImmutableList.class, |
| 194 | ImmutableList.of(1).getClass(), |
| 195 | ImmutableList.of(1, 2).getClass()) |
| 196 | .register(new ImmutableSetSerializer(), |
| 197 | ImmutableSet.class, |
| 198 | ImmutableSet.of().getClass(), |
| 199 | ImmutableSet.of(1).getClass(), |
| 200 | ImmutableSet.of(1, 2).getClass()) |
| 201 | .register(new ImmutableMapSerializer(), |
| 202 | ImmutableMap.class, |
| 203 | ImmutableMap.of().getClass(), |
| 204 | ImmutableMap.of("a", 1).getClass(), |
| 205 | ImmutableMap.of("R", 2, "D", 2).getClass()) |
| 206 | .register(HashMap.class) |
Madan Jampani | 86940d9 | 2015-05-06 11:47:57 -0700 | [diff] [blame] | 207 | .register(ConcurrentHashMap.class) |
| 208 | .register(CopyOnWriteArraySet.class) |
Yuta HIGUCHI | 91768e3 | 2014-11-22 05:06:35 -0800 | [diff] [blame] | 209 | .register(ArrayList.class, |
| 210 | LinkedList.class, |
| 211 | HashSet.class |
| 212 | ) |
| 213 | .register(new ArraysAsListSerializer(), Arrays.asList().getClass()) |
| 214 | .register(Collections.singletonList(1).getClass()) |
| 215 | .register(Duration.class) |
Yuta HIGUCHI | ae1d210 | 2014-11-25 19:26:01 -0800 | [diff] [blame] | 216 | .register(Collections.emptySet().getClass()) |
Sho SHIMIZU | 166e61e | 2015-01-21 18:07:12 -0800 | [diff] [blame] | 217 | .register(Optional.class) |
Jonathan Hart | 4572785 | 2015-01-28 13:35:54 -0800 | [diff] [blame] | 218 | .register(Collections.emptyList().getClass()) |
Brian O'Connor | 72cb19a | 2015-01-16 16:14:41 -0800 | [diff] [blame] | 219 | .register(Collections.unmodifiableSet(Collections.emptySet()).getClass()) |
Marc De Leenheer | 4a1c1fa | 2015-06-01 18:08:56 -0700 | [diff] [blame^] | 220 | .register(Collections.singleton(Object.class).getClass()) |
Yuta HIGUCHI | 1aa249c | 2014-11-05 17:40:28 -0800 | [diff] [blame] | 221 | .build(); |
| 222 | |
Yuta HIGUCHI | 03fec1f | 2014-10-03 09:13:50 -0700 | [diff] [blame] | 223 | /** |
Yuta HIGUCHI | 8d143d2 | 2014-10-19 23:15:09 -0700 | [diff] [blame] | 224 | * KryoNamespace which can serialize ON.lab misc classes. |
Yuta HIGUCHI | 03fec1f | 2014-10-03 09:13:50 -0700 | [diff] [blame] | 225 | */ |
Yuta HIGUCHI | 8d143d2 | 2014-10-19 23:15:09 -0700 | [diff] [blame] | 226 | public static final KryoNamespace MISC = KryoNamespace.newBuilder() |
Yuta HIGUCHI | 91768e3 | 2014-11-22 05:06:35 -0800 | [diff] [blame] | 227 | .nextId(KryoNamespace.FLOATING_ID) |
| 228 | .register(new IpPrefixSerializer(), IpPrefix.class) |
| 229 | .register(new Ip4PrefixSerializer(), Ip4Prefix.class) |
| 230 | .register(new Ip6PrefixSerializer(), Ip6Prefix.class) |
| 231 | .register(new IpAddressSerializer(), IpAddress.class) |
| 232 | .register(new Ip4AddressSerializer(), Ip4Address.class) |
| 233 | .register(new Ip6AddressSerializer(), Ip6Address.class) |
| 234 | .register(new MacAddressSerializer(), MacAddress.class) |
Yuta HIGUCHI | 5fa3dc0 | 2014-10-15 17:08:13 -0700 | [diff] [blame] | 235 | .register(VlanId.class) |
Sho SHIMIZU | dee7871 | 2015-04-30 09:33:52 -0700 | [diff] [blame] | 236 | .register(Frequency.class) |
Sho SHIMIZU | 63feca7 | 2015-05-07 10:44:25 -0700 | [diff] [blame] | 237 | .register(Bandwidth.class) |
Yuta HIGUCHI | 03fec1f | 2014-10-03 09:13:50 -0700 | [diff] [blame] | 238 | .build(); |
| 239 | |
Yuta HIGUCHI | 91768e3 | 2014-11-22 05:06:35 -0800 | [diff] [blame] | 240 | /** |
| 241 | * Kryo registration Id for user custom registration. |
| 242 | */ |
| 243 | public static final int BEGIN_USER_CUSTOM_ID = 300; |
| 244 | |
Yuta HIGUCHI | 03fec1f | 2014-10-03 09:13:50 -0700 | [diff] [blame] | 245 | // TODO: Populate other classes |
| 246 | /** |
Yuta HIGUCHI | 8d143d2 | 2014-10-19 23:15:09 -0700 | [diff] [blame] | 247 | * KryoNamespace which can serialize API bundle classes. |
Yuta HIGUCHI | 03fec1f | 2014-10-03 09:13:50 -0700 | [diff] [blame] | 248 | */ |
Yuta HIGUCHI | 8d143d2 | 2014-10-19 23:15:09 -0700 | [diff] [blame] | 249 | public static final KryoNamespace API = KryoNamespace.newBuilder() |
Yuta HIGUCHI | 91768e3 | 2014-11-22 05:06:35 -0800 | [diff] [blame] | 250 | .nextId(KryoNamespace.INITIAL_ID) |
Yuta HIGUCHI | 1aa249c | 2014-11-05 17:40:28 -0800 | [diff] [blame] | 251 | .register(BASIC) |
Yuta HIGUCHI | 91768e3 | 2014-11-22 05:06:35 -0800 | [diff] [blame] | 252 | .nextId(KryoNamespace.INITIAL_ID + 30) |
| 253 | .register(MISC) |
| 254 | .nextId(KryoNamespace.INITIAL_ID + 30 + 10) |
Yuta HIGUCHI | 03fec1f | 2014-10-03 09:13:50 -0700 | [diff] [blame] | 255 | .register( |
Thomas Vachuska | 90b453f | 2015-01-30 18:57:14 -0800 | [diff] [blame] | 256 | Version.class, |
Yuta HIGUCHI | 03fec1f | 2014-10-03 09:13:50 -0700 | [diff] [blame] | 257 | ControllerNode.State.class, |
Thomas Vachuska | 90b453f | 2015-01-30 18:57:14 -0800 | [diff] [blame] | 258 | ApplicationState.class, |
Changhoon Yoon | 32b9370 | 2015-05-15 04:41:15 +0900 | [diff] [blame] | 259 | ApplicationRole.class, |
Thomas Vachuska | 90b453f | 2015-01-30 18:57:14 -0800 | [diff] [blame] | 260 | DefaultApplication.class, |
Yuta HIGUCHI | 03fec1f | 2014-10-03 09:13:50 -0700 | [diff] [blame] | 261 | Device.Type.class, |
Thomas Vachuska | d16ce18 | 2014-10-29 17:25:29 -0700 | [diff] [blame] | 262 | Port.Type.class, |
alshabib | 7911a05 | 2014-10-16 17:49:37 -0700 | [diff] [blame] | 263 | ChassisId.class, |
Yuta HIGUCHI | 03fec1f | 2014-10-03 09:13:50 -0700 | [diff] [blame] | 264 | DefaultAnnotations.class, |
| 265 | DefaultControllerNode.class, |
| 266 | DefaultDevice.class, |
Madan Jampani | 53e44e6 | 2014-10-07 12:39:51 -0700 | [diff] [blame] | 267 | DefaultDeviceDescription.class, |
Madan Jampani | 2ff0559 | 2014-10-10 15:42:47 -0700 | [diff] [blame] | 268 | DefaultLinkDescription.class, |
Yuta HIGUCHI | 03fec1f | 2014-10-03 09:13:50 -0700 | [diff] [blame] | 269 | Port.class, |
Madan Jampani | 53e44e6 | 2014-10-07 12:39:51 -0700 | [diff] [blame] | 270 | DefaultPortDescription.class, |
Yuta HIGUCHI | 03fec1f | 2014-10-03 09:13:50 -0700 | [diff] [blame] | 271 | Element.class, |
Yuta HIGUCHI | 9ee60f6 | 2014-10-09 10:00:01 -0700 | [diff] [blame] | 272 | Link.Type.class, |
Thomas Vachuska | 57126fe | 2014-11-11 17:13:24 -0800 | [diff] [blame] | 273 | Link.State.class, |
Yuta HIGUCHI | 5fa3dc0 | 2014-10-15 17:08:13 -0700 | [diff] [blame] | 274 | Timestamp.class, |
Madan Jampani | 1ee9178 | 2014-11-20 20:24:24 -0800 | [diff] [blame] | 275 | Leadership.class, |
| 276 | LeadershipEvent.class, |
| 277 | LeadershipEvent.Type.class, |
Yuta HIGUCHI | 5fa3dc0 | 2014-10-15 17:08:13 -0700 | [diff] [blame] | 278 | HostId.class, |
| 279 | HostDescription.class, |
Madan Jampani | 38b250d | 2014-10-17 11:02:38 -0700 | [diff] [blame] | 280 | DefaultHostDescription.class, |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 281 | DefaultFlowEntry.class, |
| 282 | StoredFlowEntry.class, |
sangho | 11c30ac | 2015-01-22 14:30:55 -0800 | [diff] [blame] | 283 | FlowRule.Type.class, |
Yuta HIGUCHI | 2fcfde9 | 2014-10-20 18:37:14 -0700 | [diff] [blame] | 284 | DefaultFlowRule.class, |
alshabib | 3d643ec | 2014-10-22 18:33:00 -0700 | [diff] [blame] | 285 | DefaultFlowEntry.class, |
alshabib | 4294778 | 2015-03-31 14:59:06 -0700 | [diff] [blame] | 286 | DefaultPacketRequest.class, |
| 287 | PacketPriority.class, |
alshabib | f6c2ede | 2014-10-22 23:31:50 -0700 | [diff] [blame] | 288 | FlowEntry.FlowEntryState.class, |
Yuta HIGUCHI | 2809bf3 | 2014-10-20 22:44:12 -0700 | [diff] [blame] | 289 | FlowId.class, |
Yuta HIGUCHI | 85d58d1 | 2014-10-20 23:59:44 -0700 | [diff] [blame] | 290 | DefaultTrafficSelector.class, |
Sho SHIMIZU | fbc80e5 | 2015-04-28 10:41:58 -0700 | [diff] [blame] | 291 | PortCriterion.class, |
| 292 | MetadataCriterion.class, |
| 293 | EthCriterion.class, |
| 294 | EthTypeCriterion.class, |
| 295 | VlanIdCriterion.class, |
| 296 | VlanPcpCriterion.class, |
| 297 | IPDscpCriterion.class, |
| 298 | IPEcnCriterion.class, |
| 299 | IPProtocolCriterion.class, |
| 300 | IPCriterion.class, |
| 301 | TcpPortCriterion.class, |
| 302 | UdpPortCriterion.class, |
| 303 | SctpPortCriterion.class, |
| 304 | IcmpTypeCriterion.class, |
| 305 | IcmpCodeCriterion.class, |
| 306 | IPv6FlowLabelCriterion.class, |
| 307 | Icmpv6TypeCriterion.class, |
| 308 | Icmpv6CodeCriterion.class, |
| 309 | IPv6NDTargetAddressCriterion.class, |
| 310 | IPv6NDLinkLayerAddressCriterion.class, |
| 311 | MplsCriterion.class, |
| 312 | IPv6ExthdrFlagsCriterion.class, |
| 313 | LambdaCriterion.class, |
Sho SHIMIZU | efc2e28 | 2015-05-04 15:26:23 -0700 | [diff] [blame] | 314 | IndexedLambdaCriterion.class, |
Sho SHIMIZU | 084c4ca | 2015-05-04 11:52:51 -0700 | [diff] [blame] | 315 | OchSignalCriterion.class, |
Sho SHIMIZU | b5e6de6 | 2015-05-04 12:13:44 -0700 | [diff] [blame] | 316 | OchSignalTypeCriterion.class, |
Sho SHIMIZU | fbc80e5 | 2015-04-28 10:41:58 -0700 | [diff] [blame] | 317 | OpticalSignalTypeCriterion.class, |
Yuta HIGUCHI | 85d58d1 | 2014-10-20 23:59:44 -0700 | [diff] [blame] | 318 | Criterion.class, |
| 319 | Criterion.Type.class, |
| 320 | DefaultTrafficTreatment.class, |
| 321 | Instructions.DropInstruction.class, |
Yuta HIGUCHI | 40d0177 | 2014-10-21 00:08:44 -0700 | [diff] [blame] | 322 | Instructions.OutputInstruction.class, |
Pavlin Radoslavov | 1d21866 | 2015-02-13 11:34:30 -0800 | [diff] [blame] | 323 | Instructions.GroupInstruction.class, |
Srikanth Vavilapalli | 2318191 | 2015-05-04 09:48:09 -0700 | [diff] [blame] | 324 | Instructions.TableTypeTransition.class, |
Jonathan Hart | 68fef9d | 2014-10-29 17:30:03 -0700 | [diff] [blame] | 325 | L0ModificationInstruction.class, |
| 326 | L0ModificationInstruction.L0SubType.class, |
| 327 | L0ModificationInstruction.ModLambdaInstruction.class, |
Sho SHIMIZU | c682709 | 2015-05-05 17:58:34 -0700 | [diff] [blame] | 328 | L0ModificationInstruction.ModOchSignalInstruction.class, |
Jonathan Hart | 68fef9d | 2014-10-29 17:30:03 -0700 | [diff] [blame] | 329 | L2ModificationInstruction.class, |
| 330 | L2ModificationInstruction.L2SubType.class, |
| 331 | L2ModificationInstruction.ModEtherInstruction.class, |
Pavlin Radoslavov | 1d21866 | 2015-02-13 11:34:30 -0800 | [diff] [blame] | 332 | L2ModificationInstruction.PushHeaderInstructions.class, |
Jonathan Hart | 68fef9d | 2014-10-29 17:30:03 -0700 | [diff] [blame] | 333 | L2ModificationInstruction.ModVlanIdInstruction.class, |
| 334 | L2ModificationInstruction.ModVlanPcpInstruction.class, |
Saurav Das | 6c44a63 | 2015-05-30 22:05:22 -0700 | [diff] [blame] | 335 | L2ModificationInstruction.PopVlanInstruction.class, |
Pavlin Radoslavov | 1d21866 | 2015-02-13 11:34:30 -0800 | [diff] [blame] | 336 | L2ModificationInstruction.ModMplsLabelInstruction.class, |
| 337 | L2ModificationInstruction.ModMplsTtlInstruction.class, |
Jonathan Hart | 68fef9d | 2014-10-29 17:30:03 -0700 | [diff] [blame] | 338 | L3ModificationInstruction.class, |
| 339 | L3ModificationInstruction.L3SubType.class, |
| 340 | L3ModificationInstruction.ModIPInstruction.class, |
Pavlin Radoslavov | febe82c | 2015-02-11 19:08:15 -0800 | [diff] [blame] | 341 | L3ModificationInstruction.ModIPv6FlowLabelInstruction.class, |
Pavlin Radoslavov | 1d21866 | 2015-02-13 11:34:30 -0800 | [diff] [blame] | 342 | L3ModificationInstruction.ModTtlInstruction.class, |
Yuta HIGUCHI | 9def047 | 2014-10-23 15:51:10 -0700 | [diff] [blame] | 343 | RoleInfo.class, |
Brian O'Connor | 72cb19a | 2015-01-16 16:14:41 -0800 | [diff] [blame] | 344 | FlowRuleBatchEvent.class, |
| 345 | FlowRuleBatchEvent.Type.class, |
| 346 | FlowRuleBatchRequest.class, |
Yuta HIGUCHI | 9def047 | 2014-10-23 15:51:10 -0700 | [diff] [blame] | 347 | FlowRuleBatchOperation.class, |
Madan Jampani | 87e276b | 2015-06-02 10:49:47 -0700 | [diff] [blame] | 348 | FlowRuleEvent.class, |
| 349 | FlowRuleEvent.Type.class, |
Yuta HIGUCHI | 9def047 | 2014-10-23 15:51:10 -0700 | [diff] [blame] | 350 | CompletedBatchOperation.class, |
| 351 | FlowRuleBatchEntry.class, |
Yuta HIGUCHI | 087019b | 2014-10-28 21:07:56 -0700 | [diff] [blame] | 352 | FlowRuleBatchEntry.FlowRuleOperation.class, |
| 353 | IntentId.class, |
| 354 | IntentState.class, |
Brian O'Connor | 4e6c17d | 2015-02-19 11:40:05 -0800 | [diff] [blame] | 355 | //Key.class, is abstract |
| 356 | Key.of(1L, new DefaultApplicationId(0, "bar")).getClass(), //LongKey.class |
| 357 | Key.of("foo", new DefaultApplicationId(0, "bar")).getClass(), //StringKey.class |
Yuta HIGUCHI | 087019b | 2014-10-28 21:07:56 -0700 | [diff] [blame] | 358 | Intent.class, |
| 359 | ConnectivityIntent.class, |
| 360 | PathIntent.class, |
| 361 | DefaultPath.class, |
| 362 | DefaultEdgeLink.class, |
| 363 | HostToHostIntent.class, |
| 364 | PointToPointIntent.class, |
Jonathan Hart | 68fef9d | 2014-10-29 17:30:03 -0700 | [diff] [blame] | 365 | MultiPointToSinglePointIntent.class, |
Michele Santuari | 4a33807 | 2014-11-05 18:38:55 +0100 | [diff] [blame] | 366 | SinglePointToMultiPointIntent.class, |
Brian O'Connor | a751537 | 2015-03-25 14:45:34 -0700 | [diff] [blame] | 367 | FlowRuleIntent.class, |
Brian O'Connor | 41718fc | 2014-10-30 16:57:21 -0700 | [diff] [blame] | 368 | LinkCollectionIntent.class, |
| 369 | OpticalConnectivityIntent.class, |
| 370 | OpticalPathIntent.class, |
Marc De Leenheer | 8c2caac | 2015-05-28 16:37:33 -0700 | [diff] [blame] | 371 | OpticalCircuitIntent.class, |
Thomas Vachuska | 7d0032b | 2014-11-04 17:39:57 -0800 | [diff] [blame] | 372 | LinkResourceRequest.class, |
Yuta HIGUCHI | adac04a | 2014-11-13 00:02:45 -0800 | [diff] [blame] | 373 | DefaultLinkResourceRequest.class, |
| 374 | BandwidthResourceRequest.class, |
| 375 | LambdaResourceRequest.class, |
Sho SHIMIZU | 94b7ff4 | 2015-05-06 17:51:49 -0700 | [diff] [blame] | 376 | LambdaResource.class, |
Sho SHIMIZU | 63feca7 | 2015-05-07 10:44:25 -0700 | [diff] [blame] | 377 | BandwidthResource.class, |
Yuta HIGUCHI | adac04a | 2014-11-13 00:02:45 -0800 | [diff] [blame] | 378 | DefaultLinkResourceAllocations.class, |
| 379 | BandwidthResourceAllocation.class, |
| 380 | LambdaResourceAllocation.class, |
Sho SHIMIZU | cd4bac8 | 2014-11-11 17:07:25 -0800 | [diff] [blame] | 381 | // Constraints |
Thomas Vachuska | 7d0032b | 2014-11-04 17:39:57 -0800 | [diff] [blame] | 382 | LambdaConstraint.class, |
| 383 | BandwidthConstraint.class, |
| 384 | LinkTypeConstraint.class, |
Sho SHIMIZU | cd4bac8 | 2014-11-11 17:07:25 -0800 | [diff] [blame] | 385 | LatencyConstraint.class, |
| 386 | WaypointConstraint.class, |
| 387 | ObstacleConstraint.class, |
| 388 | AnnotationConstraint.class, |
Brian O'Connor | 72a034c | 2014-11-26 18:24:23 -0800 | [diff] [blame] | 389 | BooleanConstraint.class, |
jcc | 3d4e14a | 2015-04-21 11:32:05 +0800 | [diff] [blame] | 390 | IntentOperation.class, |
Marc De Leenheer | bb38235 | 2015-04-23 18:20:34 -0700 | [diff] [blame] | 391 | FlowRuleExtPayLoad.class, |
| 392 | Frequency.class, |
Thomas Vachuska | fdbc4c2 | 2015-05-29 15:53:01 -0700 | [diff] [blame] | 393 | DefaultAnnotations.class, |
| 394 | PortStatistics.class, |
| 395 | DefaultPortStatistics.class |
Marc De Leenheer | bb38235 | 2015-04-23 18:20:34 -0700 | [diff] [blame] | 396 | ) |
Yuta HIGUCHI | 91768e3 | 2014-11-22 05:06:35 -0800 | [diff] [blame] | 397 | .register(new DefaultApplicationIdSerializer(), DefaultApplicationId.class) |
| 398 | .register(new URISerializer(), URI.class) |
| 399 | .register(new NodeIdSerializer(), NodeId.class) |
| 400 | .register(new ProviderIdSerializer(), ProviderId.class) |
| 401 | .register(new DeviceIdSerializer(), DeviceId.class) |
| 402 | .register(new PortNumberSerializer(), PortNumber.class) |
| 403 | .register(new DefaultPortSerializer(), DefaultPort.class) |
| 404 | .register(new LinkKeySerializer(), LinkKey.class) |
| 405 | .register(new ConnectPointSerializer(), ConnectPoint.class) |
| 406 | .register(new DefaultLinkSerializer(), DefaultLink.class) |
| 407 | .register(new MastershipTermSerializer(), MastershipTerm.class) |
| 408 | .register(new HostLocationSerializer(), HostLocation.class) |
| 409 | .register(new DefaultOutboundPacketSerializer(), DefaultOutboundPacket.class) |
Madan Jampani | e97fec4 | 2015-02-17 10:53:42 -0800 | [diff] [blame] | 410 | .register(Versioned.class) |
Yuta HIGUCHI | f617123 | 2014-11-25 15:14:44 -0800 | [diff] [blame] | 411 | .register(DefaultGroupId.class) |
Marc De Leenheer | bb38235 | 2015-04-23 18:20:34 -0700 | [diff] [blame] | 412 | .register(Annotations.class) |
| 413 | .register(OmsPort.class) |
| 414 | .register(OchPort.class) |
Sho SHIMIZU | 014c33a | 2015-04-30 11:40:37 -0700 | [diff] [blame] | 415 | .register(OduSignalType.class) |
Ayaka Koshibe | bcb0237 | 2015-06-01 10:56:42 -0700 | [diff] [blame] | 416 | .register(OchSignalType.class) |
Sho SHIMIZU | 014c33a | 2015-04-30 11:40:37 -0700 | [diff] [blame] | 417 | .register(GridType.class) |
| 418 | .register(ChannelSpacing.class) |
Marc De Leenheer | bb38235 | 2015-04-23 18:20:34 -0700 | [diff] [blame] | 419 | .register(OduCltPort.class) |
| 420 | .register(OduCltPort.SignalType.class) |
Sho SHIMIZU | 91210a7 | 2015-04-29 12:54:28 -0700 | [diff] [blame] | 421 | .register(IndexedLambda.class) |
| 422 | .register(OchSignal.class) |
Marc De Leenheer | 01cb1a9 | 2015-05-13 09:23:44 -0700 | [diff] [blame] | 423 | .register(OduCltPortDescription.class) |
| 424 | .register(OchPortDescription.class) |
| 425 | .register(OmsPortDescription.class) |
Michele Santuari | 4b6019e | 2014-12-19 11:31:45 +0100 | [diff] [blame] | 426 | .register( |
| 427 | MplsIntent.class, |
| 428 | MplsPathIntent.class, |
| 429 | MplsLabelResourceAllocation.class, |
| 430 | MplsLabelResourceRequest.class, |
| 431 | MplsLabel.class, |
sangho | b35a619 | 2015-04-01 13:05:26 -0700 | [diff] [blame] | 432 | org.onlab.packet.MplsLabel.class, |
| 433 | org.onlab.packet.MPLS.class |
Marc De Leenheer | bb38235 | 2015-04-23 18:20:34 -0700 | [diff] [blame] | 434 | ) |
Yuta HIGUCHI | 03fec1f | 2014-10-03 09:13:50 -0700 | [diff] [blame] | 435 | |
| 436 | .build(); |
| 437 | |
| 438 | |
| 439 | // not to be instantiated |
Yuta HIGUCHI | 8d143d2 | 2014-10-19 23:15:09 -0700 | [diff] [blame] | 440 | private KryoNamespaces() {} |
Yuta HIGUCHI | 03fec1f | 2014-10-03 09:13:50 -0700 | [diff] [blame] | 441 | } |