org.gcube.resourcemanagement.support.server.managers.services
Class UpgradeListener

java.lang.Object
  extended by org.gcube.resourcemanagement.support.server.managers.services.UpgradeListener

public abstract class UpgradeListener
extends Object

To an upgrade process can be attached an handler to perform additional operations at the happening of events.

Author:
Daniele Strollo (ISTI-CNR)

Field Summary
protected static String LOG_PREFIX
           
 
Constructor Summary
UpgradeListener()
           
 
Method Summary
 SWRepositoryUpgrader getUpgrader()
           
 void onError(Exception failure)
          Invoked in case of failure during update operation.
 void onError(String message, Exception failure)
          Invoked in case of failure during update operation.
abstract  void onFinish(String deployURL, String reportFileName, String distributionFileName)
          In successful update, the resulting report files will be provided in input.
abstract  void onInit()
          Method invoked at construction of listener.
abstract  void onProgress(double progress)
          Invoked each time the update progresses.
 void onRelease()
          Once finished the lock is released and this event raised.
 void onReserve()
          Invoked once the lock has been acquired.
 void setUpgrader(SWRepositoryUpgrader upgrader)
          Automatically invoked when the listener is attached to an upgrader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_PREFIX

protected static final String LOG_PREFIX
See Also:
Constant Field Values
Constructor Detail

UpgradeListener

public UpgradeListener()
Method Detail

onInit

public abstract void onInit()
Method invoked at construction of listener.


setUpgrader

public final void setUpgrader(SWRepositoryUpgrader upgrader)
Automatically invoked when the listener is attached to an upgrader.

Parameters:
upgrader -

getUpgrader

public final SWRepositoryUpgrader getUpgrader()

onProgress

public abstract void onProgress(double progress)
Invoked each time the update progresses.

Parameters:
progress -

onError

public final void onError(Exception failure)
Invoked in case of failure during update operation.

Parameters:
failure -

onError

public final void onError(String message,
                          Exception failure)
Invoked in case of failure during update operation.

Parameters:
failure -

onFinish

public abstract void onFinish(String deployURL,
                              String reportFileName,
                              String distributionFileName)
In successful update, the resulting report files will be provided in input.


onReserve

public final void onReserve()
Invoked once the lock has been acquired.


onRelease

public void onRelease()
Once finished the lock is released and this event raised. The release is called both if the process successfully finish or an abort is required.



Copyright © 2012. All Rights Reserved.