| java.lang.Object org.geotools.data.FeatureLockFactory org.geotools.data.DefaultFeatureLockFactory
DefaultFeatureLockFactory | public class DefaultFeatureLockFactory extends FeatureLockFactory (Code) | | Default implementation of the FeatureLockFactory. Generates id numbers.
author: Jody Garnett, Refractions Research, Inc. author: Chris Holmes, TOPP. version: $Id: DefaultFeatureLockFactory.java 20651 2006-07-21 07:51:54Z jgarnett $ |
Field Summary | |
static long | count |
Method Summary | |
protected FeatureLock | createLock(String name, long duration) | static FeatureLock | createTestLock(String name, long duration) Package visiable generate function for JUnit tests
Parameters: name - The name to give this lock. Parameters: duration - How long it is to last. | static long | nextIdNumber(long duration) Produces the next ID number based on count, duration and the current
time. | static void | seedIdNumber(long seed) Used to seed nextIDNumber to allow for reproduceable JUnit tests. |
count | static long count(Code) | | Count used to generate unique ID numbers
|
createTestLock | static FeatureLock createTestLock(String name, long duration)(Code) | | Package visiable generate function for JUnit tests
Parameters: name - The name to give this lock. Parameters: duration - How long it is to last. The new FeatureLock. |
nextIdNumber | static long nextIdNumber(long duration)(Code) | | Produces the next ID number based on count, duration and the current
time. The uniquity is 'good enough' although not provable as per
security systems. The method used will probably have to be changed
later, the api is what is important right now.
count: 000000000000000000000000000001011 (increasing count)
date: 000000000001111010101010101000000 (expriry date milliseconds usually empty)
now: 000101100111011010011111000000000 (bit order reverse of current time)
---------------------------------
number: 000101100110100000110101001001011
|
Once again method is package visible for testing.
Parameters: duration - The time for the lock to last. The next generated id number. |
seedIdNumber | static void seedIdNumber(long seed)(Code) | | Used to seed nextIDNumber to allow for reproduceable JUnit tests. Not
part of the public API - package protected method used for JUnits
Tests
Parameters: seed - The number to start seeding with. |
|
|