#include <server.h>
Public Slots | |
void | start () |
void | forceStart () |
void | stop (bool force) |
void | stop () |
void | dispatchJobStateChange (const MoleQueue::Job &job, MoleQueue::JobState oldState, MoleQueue::JobState newState) |
Signals | |
void | connectionError (MoleQueue::ConnectionListener::Error error, const QString &message) |
Public Member Functions | |
Server (QObject *parentObject=0, QString serverName_="MoleQueue") | |
~Server () | |
JobManager * | jobManager () |
const JobManager * | jobManager () const |
QueueManager * | queueManager () |
const QueueManager * | queueManager () const |
void | readSettings (QSettings &settings) |
void | writeSettings (QSettings &settings) const |
QString | workingDirectoryBase () const |
QString | serverName () const |
Protected Slots | |
void | jobAboutToBeAdded (MoleQueue::Job job) |
void | newConnectionAvailable (MoleQueue::Connection *connection) |
void | clientDisconnected () |
void | handleMessage (const MoleQueue::Message &message) |
Protected Member Functions | |
void | timerEvent (QTimerEvent *) |
Protected Attributes | |
QList< Connection * > | m_connections |
JobManager * | m_jobManager |
QueueManager * | m_queueManager |
JsonRpc * | m_jsonrpc |
QString | m_workingDirectoryBase |
IdType | m_moleQueueIdCounter |
QMap< IdType, Connection * > | m_connectionLUT |
QMap< IdType, EndpointIdType > | m_endpointLUT |
The Server class handles incoming JSON-RPC messages.
The Server class is the root of the server-side heirarchy. It owns the JobManager, QueueManager, and JsonRpc listener.
|
explicit |
Constructor.
parentObject | The parent. |
~Server | ( | ) |
Destructor.
JobManager* jobManager | ( | ) |
const JobManager* jobManager | ( | ) | const |
QueueManager* queueManager | ( | ) |
const QueueManager* queueManager | ( | ) | const |
void readSettings | ( | QSettings & | settings | ) |
settings | QSettings object to write state to. |
void writeSettings | ( | QSettings & | settings | ) | const |
settings | QSettings object to read state from. |
QString workingDirectoryBase | ( | ) | const |
The working directory where running job file are kept.
QString serverName | ( | ) | const |
The string the server uses to listen for connections.
|
signal |
Emitted when a connection listener fails to start.
|
slot |
Start listening for incoming connections.
If an error occurs, connectionError will be emitted. If an AddressInUseError occurs on Unix due to a crashed Server that failed to clean up, call forceStart to remove any existing sockets.
|
slot |
Start listening for incoming connections, removing any existing socket handles first.
|
slot |
Terminate the socket server.
Server | will pass the value of force when stop it connections. |
|
slot |
Terminate the socket server.
Same as stop(false)
|
slot |
Find the client that owns job and send a notification to the client that the JobState has changed.
job | Job of interest. |
oldState | Previous state of job. |
newState | New state of job. |
|
protectedslot |
Set the MoleQueue Id of a job before it is added to the manager.
job | The new Job. |
|
protectedslot |
Called when the internal socket server has a new connection ready.
|
protectedslot |
Called when a client disconnects from the server. This function expects sender() to return a ServerConnection.
|
protectedslot |
handleMessage Called when the JsonRpc listener receives a message.
|
protected |
timerEvent Reimplemented from QObject.
|
protected |
List of active connections.
|
protected |
The JobManager for this Server.
|
protected |
The QueueManager for this Server.
|
protected |
Local directory for running jobs.
|
protected |
Counter for MoleQueue job ids.