Sho SHIMIZU | 9257b0c | 2014-08-13 15:00:10 -0700 | [diff] [blame^] | 1 | package net.onrc.onos.core.util; |
| 2 | |
| 3 | import net.onrc.onos.core.registry.IdBlock; |
| 4 | |
| 5 | /** |
| 6 | * An interface that gives unique ID spaces. |
| 7 | */ |
| 8 | public interface IdBlockAllocator { |
| 9 | /** |
| 10 | * Allocates a unique Id Block. |
| 11 | * |
| 12 | * @return Id Block. |
| 13 | */ |
| 14 | IdBlock allocateUniqueIdBlock(); |
| 15 | |
| 16 | /** |
| 17 | * Allocates next unique id and retrieve a new range of ids if needed. |
| 18 | * |
| 19 | * @param range range to use for the identifier |
| 20 | * @return Id Block. |
| 21 | */ |
| 22 | IdBlock allocateUniqueIdBlock(long range); |
| 23 | } |