com.zeroturnaround.liverebel.api.impl.update
Class UpdateImpl

java.lang.Object
  extended by com.zeroturnaround.liverebel.api.impl.update.UpdateImpl
All Implemented Interfaces:
ConfigurableUpdate, PreparedPausableUpdate, PreparedUpdate

public class UpdateImpl
extends Object
implements ConfigurableUpdate

Author:
Rein Raudjärv

Constructor Summary
UpdateImpl(RestConnection con, JsonParser parser, String applicationId, String versionId)
           
 
Method Summary
 ConfigurableUpdate disableScriptExecution()
          Enables script execution steps for this update.
 ConfigurableUpdate enableAutoStrategy(boolean ignoreWarnings)
          Use whatever-is-clever for given update.
 ConfigurableUpdate enableOffline()
          Use the off-line version update mode.
 ConfigurableUpdate enableRolling()
          Use the rolling restart update mode.
 Long execute()
          Execute this update and wait until it's finished.
 PausedUpdate executeWithPause()
          Execute this update with a pause.
 boolean isOffline()
           
 boolean isRolling()
           
 ConfigurableUpdate on(Collection<String> serverIds)
          Change the version only on the given servers.
 ConfigurableUpdate on(String serverId)
          Change the version only on the given server.
 ConfigurableUpdate onGroup(String groupName)
          Change the version only on the given group.
 ConfigurableUpdate onGroups(Collection<String> groupNames)
          Change the version only on the given groups.
 ConfigurableUpdate setScriptEntriesArchive(File scriptEntriesArchive)
           
 ConfigurableUpdate setScriptExecutionDescription(File scriptDescription)
           
 RunningUpdate start()
          Start this update.
 PausingUpdate startWithPause()
          Start this update with a pause.
 String toString()
           
 ConfigurableUpdate withTimeout(int seconds)
          Change the timeout value for: in case of HOTPATCH: waiting for current requests to finish in case of ROLLING: waiting for session drain to finish in case of OFFLINE: waiting for current socket connections to close
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UpdateImpl

public UpdateImpl(RestConnection con,
                  JsonParser parser,
                  String applicationId,
                  String versionId)
Method Detail

on

public ConfigurableUpdate on(String serverId)
Description copied from interface: ConfigurableUpdate
Change the version only on the given server.

Specified by:
on in interface ConfigurableUpdate
Parameters:
serverId - server Id.

on

public ConfigurableUpdate on(Collection<String> serverIds)
Description copied from interface: ConfigurableUpdate
Change the version only on the given servers.

Specified by:
on in interface ConfigurableUpdate
Parameters:
serverIds - server Ids.

onGroup

public ConfigurableUpdate onGroup(String groupName)
Description copied from interface: ConfigurableUpdate
Change the version only on the given group.

Specified by:
onGroup in interface ConfigurableUpdate
Parameters:
groupName - group's name.

onGroups

public ConfigurableUpdate onGroups(Collection<String> groupNames)
Description copied from interface: ConfigurableUpdate
Change the version only on the given groups.

Specified by:
onGroups in interface ConfigurableUpdate
Parameters:
groupNames - groups' names.

withTimeout

public ConfigurableUpdate withTimeout(int seconds)
Description copied from interface: ConfigurableUpdate
Change the timeout value for:

Specified by:
withTimeout in interface ConfigurableUpdate
Parameters:
seconds - timeout value (in seconds).

enableOffline

public ConfigurableUpdate enableOffline()
Description copied from interface: ConfigurableUpdate
Use the off-line version update mode.

Specified by:
enableOffline in interface ConfigurableUpdate

isOffline

public boolean isOffline()

enableRolling

public ConfigurableUpdate enableRolling()
Description copied from interface: ConfigurableUpdate
Use the rolling restart update mode.

Specified by:
enableRolling in interface ConfigurableUpdate

isRolling

public boolean isRolling()

disableScriptExecution

public ConfigurableUpdate disableScriptExecution()
Description copied from interface: ConfigurableUpdate
Enables script execution steps for this update.

Specified by:
disableScriptExecution in interface ConfigurableUpdate

setScriptExecutionDescription

public ConfigurableUpdate setScriptExecutionDescription(File scriptDescription)
Specified by:
setScriptExecutionDescription in interface ConfigurableUpdate
Parameters:
scriptDescription - - file with a description of which scripts to run

execute

public Long execute()
Description copied from interface: PreparedUpdate
Execute this update and wait until it's finished.

Specified by:
execute in interface PreparedUpdate
Returns:
task ID

executeWithPause

public PausedUpdate executeWithPause()
Description copied from interface: PreparedPausableUpdate
Execute this update with a pause.

While all incoming requests are blocked user can e.g. update the database and then invoke PausedUpdate.resume() when ready to finish this update.

Specified by:
executeWithPause in interface PreparedPausableUpdate
Returns:
call-back for resuming or canceling this update.

start

public RunningUpdate start()
Description copied from interface: PreparedUpdate
Start this update.

Specified by:
start in interface PreparedUpdate

startWithPause

public PausingUpdate startWithPause()
Description copied from interface: PreparedPausableUpdate
Start this update with a pause.

Specified by:
startWithPause in interface PreparedPausableUpdate

enableAutoStrategy

public ConfigurableUpdate enableAutoStrategy(boolean ignoreWarnings)
Description copied from interface: ConfigurableUpdate
Use whatever-is-clever for given update. Ignore warnings shows if we want to hotpatch when compatible-with-warnings.

Specified by:
enableAutoStrategy in interface ConfigurableUpdate

toString

public String toString()
Overrides:
toString in class Object

setScriptEntriesArchive

public ConfigurableUpdate setScriptEntriesArchive(File scriptEntriesArchive)
Specified by:
setScriptEntriesArchive in interface ConfigurableUpdate


Copyright © 2013. All Rights Reserved.