/// <summary> /// Handle a GetVehicleInfo message. /// </summary> /// <param name="msg">The message to process.</param> private void Handle(GetVehicleInfo msg) { // simulate web-service call VehicleInfoAvailable info = new VehicleInfoAvailable(msg.VehicleId, GetRandomBrand(), GetRandomColor()); Sender.Tell(info); }
internal void Handle(GetVehicleInfo input) { using (var dbConn = DatabaseManager.DbConn()) { var vi = dbConn.ExecuteBpl(new VehicleGetById { VehicleId = input.VehicleId }); if (vi.NotNull()) { Reply(vi.VehicleInfo); } else { Reply(null); } } }
/// <summary> /// Handle a GetVehicleInfo message. /// </summary> /// <param name="msg">The message to process.</param> private void Handle(GetVehicleInfo msg) { // simulate web-service call ... // create event string brand = GetRandomBrand(); string color = GetRandomColor(); VehicleInfoAvailable info = new VehicleInfoAvailable(msg.VehicleId, brand, color); // send response to sender Sender.Tell(info); }
internal void Handle(GetVehicleInfo input) { Log.Trace("Request vehicle info from BP"); // TODO: this is hardcoded for IL, need to rewrite either to use IL/DK RV bus, or global bus if (TibcoBroker.TibcoRvIl != null) { TibcoBroker.TibcoRvIl.Send(new S.VehicleInfoRequest { VehicleId = input.VehicleId }, (S.VehicleInfoResponse r) => { Reply(_getVehicleInfo(r)); }, e => { Log.Warn("Unable to get vehicle information {0}", e); Throw(GeneralFailureCode.ServiceUnavailable); }); } }
private void Handle(GetVehicleInfo message) { switch (message.Registration) { case "1S32456": Sender.Tell(new VehicleInfoAvailable("bílé", "Škoda Octavia")); break; case "1S81519": Sender.Tell(new VehicleInfoAvailable("červené", "BMW E3")); break; case "2U65487": Sender.Tell(new VehicleInfoAvailable("černé", "Audi A8")); break; } }
public void RequestVehicleInfo(BplIdentity vehicleId) { var info = new GetVehicleInfo { VehicleId = vehicleId }; var server = (OscarServer)(OscarServer.Current); Forward(info, _onSuccess, _onFailure); }