org.openstreetmap.osmosis.core.mysql.v0_5.impl
Class UserIdManager

java.lang.Object
  extended by org.openstreetmap.osmosis.core.mysql.v0_5.impl.UserIdManager
All Implemented Interfaces:
Releasable

public class UserIdManager
extends java.lang.Object
implements Releasable

Creates or loads the details of the Osmosis user in the database.

Author:
Brett Henderson

Constructor Summary
UserIdManager(DatabaseContext dbCtx)
          Creates a new instance.
 
Method Summary
 long getUserId()
          Returns the id of the Osmosis OSM user id in the database.
 void release()
          Performs resource cleanup tasks such as closing files, or database connections.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserIdManager

public UserIdManager(DatabaseContext dbCtx)
Creates a new instance.

Parameters:
dbCtx - The database context to use for all database access.
Method Detail

getUserId

public long getUserId()
Returns the id of the Osmosis OSM user id in the database. It will create a new user if one doesn't exist.

Returns:
The id of the user.

release

public void release()
Performs resource cleanup tasks such as closing files, or database connections. This must be called after all processing is complete and may be called multiple times. Implementations must call release on any nested Releasable objects. It should be called within a finally block to ensure it is called in exception scenarios.

Specified by:
release in interface Releasable