blob: 9620e59d7a688def4d1e0543ae304b17f5c05254 [file] [log] [blame]
Brian O'Connor66630c82014-10-02 21:08:19 -07001package org.onlab.onos.net.intent.impl;
2
3import org.onlab.onos.net.intent.IntentId;
4
5/**
toma1d16b62014-10-02 23:45:11 -07006 * An implementation of {@link org.onlab.onos.net.intent.IdGenerator} of intent ID,
Brian O'Connor66630c82014-10-02 21:08:19 -07007 * which uses {@link IdBlockAllocator}.
8 */
9public 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}