-
Notifications
You must be signed in to change notification settings - Fork 3
/
CONTAINSKEY.cs
38 lines (33 loc) · 1.12 KB
/
CONTAINSKEY.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using BeetleX.Buffers;
using System;
using System.Collections.Generic;
using System.Text;
namespace Infinispan.Hotrod.Core.Commands
{
public class CONTAINSKEY<K> : CommandWithKey<K>
{
public CONTAINSKEY(Marshaller<K> km, K key)
{
Key = key;
KeyMarshaller = km;
NetworkReceive = OnReceive;
}
public override string Name => "CONTAINSKEY";
public override Byte Code => 0x0F;
public Boolean IsContained;
internal override void OnExecute(CommandContext ctx)
{
base.OnExecute(ctx);
}
internal override void Execute(CommandContext ctx, InfinispanClient client, PipeStream stream)
{
base.Execute(ctx, client, stream);
Codec.writeArray(KeyMarshaller.marshall(Key), stream);
}
public override Result OnReceive(InfinispanRequest request, ResponseStream stream)
{
IsContained = request.ResponseStatus==Codec30.NO_ERROR_STATUS;
return new Result{ Status = ResultStatus.Completed, ResultType = ResultType.Object };
}
}
}