org.openstreetmap.osmosis.core.apidb.v0_6.impl
Class UserManager

java.lang.Object
  extended by org.openstreetmap.osmosis.core.apidb.v0_6.impl.UserManager
All Implemented Interfaces:
Releasable

public class UserManager
extends java.lang.Object
implements Releasable

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

Author:
Brett Henderson

Constructor Summary
UserManager(DatabaseContext dbCtx)
          Creates a new instance.
 
Method Summary
 void addOrUpdateUser(OsmUser user)
          Adds the user to the database or updates the name of the existing database entry if one already exists with the same id.
 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

UserManager

public UserManager(DatabaseContext dbCtx)
Creates a new instance.

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

addOrUpdateUser

public void addOrUpdateUser(OsmUser user)
Adds the user to the database or updates the name of the existing database entry if one already exists with the same id.

Parameters:
user - The user to be created or updated.

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