common-util

local.tomas.util.versioning
Class VersionHandlerBase

java.lang.Object
  extended by local.tomas.util.versioning.VersionHandlerBase
All Implemented Interfaces:
VersionHandler

public abstract class VersionHandlerBase
extends Object
implements VersionHandler

Default base class for version handlers.

Author:
Teubner

Constructor Summary
protected VersionHandlerBase()
          Default constructor.
 
Method Summary
 String getCurrentVersion(String name)
          Get current version.
 VersionInitializer getInitializer(String name, VersionInterface vi)
          Get initializer for version interface.
 VersionUpdater getUpdater(String name, VersionInterface vi)
          Get updater for version interface.
 void updateOrInitialize(String name, VersionInterface vi)
          Update to new version or initialize if none can be found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersionHandlerBase

protected VersionHandlerBase()
Default constructor.

Method Detail

getCurrentVersion

public String getCurrentVersion(String name)
                         throws VersionException
Get current version. The version is retrieved from a property resource. The name of the property resource is the name of this subclass of the VersionHandlerBase plus the extension .properties.

Specified by:
getCurrentVersion in interface VersionHandler
Parameters:
name - the property name
Returns:
current version
Throws:
VersionException

updateOrInitialize

public void updateOrInitialize(String name,
                               VersionInterface vi)
                        throws VersionException
Update to new version or initialize if none can be found.

Parameters:
name - entity name
vi - version interface
Throws:
VersionException

getInitializer

public VersionInitializer getInitializer(String name,
                                         VersionInterface vi)
Description copied from interface: VersionHandler
Get initializer for version interface.

Specified by:
getInitializer in interface VersionHandler
Parameters:
name - entity name
vi - version entity container
Returns:
empty initializer (does nothing)

getUpdater

public VersionUpdater getUpdater(String name,
                                 VersionInterface vi)
Description copied from interface: VersionHandler
Get updater for version interface.

Specified by:
getUpdater in interface VersionHandler
Parameters:
name - entity name
vi - version entity container
Returns:
empty updater (does nothing)

common-util

Copyright © 2005-2007 Tomas Teubner. All Rights Reserved.