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); } } }
@Override public CqNameToOp getClientCq(ClientProxyMembershipID clientId) { if (this._clientCqs != null) { return this._clientCqs.get(clientId); } else { return null; } }