private static String getClientIdFromCacheClientProxy(CacheClientProxy p) { if (p == null) { return null; } StringBuffer buffer = new StringBuffer(); buffer.append("[").append(p.getProxyID()).append(":port=").append(p.getRemotePort()) .append(":primary=").append(p.isPrimary()).append("]"); return buffer.toString(); }
/** * Checks if there is any proxy which is primary for the given durable client * * @param durableId - id for the durable-client * @return - true if a primary proxy is present for the given durable client * * @since GemFire 5.6 */ public boolean hasPrimaryForDurableClient(String durableId) { for (Iterator iter = this._clientProxies.values().iterator(); iter.hasNext();) { CacheClientProxy proxy = (CacheClientProxy) iter.next(); ClientProxyMembershipID proxyID = proxy.getProxyID(); if (durableId.equals(proxyID.getDurableId())) { if (proxy.isPrimary()) { return true; } else { return false; } } } return false; }
private void handleInterestEvent(String regionName, Set keysOfInterest, int interestType, boolean isRegister) { // Notify the region about this register interest event if: // - the application has requested it // - this is a primary CacheClientProxy (otherwise multiple notifications // may occur) // - it is a key interest type (regex is currently not supported) InterestRegistrationEvent event = null; if (NOTIFY_REGION_ON_INTEREST && this.ccp.isPrimary() && interestType == InterestType.KEY) { event = new InterestRegistrationEventImpl(this.ccp, regionName, keysOfInterest, interestType, isRegister); try { notifyRegionOfInterest(event); } catch (Exception e) { logger.warn("Region notification of interest failed", e); } } // Invoke interest registration listeners if (containsInterestRegistrationListeners()) { if (event == null) { event = new InterestRegistrationEventImpl(this.ccp, regionName, keysOfInterest, interestType, isRegister); } notifyInterestRegistrationListeners(event); } }
new ClientConnInfo(p.getProxyID(), p.getSocketHost(), p.getRemotePort(), p.isPrimary()); uniqueIds.put(p.getProxyID().getDSMembership(), clientConInfo);
} else { l_proxy.setSubject(subject); if (proxy.isPrimary()) { endpointType = (byte) 2; } else {
foundClientinCCP = true; String durableId = ccp.getProxyID().getDurableId(); boolean isPrimary = ccp.isPrimary(); clientInfo = new ClientInfo( (durableId != null && durableId.length() > 0 ? "Yes" : "No"),
proxy); if (proxy.isPrimary()) { endpointType = (byte) 2; queueSize = proxy.getQueueSize();
.getClientProxy(serverConnection.getProxyID()).isPrimary(); if (!isPrimary) { chunkedResponseMsg.setMessageType(MessageType.RESPONSE_FROM_SECONDARY);
getCache(), harq, HARegionQueue.BLOCKING_HA_QUEUE, createDurableQueue, proxy._cacheClientNotifier.getHaContainer(), proxy.getProxyID(), this._proxy.clientConflation, this._proxy.isPrimary(), canHandleDelta);
.getClientProxy(serverConnection.getProxyID()).isPrimary(); if (!isPrimary) { chunkedResponseMsg.setMessageType(MessageType.RESPONSE_FROM_SECONDARY);
.getClientProxy(serverConnection.getProxyID()).isPrimary(); if (!isPrimary) { chunkedResponseMsg.setMessageType(MessageType.RESPONSE_FROM_SECONDARY);
return; boolean isPrimary = ccp.isPrimary(); ChunkedMessage chunkedResponseMsg = serverConnection.getRegisterInterestResponseMessage(); if (!isPrimary) {
return; boolean isPrimary = ccp.isPrimary(); ChunkedMessage chunkedResponseMsg = serverConnection.getRegisterInterestResponseMessage(); if (!isPrimary) {