|
1 | 1 | /* tslint:disable */ |
2 | 2 | import ClientMessage = require('../ClientMessage'); |
3 | 3 | import {BitsUtil} from '../BitsUtil'; |
4 | | -import {Data} from '../serialization/Data'; |
5 | | -import {MapMessageType} from './MapMessageType'; |
6 | 4 | import Address = require('../Address'); |
| 5 | +import {AddressCodec} from './AddressCodec'; |
| 6 | +import {UUIDCodec} from './UUIDCodec'; |
| 7 | +import {MemberCodec} from './MemberCodec'; |
| 8 | +import {Data} from '../serialization/Data'; |
| 9 | +import {EntryViewCodec} from './EntryViewCodec'; |
7 | 10 | import DistributedObjectInfoCodec = require('./DistributedObjectInfoCodec'); |
| 11 | +import {MapMessageType} from './MapMessageType'; |
8 | 12 |
|
9 | 13 | var REQUEST_TYPE = MapMessageType.MAP_ADDNEARCACHEENTRYLISTENER; |
10 | 14 | var RESPONSE_TYPE = 104; |
11 | 15 | var RETRYABLE = false; |
12 | 16 |
|
13 | | - |
14 | 17 | export class MapAddNearCacheEntryListenerCodec { |
15 | 18 |
|
16 | | - |
17 | 19 | static calculateSize(name: string, listenerFlags: number, localOnly: boolean) { |
18 | 20 | // Calculates the request payload size |
19 | 21 | var dataSize: number = 0; |
@@ -47,23 +49,77 @@ export class MapAddNearCacheEntryListenerCodec { |
47 | 49 |
|
48 | 50 | var messageType = clientMessage.getMessageType(); |
49 | 51 | if (messageType === BitsUtil.EVENT_IMAPINVALIDATION && handleEventImapinvalidation !== null) { |
50 | | - var key: Data; |
| 52 | + var messageFinished = false; |
| 53 | + var key: Data = undefined; |
| 54 | + if (!messageFinished) { |
51 | 55 |
|
52 | | - if (clientMessage.readBoolean() !== true) { |
53 | | - key = clientMessage.readData(); |
| 56 | + if (clientMessage.readBoolean() !== true) { |
| 57 | + key = clientMessage.readData(); |
| 58 | + } |
| 59 | + } |
| 60 | + var sourceUuid: string = undefined; |
| 61 | + if (!messageFinished) { |
| 62 | + messageFinished = clientMessage.isComplete(); |
54 | 63 | } |
55 | | - handleEventImapinvalidation(key); |
| 64 | + if (!messageFinished) { |
| 65 | + sourceUuid = clientMessage.readString(); |
| 66 | + } |
| 67 | + var partitionUuid: any = undefined; |
| 68 | + if (!messageFinished) { |
| 69 | + partitionUuid = UUIDCodec.decode(clientMessage, toObjectFunction); |
| 70 | + } |
| 71 | + var sequence: any = undefined; |
| 72 | + if (!messageFinished) { |
| 73 | + sequence = clientMessage.readLong(); |
| 74 | + } |
| 75 | + handleEventImapinvalidation(key, sourceUuid, partitionUuid, sequence); |
56 | 76 | } |
57 | 77 | if (messageType === BitsUtil.EVENT_IMAPBATCHINVALIDATION && handleEventImapbatchinvalidation !== null) { |
58 | | - var keys: any; |
59 | | - var keysSize = clientMessage.readInt32(); |
60 | | - keys = []; |
61 | | - for (var keysIndex = 0; keysIndex < keysSize; keysIndex++) { |
62 | | - var keysItem: Data; |
63 | | - keysItem = clientMessage.readData(); |
64 | | - keys.push(keysItem) |
| 78 | + var messageFinished = false; |
| 79 | + var keys: any = undefined; |
| 80 | + if (!messageFinished) { |
| 81 | + var keysSize = clientMessage.readInt32(); |
| 82 | + keys = []; |
| 83 | + for (var keysIndex = 0; keysIndex < keysSize; keysIndex++) { |
| 84 | + var keysItem: Data; |
| 85 | + keysItem = clientMessage.readData(); |
| 86 | + keys.push(keysItem) |
| 87 | + } |
| 88 | + } |
| 89 | + var sourceUuids: any = undefined; |
| 90 | + if (!messageFinished) { |
| 91 | + messageFinished = clientMessage.isComplete(); |
| 92 | + } |
| 93 | + if (!messageFinished) { |
| 94 | + var sourceUuidsSize = clientMessage.readInt32(); |
| 95 | + sourceUuids = []; |
| 96 | + for (var sourceUuidsIndex = 0; sourceUuidsIndex < sourceUuidsSize; sourceUuidsIndex++) { |
| 97 | + var sourceUuidsItem: string; |
| 98 | + sourceUuidsItem = clientMessage.readString(); |
| 99 | + sourceUuids.push(sourceUuidsItem) |
| 100 | + } |
| 101 | + } |
| 102 | + var partitionUuids: any = undefined; |
| 103 | + if (!messageFinished) { |
| 104 | + var partitionUuidsSize = clientMessage.readInt32(); |
| 105 | + partitionUuids = []; |
| 106 | + for (var partitionUuidsIndex = 0; partitionUuidsIndex < partitionUuidsSize; partitionUuidsIndex++) { |
| 107 | + var partitionUuidsItem: any; |
| 108 | + partitionUuidsItem = UUIDCodec.decode(clientMessage, toObjectFunction); |
| 109 | + partitionUuids.push(partitionUuidsItem) |
| 110 | + } |
| 111 | + } |
| 112 | + var sequences: any = undefined; |
| 113 | + if (!messageFinished) { |
| 114 | + var sequencesSize = clientMessage.readInt32(); |
| 115 | + sequences = []; |
| 116 | + for (var sequencesIndex = 0; sequencesIndex < sequencesSize; sequencesIndex++) { |
| 117 | + var sequencesItem: any; |
| 118 | + sequencesItem = clientMessage.readLong(); |
| 119 | + sequences.push(sequencesItem) |
| 120 | + } |
65 | 121 | } |
66 | | - handleEventImapbatchinvalidation(keys); |
| 122 | + handleEventImapbatchinvalidation(keys, sourceUuids, partitionUuids, sequences); |
67 | 123 | } |
68 | 124 | } |
69 | 125 |
|
|
0 commit comments