/// <summary> /// Recorded when a subscription client is no longer connected or otherwise dropped /// by ASP.NET. The server will process no more messages from the client. /// </summary> /// <typeparam name="TSchema">The type of the schema the server was created for.</typeparam> /// <param name="logger">The logger doing the logging.</param> /// <param name="server">The server that was created.</param> public static void SubscriptionServerCreated <TSchema>( this IGraphEventLogger logger, ISubscriptionServer <TSchema> server) where TSchema : class, ISchema { logger.Log( LogLevel.Debug, () => new SubscriptionServerCreatedLogEntry <TSchema>(server)); }
/// <summary> /// Initializes a new instance of the <see cref="SubscriptionServerCreatedLogEntry{TSchema}" /> class. /// </summary> /// <param name="server">The server which was created.</param> public SubscriptionServerCreatedLogEntry(ISubscriptionServer <TSchema> server) : base(SubscriptionLogEventIds.SubscriptionServerCreated) { _serverTypeShortName = server.GetType().FriendlyName(); _schemaTypeShortName = typeof(TSchema).FriendlyName(); this.SchemaTypeName = typeof(TSchema).FriendlyName(true); this.ServerTypeName = server.GetType().FriendlyName(true); this.ServerId = server.Id; }
/// <summary> /// Recorded when a new client is registered against a subscription server and /// the graphql server begins monitoring it for messages. /// </summary> /// <typeparam name="TSchema">The type of the schema the client was registered for.</typeparam> /// <param name="logger">The logger doing the logging.</param> /// <param name="server">The server which created the client.</param> /// <param name="client">The client that was created.</param> public static void SubscriptionClientRegistered <TSchema>( this IGraphEventLogger logger, ISubscriptionServer <TSchema> server, ISubscriptionClientProxy client) where TSchema : class, ISchema { logger.Log( LogLevel.Debug, () => new SubscriptionClientRegisteredLogEntry <TSchema>(server, client)); }
/// <summary> /// Initializes a new instance of the <see cref="DefaultGraphQLHttpSubscriptionMiddleware{TSchema}" /> class. /// </summary> /// <param name="next">The delegate pointing to the next middleware component /// in the pipeline.</param> /// <param name="subscriptionServer">The subscription server configured for /// this web host.</param> /// <param name="options">The options.</param> public DefaultGraphQLHttpSubscriptionMiddleware( RequestDelegate next, ISubscriptionServer <TSchema> subscriptionServer, SubscriptionServerOptions <TSchema> options) { _next = next; _options = Validation.ThrowIfNullOrReturn(options, nameof(options)); _subscriptionServer = Validation.ThrowIfNullOrReturn(subscriptionServer, nameof(subscriptionServer)); _routePath = Validation.ThrowIfNullOrReturn(_options.Route, nameof(_options.Route)); }
/// <summary> /// Initializes a new instance of the <see cref="SubscriptionClientRegisteredLogEntry{TSchema}" /> class. /// </summary> /// <param name="server">The server which created teh client.</param> /// <param name="client">The client that was created.</param> public SubscriptionClientRegisteredLogEntry( ISubscriptionServer <TSchema> server, ISubscriptionClientProxy client) : base(SubscriptionLogEventIds.SubscriptionClientRegistered) { _clientTypeShortName = client.GetType().FriendlyName(); _schemaTypeShortName = typeof(TSchema).FriendlyName(); this.SchemaTypeName = typeof(TSchema).FriendlyName(true); this.ClientTypeName = client.GetType().FriendlyName(true); this.ServerTypeName = server.GetType().FriendlyName(true); this.ClientId = client.Id; this.ServerId = server.Id; }