Brian O'Connor | 66630c8 | 2014-10-02 21:08:19 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.intent.impl; |
| 2 | |
| 3 | import org.onlab.onos.net.intent.IntentId; |
| 4 | |
| 5 | /** |
tom | a1d16b6 | 2014-10-02 23:45:11 -0700 | [diff] [blame] | 6 | * An implementation of {@link org.onlab.onos.net.intent.IdGenerator} of intent ID, |
Brian O'Connor | 66630c8 | 2014-10-02 21:08:19 -0700 | [diff] [blame] | 7 | * which uses {@link IdBlockAllocator}. |
| 8 | */ |
| 9 | public class IdBlockAllocatorBasedIntentIdGenerator extends AbstractBlockAllocatorBasedIdGenerator<IntentId> { |
| 10 | |
| 11 | /** |
| 12 | * Constructs an intent ID generator, which uses the specified ID block allocator |
| 13 | * to generate a global unique intent ID. |
| 14 | * |
| 15 | * @param allocator the ID block allocator to use for generating intent IDs |
| 16 | */ |
| 17 | public IdBlockAllocatorBasedIntentIdGenerator(IdBlockAllocator allocator) { |
| 18 | super(allocator); |
| 19 | } |
| 20 | |
| 21 | @Override |
| 22 | protected IntentId convertFrom(long value) { |
| 23 | return new IntentId(value); |
| 24 | } |
| 25 | } |