Skip to content

Commit c085ed8

Browse files
committed
Generating an IWampSessionManagementServiceProxy implementation
1 parent 1f1560d commit c085ed8

File tree

4 files changed

+68
-3
lines changed

4 files changed

+68
-3
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
using System.Threading;
2+
using System.Threading.Tasks;
3+
using WampSharp.V2.CalleeProxy;
4+
using WampSharp.V2.Client;
5+
6+
namespace WampSharp.V2.Management.Client
7+
{
8+
//------------------------------------------------------------------------------
9+
// <auto-generated>
10+
// This code was generated by a tool.
11+
//
12+
// Changes to this file may cause incorrect behavior and will be lost if
13+
// the code is regenerated.
14+
// </auto-generated>
15+
//------------------------------------------------------------------------------
16+
internal class WampSessionManagementServiceProxy : CalleeProxyBase, IWampSessionManagementServiceProxy
17+
{
18+
private static readonly InvokeAsyncDelegate<object> mMethodHandler0 = GetInvokeAsync<object>(
19+
GetMethodInfo((IWampSessionManagementServiceProxy instance) => instance.KillBySessionIdAsync(default(long), default(string), default(string)))
20+
);
21+
private static readonly InvokeAsyncDelegate<int> mMethodHandler1 = GetInvokeAsync<int>(
22+
GetMethodInfo((IWampSessionManagementServiceProxy instance) => instance.KillByAuthIdAsync(default(string), default(string), default(string)))
23+
);
24+
private static readonly InvokeAsyncDelegate<int> mMethodHandler2 = GetInvokeAsync<int>(
25+
GetMethodInfo((IWampSessionManagementServiceProxy instance) => instance.KillByAuthRoleAsync(default(string), default(string), default(string)))
26+
);
27+
private static readonly InvokeAsyncDelegate<int> mMethodHandler3 = GetInvokeAsync<int>(
28+
GetMethodInfo((IWampSessionManagementServiceProxy instance) => instance.KillAllAsync(default(string), default(string)))
29+
);
30+
31+
public WampSessionManagementServiceProxy
32+
(IWampRealmProxy realmProxy,
33+
ICalleeProxyInterceptor interceptor)
34+
: base(realmProxy, interceptor)
35+
{
36+
}
37+
38+
public Task KillBySessionIdAsync(long session, string reason, string message)
39+
{
40+
return mMethodHandler0(this, CancellationToken.None, session, reason, message);
41+
}
42+
43+
public Task<int> KillByAuthIdAsync(string authId, string reason, string message)
44+
{
45+
return mMethodHandler1(this, CancellationToken.None, authId, reason, message);
46+
}
47+
48+
public Task<int> KillByAuthRoleAsync(string authRole, string reason, string message)
49+
{
50+
return mMethodHandler2(this, CancellationToken.None, authRole, reason, message);
51+
}
52+
53+
public Task<int> KillAllAsync(string reason, string message)
54+
{
55+
return mMethodHandler3(this, CancellationToken.None, reason, message);
56+
}
57+
}
58+
}

src/netstandard/WampSharp/WAMP2/V2/Management/WampSessionManagmentService.cs renamed to src/netstandard/WampSharp/WAMP2/V2/Management/WampSessionManagementService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace WampSharp.V2.Management
1111
{
12-
internal class WampSessionManagmentService : IWampSessionManagementService, IDisposable
12+
internal class WampSessionManagementService : IWampSessionManagementService, IDisposable
1313
{
1414
private readonly IWampHostedRealm mRealm;
1515
private readonly IWampUriValidator mUriValidator;
@@ -25,7 +25,7 @@ internal class WampSessionManagmentService : IWampSessionManagementService, IDis
2525
private ImmutableDictionary<string, ImmutableList<IWampSessionTerminator>> mAuthRoleToTerminator =
2626
ImmutableDictionary<string, ImmutableList<IWampSessionTerminator>>.Empty;
2727

28-
public WampSessionManagmentService(IWampHostedRealm realm, IWampUriValidator uriValidator = null)
28+
public WampSessionManagementService(IWampHostedRealm realm, IWampUriValidator uriValidator = null)
2929
{
3030
mRealm = realm;
3131
mUriValidator = uriValidator ?? new LooseUriValidator();

src/netstandard/WampSharp/WAMP2/V2/MetaApi/Client/WampRealmProxyExtensions.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using WampSharp.V2.Client;
2+
using WampSharp.V2.Management;
3+
using WampSharp.V2.Management.Client;
24
using WampSharp.V2.Testament.Client;
35

46
namespace WampSharp.V2.MetaApi
@@ -14,5 +16,10 @@ public static IWampTestamentServiceProxy GetTestamentServiceProxy(this IWampReal
1416
{
1517
return new WampTestamentServiceProxy(realmProxy, CalleeProxyInterceptor.Default);
1618
}
19+
20+
public static IWampSessionManagementServiceProxy GetManagementServiceProxy(this IWampRealmProxy realmProxy)
21+
{
22+
return new WampSessionManagementServiceProxy(realmProxy, CalleeProxyInterceptor.Default);
23+
}
1724
}
1825
}

src/netstandard/WampSharp/WAMP2/V2/MetaApi/WampHostedRealmExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private static CompositeDisposable HostDisposableService(IWampHostedRealm hosted
9595
/// <returns>A disposable: disposing it will unregister the hosted session management service.</returns>
9696
public static IDisposable HostSessionManagementService(this IWampHostedRealm hostedRealm, IWampUriValidator uriValidator = null)
9797
{
98-
WampSessionManagmentService service = new WampSessionManagmentService(hostedRealm, uriValidator);
98+
WampSessionManagementService service = new WampSessionManagementService(hostedRealm, uriValidator);
9999

100100
RegisterOptions registerOptions = new RegisterOptions { DiscloseCaller = true };
101101

0 commit comments

Comments
 (0)