com.jboss.jbossnetwork.product.jbpm.handlers
Class BackupAndReplaceFileActionHandler

java.lang.Object
  extended by com.jboss.jbossnetwork.product.jbpm.handlers.BaseHandler
      extended by com.jboss.jbossnetwork.product.jbpm.handlers.BackupAndReplaceFileActionHandler
All Implemented Interfaces:
Serializable, org.jbpm.graph.def.ActionHandler

public class BackupAndReplaceFileActionHandler
extends BaseHandler

JBPM process handler that is responsible for copying new files from a patch into the AS instance. The previous file will be renamed with a timestamp and .old extension to facilitate rolling back the patch.

Author:
Jason Dobies
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.jboss.jbossnetwork.product.jbpm.handlers.BaseHandler
logger, MESSAGE_NO_CHANGES, TRANSITION_ERROR, TRANSITION_SUCCESS
 
Constructor Summary
BackupAndReplaceFileActionHandler()
           
 
Method Summary
protected  void checkProperties()
          Ensures the property values that were set in BaseHandler.substituteVariables(org.jbpm.graph.exe.ExecutionContext) are valid.
 String getBackupFileLocation()
           
 String getDescription()
          Returns a user readable description of what the step in the workflow entails.
 String getDestinationFileLocation()
           
 String getOriginalFileLocation()
           
 String getReplacementFileLocation()
           
 void run(org.jbpm.graph.exe.ExecutionContext executionContext)
          Tells the handle implementation to actually perform the step indicated.
 void setBackupFileLocation(String backupFileLocation)
           
 void setDestinationFileLocation(String destinationFileLocation)
           
 void setOriginalFileLocation(String originalFileLocation)
           
 void setPropertyDefaults()
          Sets the default values for properties used by the handler implementation.
 void setReplacementFileLocation(String replacementFileLocation)
           
 void substituteVariables(org.jbpm.graph.exe.ExecutionContext executionContext)
          Requests the action handler substitute into its node any variables necessary, taking the values for these from the provided execution context.
 
Methods inherited from class com.jboss.jbossnetwork.product.jbpm.handlers.BaseHandler
complete, error, execute, notRun, skip, substituteVariable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BackupAndReplaceFileActionHandler

public BackupAndReplaceFileActionHandler()
Method Detail

run

public void run(org.jbpm.graph.exe.ExecutionContext executionContext)
Description copied from class: BaseHandler
Tells the handle implementation to actually perform the step indicated.

Specified by:
run in class BaseHandler
Parameters:
executionContext - cannot be null

getDescription

public String getDescription()
Description copied from class: BaseHandler
Returns a user readable description of what the step in the workflow entails.

Specified by:
getDescription in class BaseHandler
Returns:
should not be null

substituteVariables

public void substituteVariables(org.jbpm.graph.exe.ExecutionContext executionContext)
                         throws ActionHandlerException
Description copied from class: BaseHandler
Requests the action handler substitute into its node any variables necessary, taking the values for these from the provided execution context. This may optionally be overridden by action handler implementations if necessary.

Overrides:
substituteVariables in class BaseHandler
Parameters:
executionContext - JBPM execution context from which the property values should be extracted
Throws:
ActionHandlerException - if there is an error extraction or substituting the variables

checkProperties

protected void checkProperties()
                        throws ActionHandlerException
Description copied from class: BaseHandler
Ensures the property values that were set in BaseHandler.substituteVariables(org.jbpm.graph.exe.ExecutionContext) are valid. This may optionally be overridden by action handler implementations if necessary.

Overrides:
checkProperties in class BaseHandler
Throws:
ActionHandlerException - if any of the properties are invalid

setPropertyDefaults

public void setPropertyDefaults()
Description copied from class: BaseHandler
Sets the default values for properties used by the handler implementation. This may optionally be overridden by action handler implementations if necessary.

Overrides:
setPropertyDefaults in class BaseHandler

getReplacementFileLocation

public String getReplacementFileLocation()

setReplacementFileLocation

public void setReplacementFileLocation(String replacementFileLocation)

getOriginalFileLocation

public String getOriginalFileLocation()

setOriginalFileLocation

public void setOriginalFileLocation(String originalFileLocation)

getBackupFileLocation

public String getBackupFileLocation()

setBackupFileLocation

public void setBackupFileLocation(String backupFileLocation)

getDestinationFileLocation

public String getDestinationFileLocation()

setDestinationFileLocation

public void setDestinationFileLocation(String destinationFileLocation)


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.