public class SignalApiImpl extends Object implements SignalApi
Modifier and Type | Field and Description |
---|---|
static String |
READY_PREFIX |
Constructor and Description |
---|
SignalApiImpl(String originator,
TaskId taskId,
SynchronizationInternal synchronizationInternal) |
Modifier and Type | Method and Description |
---|---|
Map<String,Map<String,String>> |
checkForSignals(Set<String> signalsSubSet)
Check if all of the signals given as input exist among the set of job signals
|
void |
clearJobSignals()
Remove the entry corresponding to job signals from the signals channel
|
Map<String,Signal> |
getJobSignals()
Return the set of job signals
|
boolean |
isReceived(String signalName)
Check if the given signal was received
|
void |
readyForSignal(String signalName)
Add a new signal to the set of job signals
|
void |
readyForSignal(String signalName,
List<JobVariable> variables)
Add a new signal to the set of job signals
|
void |
removeManySignals(Set<String> signalsSubSet)
Remove the given set of signals from job signals
In order to remove signals that were not yet received, the signalsSubSet parameter should contain the "ready_" prefix and the signal names
|
void |
removeSignal(String signalName)
Remove the given
signal from the set of job signals
In order to remove a signal that was not yet received, the signalsSubSet parameter should contain the "ready_" prefix and the signal name |
void |
sendManySignals(Map<String,Map<String,String>> signalParameters)
Add the given set of signals to job signals
|
void |
sendManySignals(Set<String> signalsSubSet)
Add the given set of signals to job signals
|
void |
sendSignal(String signalName)
Add the given
signal to the set of job signals |
void |
sendSignal(String signalName,
Map<String,String> parameters)
Add the given
signal to the set of job signals |
Map<String,String> |
waitFor(String signalName)
Wait until the given signal is added to the set of job signals
|
Map<String,Map<String,String>> |
waitForAll(Set<String> signalsSubSet)
Wait until all the input signals are added to the set of job signals
|
Signal |
waitForAny(Set<String> signalsSubSet)
Wait until one signal (among those of the given
signalsSubSet ) is added to the set of job signals |
public static final String READY_PREFIX
public SignalApiImpl(String originator, TaskId taskId, SynchronizationInternal synchronizationInternal)
public void readyForSignal(String signalName, List<JobVariable> variables) throws SignalApiException
SignalApi
readyForSignal
in interface SignalApi
signalName
- name of the signal to be addedvariables
- the input variables of the signal to be addedSignalApiException
- if an error occurred while reading in the signals channel, or when adding the ready signal to job signalspublic void readyForSignal(String signalName) throws SignalApiException
SignalApi
readyForSignal
in interface SignalApi
signalName
- name of the signal to be addedSignalApiException
- if an error occurred while reading in the signals channel, or when adding the ready signal to job signalspublic boolean isReceived(String signalName) throws SignalApiException
SignalApi
isReceived
in interface SignalApi
signalName
- name of the signal to be checkedSignalApiException
- if an error occurred while reading in the signals channelpublic Map<String,Map<String,String>> checkForSignals(Set<String> signalsSubSet) throws SignalApiException
SignalApi
checkForSignals
in interface SignalApi
signalsSubSet
- set of the signals to be checkedSignalApiException
- if an error occurred while reading in the signals channelpublic void sendSignal(String signalName, Map<String,String> parameters) throws SignalApiException
SignalApi
signal
to the set of job signalssendSignal
in interface SignalApi
signalName
- name of the signal to be added to job signalsparameters
- the updated values of the signal to be addedSignalApiException
- if the corresponding ready signal does not exist, or when an error occurs while sending the signalpublic void sendSignal(String signalName) throws SignalApiException
SignalApi
signal
to the set of job signalssendSignal
in interface SignalApi
signalName
- name of the signal to be added to job signalsSignalApiException
- if the corresponding ready signal does not exist, or when an error occurs while sending the signalpublic void sendManySignals(Map<String,Map<String,String>> signalParameters) throws SignalApiException
SignalApi
sendManySignals
in interface SignalApi
signalParameters
- a map containing the signal name and the updated values of the signalSignalApiException
- if an error occurred while reading in the signals channel, or when adding the signals to job signalspublic void sendManySignals(Set<String> signalsSubSet) throws SignalApiException
SignalApi
sendManySignals
in interface SignalApi
signalsSubSet
- set of the signals to be added to job signalsSignalApiException
- if an error occurred while reading in the signals channel, or when adding the signals to job signalspublic void removeSignal(String signalName) throws SignalApiException
SignalApi
signal
from the set of job signals
In order to remove a signal that was not yet received, the signalsSubSet parameter should contain the "ready_" prefix and the signal nameremoveSignal
in interface SignalApi
signalName
- name of the signal to be removed from job signalsSignalApiException
- if an error occurred while reading in the signals channel, or when removing the signal from job signalspublic void removeManySignals(Set<String> signalsSubSet) throws SignalApiException
SignalApi
removeManySignals
in interface SignalApi
signalsSubSet
- set of the signals to be removed from job signalsSignalApiException
- if an error occurred while reading in the signals channel, or when removing the signals from job signalspublic Map<String,Signal> getJobSignals() throws SignalApiException
SignalApi
getJobSignals
in interface SignalApi
SignalApiException
- if an error occurred while reading in the signals channelpublic void clearJobSignals() throws SignalApiException
SignalApi
clearJobSignals
in interface SignalApi
SignalApiException
- if an error occurred while reading in the signals channel, or when removing an entry from this channelpublic Map<String,String> waitFor(String signalName) throws SignalApiException
SignalApi
waitFor
in interface SignalApi
signalName
- name of the signal to wait forSignalApiException
- if an error occurred while reading in the signals channelpublic Signal waitForAny(Set<String> signalsSubSet) throws SignalApiException
SignalApi
signalsSubSet
) is added to the set of job signalswaitForAny
in interface SignalApi
signalsSubSet
- set of the signals to wait for any of themSignalApiException
- if an error occurred while reading in the signals channelpublic Map<String,Map<String,String>> waitForAll(Set<String> signalsSubSet) throws SignalApiException
SignalApi
waitForAll
in interface SignalApi
signalsSubSet
- set of the signals to wait forSignalApiException
- if an error occurred while reading in the signals channel