public static async Task <Takenet.Iris.Messaging.Resources.Tunnel> TryGetTunnelAsync <T>( this ITunnelExtension tunnelExtension, T envelope, CancellationToken cancellationToken) where T : Envelope { if (envelope == null) { throw new ArgumentNullException(nameof(envelope)); } if (envelope.From?.Domain == null || !envelope.From.Domain.Equals(TunnelExtension.TunnelAddress.Domain, StringComparison.OrdinalIgnoreCase)) { return(null); } if (envelope.TryGetTunnelFromEnvelope(out var tunnel)) { return(tunnel); } try { return(await tunnelExtension.GetTunnelAsync(envelope.From.ToIdentity(), cancellationToken)); } catch (LimeException ex) when(ex.Reason.Code == ReasonCodes.COMMAND_RESOURCE_NOT_FOUND) { return(null); } }
public UserOwnerResolver(ITunnelExtension tunnelExtension, Application application) { _tunnelExtension = tunnelExtension; _applicationIdentity = application.Identity; }
public TunnelVariableProvider(ITunnelExtension tunnelExtension) { _tunnelExtension = tunnelExtension; }