Class BindingsLifecycleController
- java.lang.Object
-
- org.springframework.cloud.stream.binding.BindingsLifecycleController
-
public class BindingsLifecycleController extends Object
Lifecycle controller for the bindings. It is registered as a bean and once injected could be used to control the lifecycle f the bindings.- Since:
- 3.x
- Author:
- Oleg Zhurakousky
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBindingsLifecycleController.StateBinding states.
-
Constructor Summary
Constructors Constructor Description BindingsLifecycleController(List<InputBindingLifecycle> inputBindingLifecycles, List<OutputBindingLifecycle> outputBindingsLifecycles)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangeState(String bindingName, BindingsLifecycleController.State state)General purpose method to change the state of the provided binding.voidpause(String bindingName)Convenience method to pause the binding with provided `bindingName`.List<Binding<?>>queryState(String name)Queries the individual state of a binding.List<Map<?,?>>queryStates()Queries theListof states for all available bindings.voidresume(String bindingName)Convenience method to resume the binding with provided `bindingName`.voidstart(String bindingName)Convenience method to start the binding with provided `bindingName`.voidstop(String bindingName)Convenience method to stop the binding with provided `bindingName`.
-
-
-
Constructor Detail
-
BindingsLifecycleController
public BindingsLifecycleController(List<InputBindingLifecycle> inputBindingLifecycles, List<OutputBindingLifecycle> outputBindingsLifecycles)
-
-
Method Detail
-
stop
public void stop(String bindingName)
Convenience method to stop the binding with provided `bindingName`.- Parameters:
bindingName- the name of the binding.
-
start
public void start(String bindingName)
Convenience method to start the binding with provided `bindingName`.- Parameters:
bindingName- the name of the binding.
-
pause
public void pause(String bindingName)
Convenience method to pause the binding with provided `bindingName`.- Parameters:
bindingName- the name of the binding.
-
resume
public void resume(String bindingName)
Convenience method to resume the binding with provided `bindingName`.- Parameters:
bindingName- the name of the binding.
-
changeState
public void changeState(String bindingName, BindingsLifecycleController.State state)
General purpose method to change the state of the provided binding.- Parameters:
bindingName- the name of the binding.state- theBindingsLifecycleController.Stateyou wish to set this binding to
-
queryStates
public List<Map<?,?>> queryStates()
Queries theListof states for all available bindings. The returned list consists ofBindingobjects which could be further interrogated usingBinding.isPaused()andBinding.isRunning().- Returns:
- the list of
Bindings
-
queryState
public List<Binding<?>> queryState(String name)
Queries the individual state of a binding. The returned listBindingobject could be further interrogated usingBinding.isPaused()andBinding.isRunning().- Returns:
- collection of
Bindingobjects.
-
-