Class IntegrityRemotingServer
- java.lang.Object
-
- de.gebit.integrity.remoting.server.IntegrityRemotingServer
-
public class IntegrityRemotingServer extends java.lang.Object
The server implementation.- Author:
- Rene Schneider - initial API and implementation
-
-
Constructor Summary
Constructors Constructor Description IntegrityRemotingServer(java.lang.String aHostIP, int aPort, IntegrityRemotingServerListener aListener, java.lang.ClassLoader aClassLoader, boolean anIsForkFlag)
Creates a new server, listening on a specified port and a specified host IP.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeAll(boolean anEmptyOutputQueueFlag)
Closes all connections to clients.void
confirmBreakpointCreation(int anEntryReference)
Notifies all clients about the creation of a breakpoint.void
confirmBreakpointRemoval(int anEntryReference)
Notifies all clients about the removal of a breakpoint.protected java.util.Map<java.lang.Class<? extends AbstractMessage>,MessageProcessor<?>>
createProcessors()
Creates the processors for processing incoming messages.int
getPort()
boolean
isFork()
void
sendAbortMessage(java.lang.String anExceptionMessage, java.lang.String anExceptionStackTrace)
Transmits an abortion message.void
sendForkResultSummaryMessage(java.lang.Integer aSuccessCount, java.lang.Integer aFailureCount, java.lang.Integer aTestExceptionCount, java.lang.Integer aCallExceptionCount)
Sends a fork result summary message.void
sendTestRunnerCallbackData(java.lang.String aCallbackClassName, TestRunnerCallbackMethods aMethod, java.io.Serializable[] someData)
Sends data from a test runner callback in a fork to the master, which will then forward it to the matching callback.void
sendTestTimeSyncRequest(java.util.Date aStartDate, java.util.List<org.eclipse.xtext.util.Pair<java.lang.Long,java.time.temporal.TemporalUnit>> aDiffTime, java.math.BigDecimal aProgressionFactor, java.lang.String[] someTargetedForks)
Sends a test time sync message.void
sendTestTimeSyncResponse(TimeSyncResultMessage aResultMessage)
Sends a response to a test time sync request.void
sendVariableUnset(java.lang.String aVariableName)
Transmits an unsetting of a variables' value to the master.void
sendVariableUpdate(java.lang.String aVariableName, java.io.Serializable aValue)
Transmits an update for a variables' value to the master.void
updateExecutionState(ExecutionStates aNewState)
Updates the execution state, broadcasting a message to all clients to notify them about that change.void
updateSetList(java.lang.Integer anEntryInExecution, SetListEntry... someUpdatedEntries)
Transmits updates to someSetListEntry
instances to all clients.
-
-
-
Constructor Detail
-
IntegrityRemotingServer
public IntegrityRemotingServer(java.lang.String aHostIP, int aPort, IntegrityRemotingServerListener aListener, java.lang.ClassLoader aClassLoader, boolean anIsForkFlag) throws java.net.UnknownHostException, java.io.IOException
Creates a new server, listening on a specified port and a specified host IP.- Parameters:
aHostIP
- the host IP to listen onaPort
- the port to listen on (0 = auto-choose a free port)aListener
- the listeneraClassLoader
- the classloader to use when deserializing objectsanIsForkFlag
- whether this remoting server is serving inside an Integrity fork process- Throws:
java.net.UnknownHostException
java.io.IOException
-
-
Method Detail
-
closeAll
public void closeAll(boolean anEmptyOutputQueueFlag)
Closes all connections to clients.- Parameters:
anEmptyOutputQueueFlag
- whether the output message queue shall be emptied before closing the connection
-
updateExecutionState
public void updateExecutionState(ExecutionStates aNewState)
Updates the execution state, broadcasting a message to all clients to notify them about that change.- Parameters:
aNewState
- the new state
-
updateSetList
public void updateSetList(java.lang.Integer anEntryInExecution, SetListEntry... someUpdatedEntries)
Transmits updates to someSetListEntry
instances to all clients.- Parameters:
anEntryInExecution
- the entry in execution (null if nothing changed)someUpdatedEntries
- the updated entries
-
confirmBreakpointCreation
public void confirmBreakpointCreation(int anEntryReference)
Notifies all clients about the creation of a breakpoint.- Parameters:
anEntryReference
- the entry at which the breakpoint was created
-
confirmBreakpointRemoval
public void confirmBreakpointRemoval(int anEntryReference)
Notifies all clients about the removal of a breakpoint.- Parameters:
anEntryReference
- the entry at which the breakpoint was removed
-
sendTestRunnerCallbackData
public void sendTestRunnerCallbackData(java.lang.String aCallbackClassName, TestRunnerCallbackMethods aMethod, java.io.Serializable[] someData)
Sends data from a test runner callback in a fork to the master, which will then forward it to the matching callback.- Parameters:
aCallbackClassName
- the name of the callback classaMethod
- the method being calledsomeData
- the data
-
sendVariableUpdate
public void sendVariableUpdate(java.lang.String aVariableName, java.io.Serializable aValue)
Transmits an update for a variables' value to the master.- Parameters:
aVariableName
- the name of the variableaValue
- the updated value
-
sendVariableUnset
public void sendVariableUnset(java.lang.String aVariableName)
Transmits an unsetting of a variables' value to the master.- Parameters:
aVariableName
- the name of the variable
-
sendAbortMessage
public void sendAbortMessage(java.lang.String anExceptionMessage, java.lang.String anExceptionStackTrace)
Transmits an abortion message.- Parameters:
anExceptionMessage
-anExceptionStackTrace
-
-
sendTestTimeSyncRequest
public void sendTestTimeSyncRequest(java.util.Date aStartDate, java.util.List<org.eclipse.xtext.util.Pair<java.lang.Long,java.time.temporal.TemporalUnit>> aDiffTime, java.math.BigDecimal aProgressionFactor, java.lang.String[] someTargetedForks)
Sends a test time sync message.- Parameters:
aStartDate
-aProgressionFactor
-
-
sendTestTimeSyncResponse
public void sendTestTimeSyncResponse(TimeSyncResultMessage aResultMessage)
Sends a response to a test time sync request.- Parameters:
anExceptionMessage
-anExceptionStackTrace
-
-
sendForkResultSummaryMessage
public void sendForkResultSummaryMessage(java.lang.Integer aSuccessCount, java.lang.Integer aFailureCount, java.lang.Integer aTestExceptionCount, java.lang.Integer aCallExceptionCount)
Sends a fork result summary message.- Parameters:
aSuccessCount
- the number of successful testsaFailureCount
- the number of failed testsaTestExceptionCount
- the number of exceptions in testsaCallExceptionCount
- the number of call exceptions in tests
-
createProcessors
protected java.util.Map<java.lang.Class<? extends AbstractMessage>,MessageProcessor<?>> createProcessors()
Creates the processors for processing incoming messages.- Returns:
- a map of message classes to processors
-
getPort
public int getPort()
-
isFork
public boolean isFork()
-
-