Halyri - Server  0.9.1
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
ConnectionController Class Reference

Singleton class managing active emergency connections (Connection). Contains a dictionary for active connections and their identifying GUIDs. All emergency connection state and life cycle methods are handled by this class. Functions as a broker between the mobile emergency connection client and the call center client. More...

Public Member Functions

string GetNewGuidStrig ()
 Generates a new GUID. Currently uses .NET framework's Guid.NewGuid(). No collision checking is performed. All-zero GUIDs are not returned. More...
 
string MobileClientConnected (string transportId)
 Handles connection from a new mobile emergency connection client. The client is given a GUID and marked to have arrived at System.DateTime.Now. The instantiated connection is set to be connected to a remote mobile emergency client. Priority of a new connection is always urgent. More...
 
void MobileClientReconnected (string guid, string transportId)
 Handles reconnection of a mobile emergency connection client. The SignalR connection id for this emergency connection is updated in the corresponding Connection instance. More...
 
void MobileClientDisconnected (string guid)
 Handles disconnect event of a mobile emegency connection client. The Connection is marked as disconnected unless it already has the status "Processed". All active call center connections are notified about the connection state change through callCenterController.PublishUpdatedActiveConnections if the connection was not already in processed state. More...
 
void MobileClientUpdatedLocation (string guid, LocationInformationDto location)
 Adds the location information to the emergency Connection with the specified GUID. All active call center connections are notified about the new information through callCenterController.PublishUpdatedActiveConnections. More...
 
void MobileClientUpdatedPersonalInfo (string guid, PersonalInformationDto personal)
 Updates the mobile emergency client user's personal information in the Connection with the specified GUID. Only call center connections marked as handler for this connection are notified about the updated information through call to their pushUpdatedConnections method. More...
 
void MobileClientUpdatedMobileDeviceInfo (string guid, MobileDeviceInformationDto device)
 Adds updated information about the mobile device to the emergency connection with the specified GUID. Only call center connections marked as handler for this connection are notified about the updated information through call to their pushUpdatedConnections method. More...
 
void MobileClientUpdatedNoSoundStatus (string guid, bool noSound)
 Sets the mobile emergency client request for operation without sound to the Connection. Only call center connections marked as handler for this connection are notified about the updated information through call to their pushUpdatedConnections method. More...
 
void MobileClientUpdatedConnectionPriority (string guid, ConnectionPriorityDto priority)
 Adds updated connection priority to the emergency connection with the specified GUID. All active call center connections are notified about the connection priority change through callCenterController.PublishUpdatedActiveConnections. More...
 
void MobileClientUpdatedInstrumentList (string guid, List< MeasurementInstrumentDto > instruments)
 Updates the list of measurument instruments configured to the emergency client with the specified connection GUID. Only call center connections marked as handler for this connection are notified about the updated information through call to their pushUpdatedConnections method. More...
 
void MobileClientSentTextMessage (string guid, TextMessageDto textMessage)
 Adds a new text based message to the connection message log. Only call center connections marked as handler for this connection are notified about the message through call to their pushUpdatedConnections method. More...
 
void CallCenterClientSendTextMessage (CallCenterConnection callCenterConnection, ConnectionDto connection, TextMessageDto textMessage)
 Sends a text message from a call center client to the specifeid mobile emergency client. More...
 
void MobileClientUpdatedEmergencyType (string guid, EmergencyTypeDto emergencyType)
 Updates the emergency type of an existing emergency connection instance to the specified value. Only the call center connections that are attached handlers for this connection are notified about the change. More...
 
void MobileClientUpdatedMedicalInfo (string guid, MedicalInformationDto medicalInfo)
 Handles medical information updates from mobile emergency client. More...
 
List< ConnectionDtogetAllActiveConnections ()
 Returns a List of all active emergency connections. Currently all connection instances in the Connection dictionary are returned. More...
 
void CallCenterClientHasDisconnected (CallCenterConnection user)
 Method for handling call center client disconnect event. When a call center client disconnects, it no longer marked as a handler for any Connection. If it is the only active handler for a connection, the connection is transferred to hold state. More...
 
void CallCenterClientOpenConnectionForProcessing (CallCenterConnection callCenterConnection, ConnectionDto connection)
 Opens an emergency connection for handling. The provided CallCenterConnection is added to the active handlers of the provided connection unless it already is an associated handler for the connection. Request to open a processed connection for processing will throw a TargetStateFault. More...
 
void CallCenterClientChangePriority (CallCenterConnection callCenterConnection, ConnectionDto connection)
 Changes priority on the provided emergency connection. The new priority must be set on the ConnectionDto supplied as a parameter. More...
 
void CallCenterClientPutOpenOnHold (CallCenterConnection callCenterConnection, ConnectionDto connection)
 Puts an emergency connection on hold. The invocating call center connection will no longer be an attached handler of the connection. If there are other attached callers, the connection will not be put on hold and the requesting call center connection will only be removed from the handlers. More...
 
void CallCenterClientMarkOpenProcessedClose (CallCenterConnection callCenterConnection, ConnectionDto connection)
 Closes the emergency connection and marks it processed. If there are multiple attached handlers on the connection, it is sufficient for one handler to close the connection. Change to the connection state will be propagated to other attached handlers. More...
 
void CallCenterClientRequestRemoteAction (CallCenterConnection callCenterConnection, ConnectionDto connection, RemoteActionDto action)
 Requests an action to be performed by the provided remote mobile emergency client More...
 
void CallCenterClientRequestMediaUpstreaming (CallCenterConnection callCenterConnection, ConnectionDto connection, MediaConfigurationDto mediaConfiguration)
 Requests the mobile emergency client to start upstreaming media according to the provided configuration. More...
 
void CallCenterClientRequestMediaDownstreaming (CallCenterConnection callCenterConnection, ConnectionDto connection, string mediaUrl)
 Requests the mobile emergency client to start downstreaming and playback of media available at the provided url. More...
 
void CallCenterClientRequestStartMeasurement (CallCenterConnection callCenterConnection, ConnectionDto connection, MeasurementInstrumentDto measurementDevice)
 Requests the mobile emergency client enable the specified masurement instrument and start uploading measurement data from it. More...
 
void CallCenterClientRequestStopMeasurement (CallCenterConnection callCenterConnection, ConnectionDto connection, MeasurementInstrumentDto measurementDevice)
 Requests the mobile emergency client to disable the specified measurement instrument and stop uploading data from it. More...
 
void MobileClientUpdatedConnectionLatencyInfo (string guid, ConnectionLatencyInformationDto latencyInfo)
 Updates the latency information for the specified connection GUID. More...
 

Properties

static ConnectionController Instance [get]
 Returns the ConnectionController instance. More...
 

Detailed Description

Singleton class managing active emergency connections (Connection). Contains a dictionary for active connections and their identifying GUIDs. All emergency connection state and life cycle methods are handled by this class. Functions as a broker between the mobile emergency connection client and the call center client.

<author>Veli-Mikko Puupponen, Ilkka Rautiainen</author>

Member Function Documentation

void CallCenterClientChangePriority ( CallCenterConnection  callCenterConnection,
ConnectionDto  connection 
)

Changes priority on the provided emergency connection. The new priority must be set on the ConnectionDto supplied as a parameter.

Throws TargetStateFault if connection is processed, the requesting call center connection is not an associated handler or the connection to the mobile emergency client has been already disconnected. Throws ConnectionFault if the provided Connection does not represent an open emergency connection.

Parameters
callCenterConnectionCallCenterConnection changing the connection priority
connectionConnectioDto identifying the mobile emergency client
void CallCenterClientHasDisconnected ( CallCenterConnection  user)

Method for handling call center client disconnect event. When a call center client disconnects, it no longer marked as a handler for any Connection. If it is the only active handler for a connection, the connection is transferred to hold state.

All call center clients are notified about handler configuration changes to the connections through the callCenterController.PublishUpdatedActiveConnections.

Parameters
userCallCenterConnection that has disconnected
void CallCenterClientMarkOpenProcessedClose ( CallCenterConnection  callCenterConnection,
ConnectionDto  connection 
)

Closes the emergency connection and marks it processed. If there are multiple attached handlers on the connection, it is sufficient for one handler to close the connection. Change to the connection state will be propagated to other attached handlers.

Throws TargetStateFault if connection is processed, the requesting call center connection is not an associated handler or the connection to the mobile emergency client has been already disconnected. Throws ConnectionFault if the provided Connection does not represent an open emergency connection.

Parameters
callCenterConnectionCallCenterConnection closing the connection
connectionConnectioDto identifying the mobile emergency client

be requested.

void CallCenterClientOpenConnectionForProcessing ( CallCenterConnection  callCenterConnection,
ConnectionDto  connection 
)

Opens an emergency connection for handling. The provided CallCenterConnection is added to the active handlers of the provided connection unless it already is an associated handler for the connection. Request to open a processed connection for processing will throw a TargetStateFault.

If the Connection is not already in the InProgress state (i.e. no call center connection is currently associated as its handler), it is transferred to InPrograss state.

All call center clients are notified about handler configuration changes to the connections through the callCenterController.PublishUpdatedActiveConnections.

Throws TargetStateFault if connection is processed or the requesting call center client is already an associated handler for this connection. Throws ConnectionFault if the provided Connection does not represent an open emergency connection.

Parameters
callCenterConnectionCallCenterConnection opening the connection for handling
connectionConnectionDto for the Connection to be opened for handling
void CallCenterClientPutOpenOnHold ( CallCenterConnection  callCenterConnection,
ConnectionDto  connection 
)

Puts an emergency connection on hold. The invocating call center connection will no longer be an attached handler of the connection. If there are other attached callers, the connection will not be put on hold and the requesting call center connection will only be removed from the handlers.

Throws TargetStateFault if connection is processed, the requesting call center connection is not an associated handler or the connection to the mobile emergency client has been already disconnected. Throws ConnectionFault if the provided Connection does not represent an open emergency connection.

Parameters
callCenterConnectionCallCenterConnection putting the connection on hold
connectionConnectioDto identifying the mobile emergency client
void CallCenterClientRequestMediaDownstreaming ( CallCenterConnection  callCenterConnection,
ConnectionDto  connection,
string  mediaUrl 
)

Requests the mobile emergency client to start downstreaming and playback of media available at the provided url.

Throws ConnectionFault, if the CallCenterConnectionDto is not associated with a valid call center client connection Throws TargetStateFault if connection is already processed, does not exist or has disconnected

Parameters
userCallCenterConnection identifying the existing call center client user connection
connectionConnectioDto identifying the target mobile emergency client connection.
mediaUrlLocation of the media to play back at the mobile client
void CallCenterClientRequestMediaUpstreaming ( CallCenterConnection  callCenterConnection,
ConnectionDto  connection,
MediaConfigurationDto  mediaConfiguration 
)

Requests the mobile emergency client to start upstreaming media according to the provided configuration.

Throws ConnectionFault, if the CallCenterConnectionDto is not associated with a valid call center client connection Throws TargetStateFault if connection is already processed, does not exist or has disconnected

Parameters
callCenterConnectionCallCenterConnection identifying the existing call center client user connection
connectionConnectioDto identifying the target mobile emergency client connection.
mediaConfigurationQuality parameters for the requested media
void CallCenterClientRequestRemoteAction ( CallCenterConnection  callCenterConnection,
ConnectionDto  connection,
RemoteActionDto  action 
)

Requests an action to be performed by the provided remote mobile emergency client

Throws FaultException<ConnectionFault> if such connection does not currently exists in active connections collection. Throws FaultException<TargetStateFault> if connection is already processed, has disconnected or the requester is not an associated handler for this connection.

Parameters
userCallCenterConnectionDto of the requester
connectionConnectionDto of the target emergency connection
actionThe cation to be performed by the remote mobile emergency client
void CallCenterClientRequestStartMeasurement ( CallCenterConnection  callCenterConnection,
ConnectionDto  connection,
MeasurementInstrumentDto  measurementDevice 
)

Requests the mobile emergency client enable the specified masurement instrument and start uploading measurement data from it.

Throws ConnectionFault, if the CallCenterConnectionDto is not associated with a valid call center client connection Throws TargetStateFault if connection is already processed, does not exist or has disconnected

Parameters
userCallCenterConnection identifying the existing call center client user connection
connectionConnectioDto identifying the target mobile emergency client connection.
measurementDeviceMeasurement device to enable and start uploading data from
void CallCenterClientRequestStopMeasurement ( CallCenterConnection  callCenterConnection,
ConnectionDto  connection,
MeasurementInstrumentDto  measurementDevice 
)

Requests the mobile emergency client to disable the specified measurement instrument and stop uploading data from it.

Throws ConnectionFault, if the CallCenterConnectionDto is not associated with a valid call center client connection Throws TargetStateFault if connection is already processed, does not exist or has disconnected

Parameters
userCallCenterConnection identifying the existing call center client user connection
connectionConnectioDto identifying the target mobile emergency client connection.
measurementDeviceMeasurement device to disable and stop uploading data from
void CallCenterClientSendTextMessage ( CallCenterConnection  callCenterConnection,
ConnectionDto  connection,
TextMessageDto  textMessage 
)

Sends a text message from a call center client to the specifeid mobile emergency client.

Throws TargetStateFault if connection is processed, the requesting call center connection is not an associated handler or the connection to the mobile emergency client has been already disconnected. Throws ConnectionFault if the provided Connection does not represent an open emergency connection.

Parameters
callCenterConnectionCallCenterConnection opening the connection for handling
connectionConnectionDto for the Connection to be opened for handling
textMessageText message to be sent to the mobile emergency client
List<ConnectionDto> getAllActiveConnections ( )

Returns a List of all active emergency connections. Currently all connection instances in the Connection dictionary are returned.

Returns
List of all emergency connections
string GetNewGuidStrig ( )

Generates a new GUID. Currently uses .NET framework's Guid.NewGuid(). No collision checking is performed. All-zero GUIDs are not returned.

Returns
A new GUID formatted as a string.
string MobileClientConnected ( string  transportId)

Handles connection from a new mobile emergency connection client. The client is given a GUID and marked to have arrived at System.DateTime.Now. The instantiated connection is set to be connected to a remote mobile emergency client. Priority of a new connection is always urgent.

The connection is added to the active connection dictionary and all active call center clients are informed about new connection through callCenterController.PublishUpdatedActiveConnections call.

Parameters
transportIdSignalR connection id related to this client connection
Returns
GUID assigned to this connection
void MobileClientDisconnected ( string  guid)

Handles disconnect event of a mobile emegency connection client. The Connection is marked as disconnected unless it already has the status "Processed". All active call center connections are notified about the connection state change through callCenterController.PublishUpdatedActiveConnections if the connection was not already in processed state.

Parameters
guidGUID of an existing emergency connection
void MobileClientReconnected ( string  guid,
string  transportId 
)

Handles reconnection of a mobile emergency connection client. The SignalR connection id for this emergency connection is updated in the corresponding Connection instance.

Parameters
guidGUID of an existing emergency connection
transportIdSignalR connection id related to this client connection
void MobileClientSentTextMessage ( string  guid,
TextMessageDto  textMessage 
)

Adds a new text based message to the connection message log. Only call center connections marked as handler for this connection are notified about the message through call to their pushUpdatedConnections method.

Throws ConnectionFault if the provided GUID does not match an open emergency connection. Throws TargetStateFault if the emergency connection with the provided GUID is already processed.

Parameters
guidGUID of an existing emergency connection
textMessageText message from the mobile emergency client
void MobileClientUpdatedConnectionLatencyInfo ( string  guid,
ConnectionLatencyInformationDto  latencyInfo 
)

Updates the latency information for the specified connection GUID.

Parameters
guidGUID of an existing emergency connection
latencyInfoLatency information
void MobileClientUpdatedConnectionPriority ( string  guid,
ConnectionPriorityDto  priority 
)

Adds updated connection priority to the emergency connection with the specified GUID. All active call center connections are notified about the connection priority change through callCenterController.PublishUpdatedActiveConnections.

Throws ConnectionFault if the provided GUID does not match an open emergency connection. Throws TargetStateFault if the emergency connection with the provided GUID is already processed.

Parameters
guidGUID of an existing emergency connection
prioritynew priority information
void MobileClientUpdatedEmergencyType ( string  guid,
EmergencyTypeDto  emergencyType 
)

Updates the emergency type of an existing emergency connection instance to the specified value. Only the call center connections that are attached handlers for this connection are notified about the change.

Throws ConnectionFault if the provided GUID does not match an open emergency connection. Throws TargetStateFault if the emergency connection with the provided GUID is already processed.

Parameters
guidGUID of an existing emergency connection
emergencyTypeEmergency type specified by the mobile emergency client
void MobileClientUpdatedInstrumentList ( string  guid,
List< MeasurementInstrumentDto instruments 
)

Updates the list of measurument instruments configured to the emergency client with the specified connection GUID. Only call center connections marked as handler for this connection are notified about the updated information through call to their pushUpdatedConnections method.

Throws ConnectionFault if the provided GUID does not match an open emergency connection. Throws TargetStateFault if the emergency connection with the provided GUID is already processed.

Parameters
guidGUID of an existing emergency connection
instrumentsList of unstruments at the mobile device usin the connection with the GUID
void MobileClientUpdatedLocation ( string  guid,
LocationInformationDto  location 
)

Adds the location information to the emergency Connection with the specified GUID. All active call center connections are notified about the new information through callCenterController.PublishUpdatedActiveConnections.

Throws ConnectionFault if the provided GUID does not match an open emergency connection. Throws TargetStateFault if the emergency connection with the provided GUID is already processed.

Parameters
guidGUID of an existing emergency connection
locationemergency connectio client's new location
void MobileClientUpdatedMedicalInfo ( string  guid,
MedicalInformationDto  medicalInfo 
)

Handles medical information updates from mobile emergency client.

TODO: this functionality is not implemented.

Parameters
guidGUID of an existing emergency connection
medicalInfoMedican information for the emergency client
void MobileClientUpdatedMobileDeviceInfo ( string  guid,
MobileDeviceInformationDto  device 
)

Adds updated information about the mobile device to the emergency connection with the specified GUID. Only call center connections marked as handler for this connection are notified about the updated information through call to their pushUpdatedConnections method.

Throws ConnectionFault if the provided GUID does not match an open emergency connection. Throws TargetStateFault if the emergency connection with the provided GUID is already processed.

Parameters
guidGUID of an existing emergency connection
devicenew device information
void MobileClientUpdatedNoSoundStatus ( string  guid,
bool  noSound 
)

Sets the mobile emergency client request for operation without sound to the Connection. Only call center connections marked as handler for this connection are notified about the updated information through call to their pushUpdatedConnections method.

Throws ConnectionFault if the provided GUID does not match an open emergency connection. Throws TargetStateFault if the emergency connection with the provided GUID is already processed.

Parameters
guidGUID of an existing emergency connection
noSoundtrue, if operation without sound is requested
void MobileClientUpdatedPersonalInfo ( string  guid,
PersonalInformationDto  personal 
)

Updates the mobile emergency client user's personal information in the Connection with the specified GUID. Only call center connections marked as handler for this connection are notified about the updated information through call to their pushUpdatedConnections method.

Throws ConnectionFault if the provided GUID does not match an open emergency connection. Throws TargetStateFault if the emergency connection with the provided GUID is already processed.

Parameters
guidGUID of an existing emergency connection
personalnew personal information

Property Documentation

ConnectionController Instance
staticget

Returns the ConnectionController instance.


The documentation for this class was generated from the following file: