cqMap = null; } else { cqMap = new ClientCqConcurrentMap(size, 1.0f, 1); for (int i = 0; i < size; i++) { ClientProxyMembershipID key = DataSerializer.<ClientProxyMembershipID>readObject(in); cqMap.put(key, value);
private void addClientCQsAndInterestList(ClientUpdateMessageImpl msg, HAEventWrapper haEventWrapper, Map haContainer, String regionName) { ClientProxyMembershipID proxyID = ((HAContainerWrapper) haContainer).getProxyID(regionName); if (haEventWrapper.getClientCqs() != null) { CqNameToOp clientCQ = haEventWrapper.getClientCqs().get(proxyID); if (clientCQ != null) { msg.addClientCqs(proxyID, clientCQ); } } // This is a remote HAEventWrapper. // Add new Interested client lists. ClientUpdateMessageImpl clientMsg = (ClientUpdateMessageImpl) haEventWrapper.getClientUpdateMessage(); if (clientMsg != null) { if (clientMsg.isClientInterestedInUpdates(proxyID)) { msg.addClientInterestList(proxyID, true); } else if (clientMsg.isClientInterestedInInvalidates(proxyID)) { msg.addClientInterestList(proxyID, false); } } }
public void addClientCq(ClientProxyMembershipID clientId, String cqName, Integer cqEvent) { if (this._clientCqs == null) { this._clientCqs = new ClientCqConcurrentMap(); this._hasCqs = true; } CqNameToOp cqInfo = this._clientCqs.get(clientId); if (cqInfo == null) { cqInfo = new CqNameToOpSingleEntry(cqName, cqEvent); this._clientCqs.put(clientId, cqInfo); } else if (!cqInfo.isFull()) { cqInfo.add(cqName, cqEvent); } else { cqInfo = new CqNameToOpHashMap((CqNameToOpSingleEntry) cqInfo); cqInfo.add(cqName, cqEvent); this._clientCqs.put(clientId, cqInfo); } }
/** * Returns the cqs for the given client. * */ public String[] getCqs(ClientProxyMembershipID clientId) { String[] cqNames = null; if (this._clientCqs != null) { CqNameToOp cqs = this._clientCqs.get(clientId); if (cqs != null && !cqs.isEmpty()) { cqNames = cqs.getNames(); } } return cqNames; }
/** * @return boolean true if cq info is present for the given proxy. */ @Override public boolean hasCqs(ClientProxyMembershipID clientId) { if (this._clientCqs != null) { CqNameToOp cqs = this._clientCqs.get(clientId); if (cqs != null && !cqs.isEmpty()) { return true; } } return false; }
private void addCqsToMessage(ClientProxyMembershipID proxyId, Message message) { if (this._clientCqs != null) { CqNameToOp cqs = this._clientCqs.get(proxyId); if (cqs != null) { message.addIntPart(cqs.size() * 2); cqs.addToMessage(message); } } }
/** * Add cqs for the given client. * */ public void addClientCqs(ClientProxyMembershipID clientId, CqNameToOp filteredCqs) { if (this._clientCqs == null) { this._clientCqs = new ClientCqConcurrentMap(); this._hasCqs = true; } this._clientCqs.put(clientId, filteredCqs); }
public void removeClientCq(ClientProxyMembershipID clientId, InternalCqQuery cqToClose) { CqNameToOp cqs = getClientCq(clientId); if (cqs != null) { cqs.delete(cqToClose.getName()); // remove clientId key if no more cqs exist for this clientId if (cqs.isEmpty()) { this._clientCqs.remove(clientId); } } }
@Override public CqNameToOp getClientCq(ClientProxyMembershipID clientId) { if (this._clientCqs != null) { return this._clientCqs.get(clientId); } else { return null; } }