Jonathan Hart | 6df9017 | 2014-04-03 10:13:11 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.datastore.hazelcast; |
Yuta HIGUCHI | 6a64313 | 2014-03-18 22:39:27 -0700 | [diff] [blame] | 2 | |
Yuta HIGUCHI | 6a64313 | 2014-03-18 22:39:27 -0700 | [diff] [blame] | 3 | import com.hazelcast.nio.serialization.DataSerializableFactory; |
| 4 | import com.hazelcast.nio.serialization.IdentifiedDataSerializable; |
| 5 | |
| 6 | public class VersionedValueSerializableFactory implements |
| 7 | DataSerializableFactory { |
| 8 | // revisit these magic numbers |
| 9 | public static final int FACTORY_ID = 1; |
| 10 | |
| 11 | public static final int VERSIONED_VALUE_ID = 1; |
| 12 | |
| 13 | @Override |
| 14 | public IdentifiedDataSerializable create(final int typeId) { |
Yuta HIGUCHI | 826b4a4 | 2014-03-24 13:10:33 -0700 | [diff] [blame] | 15 | switch (typeId) { |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 16 | case VERSIONED_VALUE_ID: |
| 17 | return new HZTable.VersionedValue(); |
Yuta HIGUCHI | 6a64313 | 2014-03-18 22:39:27 -0700 | [diff] [blame] | 18 | |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 19 | default: |
| 20 | return null; |
Yuta HIGUCHI | 826b4a4 | 2014-03-24 13:10:33 -0700 | [diff] [blame] | 21 | } |
Yuta HIGUCHI | 6a64313 | 2014-03-18 22:39:27 -0700 | [diff] [blame] | 22 | } |
| 23 | |
| 24 | } |