/// <summary> /// /// </summary> /// <param name="sess"></param> /// <returns></returns> public static Job CreateRestartJob(this ISessionInfo sess) { var ctrl = sess.CreateRestartControl(); var job = ctrl.CreateJob(); return(job); }
public async Task UpdateSessionInfo(ISessionInfo session) { if (!initialized) { await InitializeAsync(); } var entity = new SessionInfoEntity { PartitionKey = session.ClientDeviceId, RowKey = session.ClientSessionId + DateTime.UtcNow.ToString("yyyyMMddHHmmssfff"), AvailableResolution = session.AvailableResolution, ClientDeviceId = session.ClientDeviceId, ClientSessionId = session.ClientSessionId, IPAddress = session.IPAddress, LocationLatitude = session.LocationLatitude, LocationLongitude = session.LocationLongitude, Resolution = session.Resolution, }; var table = tableClient.GetTableReference(SessionInfoTableName); var status = await table.InsertAsync(entity); if (status >= 400) { throw new HttpStatusException("EntityErrorInsert:SessionInfo", status); } }
private void Write(IAppInfo appInfo, ISessionInfo sessionInfo, DateTime instant, int duration, string screen, string msisdn, string screenType, string accessMode, string executedBy, int viewstateBytes, int sessionBytes, int sessionRequests) { Instant = instant; Duration = duration; Screen = screen; SessionId = sessionInfo.SessionID; EspaceId = appInfo.eSpaceId; TenantId = appInfo.TenantId; UserId = sessionInfo.UserId; Msisdn = msisdn; ScreenType = screenType; AccessMode = ScreenLogDefinition.NotNullAccessMode(accessMode); ExecutedBy = executedBy; ViewstateBytes = viewstateBytes; SessionBytes = sessionBytes; SessionRequests = sessionRequests; RequestTracer reqTracer = RuntimePlatformUtils.GetRequestTracer(); if (reqTracer != null) { RequestKey = reqTracer.RequestKey; ActionName = reqTracer.EntryActionName; } ClientIP = RuntimePlatformUtils.GetRequestSourceForLogging()?.Left(MAX_CLIENT_IP_SIZE); EspaceName = appInfo.eSpaceName; ApplicationName = appInfo.ApplicationName; ApplicationKey = appInfo.ApplicationUIDAsKey; Username = sessionInfo.UserName; log.Write(); }
public HomeController(IOrganizationBusiness orgBusiness, ISessionInfo sessionInfo, IRosterBusiness rosterBusiness, IProvisioningRulesBusiness provisioningRuleBusiness) { _orgBusiness = orgBusiness; _sessionInfo = sessionInfo; _rosterBusiness = rosterBusiness; _provisioningRuleBusiness = provisioningRuleBusiness; }
private readonly IProvisioningRulesBusiness _provisioningRuleBusiness; public SyncController(IOrganizationBusiness orgBusiness, ISessionInfo sessionInfo, ISetupBusiness setupBusiness, IProvisioningRulesBusiness provisioningRuleBusiness) { _orgBusiness = orgBusiness; _sessionInfo = sessionInfo; _setupBusiness = setupBusiness; _provisioningRuleBusiness = provisioningRuleBusiness; }
static int[] GetDGDegreeKey(ISessionInfo sess) { var Degs = sess.KeysAndQueries.Where(kv => kv.Key.StartsWith("DGdegree:")).OrderBy(kv => kv.Key); int[] a = Degs.Select(kv => Convert.ToInt32(kv.Value)).ToArray(); return(a); }
public static void StaticWrite(IAppInfo appInfo, ISessionInfo sessionInfo, DateTime instant, int duration, string screen, string msisdn, string screenType, string accessMode, string executedBy, int viewstateBytes, int sessionBytes, int sessionRequests) { ScreenLog log = new ScreenLog(); log.Write(appInfo, sessionInfo, instant, duration, screen, msisdn, screenType, accessMode, executedBy, viewstateBytes, sessionBytes, sessionRequests); }
public void TestCleanUpDatabase() { ISessionInfo sess = databaseWithFiles.Controller.CopySession(databaseWithFiles.Controller.Sessions.First(), emptyDatabase); int fileCountBefore = CountAllFiles(emptyDatabase.Path); // create a bunch of files in the data subdirectory and clean up the database afterwards for (int i = 0; i < 10; i++) { string rndFile = Path.Combine(emptyDatabase.Path, "data", Guid.NewGuid().ToString() + ".1.data"); if (!File.Exists(rndFile)) { FileStream fs = File.Create(rndFile); fs.Close(); } } emptyDatabase.Controller.CleanDatabase(); int fileCountAfter = CountAllFiles(emptyDatabase.Path); Assert.IsTrue( fileCountBefore == fileCountAfter, "Either not all or too many files deleted by clean-up operation"); }
public String DriverInfo(String method, IStandingsItem standing, ISessionInfo session, Int32 rounding) { switch (method) { case "test": return("test succesful"); break; case "drivername": return(standing.Driver.Name); break; case "fuel": return(((Single)this.sdk.GetData("FuelLevel")).ToString()); break; default: return("[invalid]"); break; } }
public UpdaterViewModel(IEventAggregator eventAggregator, IDataTransport dataTransport, IServerInfo serverInfo, ISessionInfo sessionInfo) { _eventAggregator = eventAggregator; _serverInfo = serverInfo; _sessionInfo = sessionInfo; // _isVisible = Visibility.Visible; _isVisible = Visibility.Collapsed; LastTime = AutoRestartTime; _dataTransport = dataTransport; RestartAppCommand = new DelegateCommand <object>(RestartApp); WaitForUpdateCommand = new DelegateCommand <object>(UpdateAbortedByUser); _checkTimer = new DispatcherTimer { Interval = new TimeSpan(0, 0, _serverInfo.UpdateInterval, 0) }; _checkTimer.Tick += StartCheckUpdatesThread; _restartTimer = new DispatcherTimer { Interval = new TimeSpan(0, 0, 0, 1) }; _restartTimer.Tick += RestartTimerTick; }
public static string StaticWrite(IAppInfo appInfo, ISessionInfo sessionInfo, DateTime instant, string loginId, string errorId, string executedBy, string action, int duration, string source, string endpoint, string originalRequestKey) { ServiceAPILogDefinition logDef = new ServiceAPILogDefinition { Id = ServiceAPILogDefinition.GenerateLogId(), Instant = instant, SessionId = sessionInfo.SessionID, UserId = sessionInfo.UserId, LoginId = loginId, EspaceId = appInfo.eSpaceId, TenantId = appInfo.TenantId, ErrorId = errorId, ExecutedBy = executedBy, Action = action, Duration = duration, Source = source, Endpoint = endpoint, EspaceName = appInfo.eSpaceName, ApplicationName = appInfo.ApplicationName, ApplicationKey = appInfo.ApplicationUIDAsKey, Username = sessionInfo.UserName, OriginalRequestKey = originalRequestKey }; RequestTracer reqTracer = RuntimePlatformUtils.GetRequestTracer(); if (reqTracer != null) { logDef.RequestKey = reqTracer.RequestKey; } logDef.Write(); return(logDef.Id); }
public BasicAuthenticationHandler(IOptionsMonitor <AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder urlEncoder, ISystemClock systemClock, ISessionCache sessionCache, ISessionInfo sessionInfo) : base(options, logger, urlEncoder, systemClock) { _sessionCache = sessionCache; _sessionInfo = sessionInfo; }
/// <summary> /// Override the original run method defined by the super-class because /// we don't want to run an actual calculation. Plots the data for /// every selected time-step. /// </summary> protected void Run() { ISessionInfo session = m_Database.Controller.GetSessionInfo(m_config.SessionGuid); var timesteps = session.Timesteps.Where( tsi => this.m_config.TimeSteps.Contains(tsi.TimeStepNumber)).ToArray(); int TotCnt = timesteps.Count(); int process = this.DBDriver.MyRank + 1; int processCount = this.DBDriver.Size; this.m_info = this.m_Database.Controller.GetSessionInfo(this.m_config.SessionGuid); GC.Collect(); for (int i = 0; i < timesteps.Length; i++) { var ts = timesteps[i]; double physTime = ts.PhysicalTime; TimestepNumber timestepNo = ts.TimeStepNumber; if (this.GridDat == null || !this.GridDat.Grid.ID.Equals(ts.Grid.ID)) { WriteMessage(process, processCount, "Loading grid ..."); GridCommons grid = DBDriver.LoadGrid(ts.Grid.ID, m_Database); this.GridDat = this.m_Database.Controller.GetInitializationContext(ts).GridData; WriteMessage(process, processCount, " Number of cells: " + this.GridDat.Grid.NoOfUpdateCells); this.CreatePlotter(); } WriteMessage(process, processCount, "Loading timestep ... (" + (i + 1) + " of " + TotCnt + ")"); var fields = DBDriver.LoadFields(ts, this.GridDat, this.m_config.FieldNames).ToList(); WriteMessage(process, processCount, "Loaded timestep " + timestepNo + ". Plotting..."); //{ // Console.WriteLine("computing vorticity..."); // DGField velX = fields.Single(f => f.Identification == "VelocityX"); // DGField velY = fields.Single(f => f.Identification == "VelocityY"); // DGField vortZ = velX.CloneAs(); // vortZ.Identification = "Vorticity"; // vortZ.Clear(); // vortZ.DerivativeByFlux(1.0, velY, 0); // vortZ.DerivativeByFlux(-1.0, velX, 1); // Console.WriteLine("done."); // fields.Add(vortZ); //} PlotCurrentState(fields, physTime, timestepNo); double perc = Math.Round(100.0 * (double)(i + 1) / (double)TotCnt, 1); WriteMessage(process, processCount, "Finished timestep (" + perc + "% of timesteps done)"); // Free memory if possible timesteps[i] = null; GC.Collect(); } }
/// <summary>Initializes the <see cref="SessionInfo" /> instance, using the specified <see cref="ISessionInfo" /> object to populate its properties.</summary> /// <param name="sessionInfo">A <see cref="ISessionInfo" /> object used to overwrite the data in the current instance.</param> public virtual void Init(ISessionInfo sessionInfo) { this.BaseDomain = sessionInfo.BaseDomain; this.Expires = sessionInfo.Expires; this.Secret = sessionInfo.Secret; this.SessionKey = sessionInfo.SessionKey; this.Uid = sessionInfo.Uid; }
public bool TryGetSessionInfo(IRequest req, out ISessionInfo sinfo) { SessionInfo si; bool success = Services.TryGetSessionInfo((Request)req, out si); sinfo = si; return(success); }
public ApplicationServiceBase( ISessionInfo session, IUnitOfWorkManager uowManager ) { Session = session ?? throw new ArgumentNullException(nameof(session)); UowManager = uowManager ?? throw new ArgumentNullException(nameof(uowManager)); }
public ResourcesAppService( ISessionInfo session, IUnitOfWorkManager uowManager, IResourceRepository resourceRepository) : base(session, uowManager) { _resourceRepository = resourceRepository ?? throw new ArgumentNullException(nameof(resourceRepository)); }
/// <summary> /// Saves a session info object to a file on the disk. /// </summary> /// <param name="session">The session to be saved.</param> public void SaveSessionInfo(ISessionInfo session) { using (Stream s = fsDriver.GetSessionInfoStream(true, session.ID)) { Driver.Serialize(s, session, typeof(SessionInfo)); s.Close(); } }
/// <summary> /// Constructs a proxy for the time-step with the given /// <paramref name="timestepGuid"/> within the given /// <paramref name="session"/>. /// </summary> /// <param name="timestepGuid"></param> /// <param name="session"></param> public TimestepProxy(Guid timestepGuid, ISessionInfo session) { this.ID = timestepGuid; this.Session = session; realTimestepInfo = new ExpirableLazy <TimestepInfo>( () => session.Database.Controller.DBDriver.LoadTimestepInfo(timestepGuid, session, session.Database), t => Utils.GetTimestepFileWriteTime(t) == t.WriteTime); }
/// <summary> /// Retrieves the directory where the exports for the selected /// <paramref name="session"/> are stored. /// </summary> /// <param name="session"> /// The selected session. /// </param> /// <remarks> /// Should work on any System. /// </remarks> public static string GetExportDirectory(ISessionInfo session) { string path = Path.Combine( Utils.GetExportOutputPath(), StandardFsDriver.SessionsDir, session.ID.ToString()); return(path); }
public String DriverInfo(String method, IStandingsItem standing, ISessionInfo session, Int32 rounding) { switch (method) { default: return "[invalid]"; break; } }
public String SessionInfo(String method, ISessionInfo session, Int32 rounding) { switch (method) { default: return "[invalid]"; break; } }
/// <summary> /// Retrieves the directory where the files for the selected /// <paramref name="session"/> are stored. /// </summary> /// <param name="session"> /// The selected session. /// </param> /// <remarks> /// Should work on any System. /// </remarks> public static string GetSessionDirectory(ISessionInfo session) { string path = Path.Combine( session.Database.Path, StandardFsDriver.SessionsDir, session.ID.ToString()); return(path); }
public String SessionInfo(String method, ISessionInfo session, Int32 rounding) { switch (method) { default: return("[invalid]"); break; } }
static ISessionInfo CreateSession(int numberOfVoronoiCells) { AppControl lShape = VoronoiControl.TestVoronoi_LDomain(numberOfVoronoiCells, db: Database); IApplication poisson = new SipPoissonMain(); RunApplication(poisson, lShape); ISessionInfo session = poisson.CurrentSessionInfo; return(session); }
private JobStatus GetStatus(out int SubmitCount, out string DD) { SubmitCount = 0; DD = null; if (AssignedBatchProc == null) { return(JobStatus.PreActivation); } bool isSubmitted, isRunning, wasSuccessful, isFailed; AssignedBatchProc.EvaluateStatus(this, out SubmitCount, out isRunning, out wasSuccessful, out isFailed, out DD); isSubmitted = SubmitCount > 0; bool isPending = isSubmitted && !(isRunning || wasSuccessful || isFailed); if (isPending) { return(JobStatus.PendingInExecutionQueue); } if (isRunning) { return(JobStatus.InProgress); } ISessionInfo[] RR = this.AllSessions; ISessionInfo R = RR.Length > 0 ? RR.OrderBy(si => si.CreationTime).Last() : null; //if (RR.Length == 0) // // maybe finished, but no result is known. // return JobStatus.PreActivation; if (wasSuccessful || RR.Any(si => !si.Tags.Contains(BoSSS.Solution.Application.NOT_TERMINATED_TAG))) { return(JobStatus.FinishedSuccessful); } if (isSubmitted && !(isFailed || wasSuccessful) && (R == null)) { return(JobStatus.PendingInExecutionQueue); } if (isSubmitted == false && isRunning == false && wasSuccessful == false && isFailed == false && (RR.Length <= 0)) { return(JobStatus.PreActivation); } if (isFailed || (R == null || R.Tags.Contains(BoSSS.Solution.Application.NOT_TERMINATED_TAG))) { return(JobStatus.Failed); } throw new IOException("Unable to determine job status."); }
/// <summary> /// Creates a plot instruction for the plotting of /// <paramref name="session"/>. /// </summary> /// <param name="session"> /// The session to be plotted. /// </param> public SessionExportInstruction(ISessionInfo session) { this.Session = session; this.fieldNames = new Lazy <List <string> >( () => session.Timesteps .SelectMany(ts => ts.FieldInitializers .Select(fi => fi.Identification)) .Distinct().ToList()); this.timeSteps = new Lazy <List <TimestepNumber> >( () => session.Timesteps.Select(t => t.TimeStepNumber).ToList()); }
/// <summary> /// Compares this session to another. /// </summary> /// <param name="other">The session to compare to.</param> /// <returns> /// true, if the session GUIDs are the same; false otherwise. /// </returns> public bool Equals(ISessionInfo other) { if (other == null) { return(false); } else { return(this.ID.Equals(other.ID)); } }
public AuthService( UserManager <TAppUser> userManager, SignInManager <TAppUser> signInManager, RoleManager <TAppRole> roleManager, IUsersData usersData, ISessionInfo sessionInfo) { _userManager = userManager; _signInManager = signInManager; _roleManager = roleManager; _usersData = usersData; _sessionInfo = sessionInfo; }
public String DriverInfo(String method, IStandingsItem standing, ISessionInfo session, Int32 rounding) { switch (method) { case "officialpoints": if (session.Standings.Count != drivercount) this.UpdateSOF(); return Math.Round(this.points[standing.Position], MidpointRounding.ToEven).ToString(); default: return "[invalid]"; } }
public UsersApplicationService( ISessionInfo session, IUnitOfWorkManager uowManager, IUserPictureRepository userPictureRepository, UserManager <User> userManager, SignInManager <User> signInManager) : base(session, uowManager) { _userPictureRepository = userPictureRepository ?? throw new ArgumentNullException(nameof(userPictureRepository)); _userManager = userManager ?? throw new ArgumentException(nameof(userManager)); _signInManager = signInManager ?? throw new ArgumentException(nameof(signInManager)); }
public String SessionInfo(String method, ISessionInfo session, Int32 rounding) { switch (method) { case "sof": if (session.Standings.Count != drivercount) this.UpdateSOF(); return Math.Round(Math.Floor(this.sof), rounding).ToString(); default: return "[invalid]"; } }
public InvokeRequire(InvokeSource source, InvokeProtocol contentType, IntPtr waitHandle, string service, InvokeArgs args, int sourceMsgId, ISessionInfo session = null) { Source = source; ContentType = contentType; WaitHandle = waitHandle; SourceMsgId = sourceMsgId; Service = service; Args = args; WaitHandle = waitHandle; Session = session; }
public EfCoreUnitOfWork( IIocResolver iocResolver, IEfCoreTransactionStrategy transactionStrategy, IDbContextResolver dbContextResolver, IConnectionStringResolver connectionStringResolver, ISessionInfo sessionInfo) : base(connectionStringResolver, sessionInfo) { IocResolver = iocResolver; TransactionStrategy = transactionStrategy; DbContextResolver = dbContextResolver; ActiveDbContexts = new Dictionary <string, EfCoreDbContextBase>(); }
public DefaultEfCoreUnitOfWork( IIocResolver iocResolver, IEfCoreTransactionStrategy transactionStrategy, IDbContextResolver dbContextResolver, IConnectionStringResolver connectionStringResolver, ISessionInfo sessionInfo) : base( iocResolver, transactionStrategy, dbContextResolver, connectionStringResolver, sessionInfo) { }
public String SessionInfo(String method, ISessionInfo session, Int32 rounding) { switch (method) { case "test": return "test succesful"; break; case "state": return session.State.ToString(); break; default: return "[invalid]"; break; } }
public void Set(ISessionInfo sessionInfo) { if (sessionInfo == null) return; NhibernateService.Instance.CreateOrUpdateSingle(new SessionInfo { UserId = sessionInfo.UserId, AccessToken = sessionInfo.AccessToken, }, oldSessionInfo => { oldSessionInfo.UserId = sessionInfo.UserId; oldSessionInfo.AccessToken = sessionInfo.AccessToken; }); }
public EsterBootstrapper(IUnityContainer container, IEventAggregator eventAggregator, ISessionInfo sessionInfo) { _container = container; _sessionInfo = sessionInfo; _eventAggregator = eventAggregator; //_repositories.Add(container.Resolve<PeopleRepository>()); //_repositories.Add(container.Resolve<PlansRepository>()); _repositories.Add(container.Resolve<SchedulesRepository>()); _repositories.Add(container.Resolve<PlanObjectsRepository>()); //_viewModels.Add(container.Resolve<IEsterViewModel>("building")); //_viewModels.Add(container.Resolve<IEsterViewModel>("schedules")); ////_viewModels.Add(container.Resolve<IEsterViewModel>("people")); //_viewModels.Add(container.Resolve<IEsterViewModel>("logs")); }
public String DriverInfo(String method, IStandingsItem standing, ISessionInfo session, Int32 rounding) { switch (method) { case "test": return "test succesful"; break; case "drivername": return standing.Driver.Name; break; case "fuel": return ((Single)this.sdk.GetData("FuelLevel")).ToString(); break; default: return "[invalid]"; break; } }
public UpdaterViewModel(IEventAggregator eventAggregator, IDataTransport dataTransport, IServerInfo serverInfo, ISessionInfo sessionInfo) { _eventAggregator = eventAggregator; _serverInfo = serverInfo; _sessionInfo = sessionInfo; // _isVisible = Visibility.Visible; _isVisible = Visibility.Collapsed; LastTime = AutoRestartTime; _dataTransport = dataTransport; RestartAppCommand = new DelegateCommand<object>(RestartApp); WaitForUpdateCommand = new DelegateCommand<object>(UpdateAbortedByUser); _checkTimer = new DispatcherTimer { Interval = new TimeSpan(0, 0, _serverInfo.UpdateInterval, 0) }; _checkTimer.Tick += StartCheckUpdatesThread; _restartTimer = new DispatcherTimer { Interval = new TimeSpan(0, 0, 0, 1) }; _restartTimer.Tick += RestartTimerTick; }
protected GlobalData() { _sessionInfo = GetSessionInfo(); }
public SessionToken(ISessionInfo mySessionInfo) { SessionInfo = mySessionInfo; SessionSettings = new SessionSettings(); }
public void SaveToDB(ISessionInfo sessionInfo) { new SetSessionInfo().Set(sessionInfo); }
public String DriverInfo(String method, IStandingsItem standing, ISessionInfo session, Int32 rounding) { return ""; }
public String SessionInfo(String method, ISessionInfo session, Int32 rounding) { return ""; }
public SessionInfoEventArgs(ISessionInfo sessionInfo) { SessionInfo = sessionInfo; }
/// <summary> /// Записывает в базу данных новые данные сессии /// И обновляет текущие данные /// </summary> /// <param name="newSessionInfo"></param> public void UpdateSessionInfo(ISessionInfo newSessionInfo) { var setSessionInfo = new SetSessionInfo(); setSessionInfo.Set(newSessionInfo); _sessionInfo = newSessionInfo; }
public SessionToken(ISessionInfo mySessionInfo) { SessionInfo = mySessionInfo; SessionSettings = new SessionSettings(); // Transaction = null; }