/** * Sets keepalive on the proxy of the given membershipID * * @param membershipID Uniquely identifies the client pool * @since GemFire 5.7 */ public void setKeepAlive(ClientProxyMembershipID membershipID, boolean keepAlive) { if (logger.isDebugEnabled()) { logger.debug("CacheClientNotifier: setKeepAlive client: {}", membershipID); } CacheClientProxy proxy = getClientProxy(membershipID); if (proxy != null) { // Close the port if the proxy represents the client and contains the // port) // // If so, remove the port from the client's remote ports // proxy.removePort(clientPort); // Set the keepalive flag proxy.setKeepAlive(keepAlive); } }
/** * Unregisters client interest in the input region and key. * * @param regionName The name of the region of interest * @param keyOfInterest The name of the key of interest * @param isClosing Whether the caller is closing * @param membershipID The <code>ClientProxyMembershipID</code> of the client no longer interested * in this <code>Region</code> and key */ public void unregisterClientInterest(String regionName, Object keyOfInterest, int interestType, boolean isClosing, ClientProxyMembershipID membershipID, boolean keepalive) { if (logger.isDebugEnabled()) { logger.debug( "CacheClientNotifier: Client {} unregistering interest in: {} -> {} (an instance of {})", membershipID, regionName, keyOfInterest, keyOfInterest.getClass().getName()); } CacheClientProxy proxy = getClientProxy(membershipID); if (proxy != null) { proxy.setKeepAlive(keepalive); proxy.unregisterClientInterest(regionName, keyOfInterest, interestType, isClosing); } }
/** * Unregisters client interest in the input region and list of keys. * * @param regionName The name of the region of interest * @param keysOfInterest The list of keys of interest * @param isClosing Whether the caller is closing * @param membershipID The <code>ClientProxyMembershipID</code> of the client no longer interested * in this <code>Region</code> and key */ public void unregisterClientInterest(String regionName, List keysOfInterest, boolean isClosing, ClientProxyMembershipID membershipID, boolean keepalive) { if (logger.isDebugEnabled()) { logger.debug("CacheClientNotifier: Client {} unregistering interest in: {} -> {}", membershipID, regionName, keysOfInterest); } CacheClientProxy proxy = getClientProxy(membershipID); if (proxy != null) { proxy.setKeepAlive(keepalive); proxy.unregisterClientInterest(regionName, keysOfInterest, isClosing); } }
/** * Shuts down durable client proxy */ public boolean closeDurableClientProxy(String durableClientId) throws CacheException { CacheClientProxy ccp = getClientProxy(durableClientId); if (ccp == null) { return false; } // we can probably remove the isPaused check if (ccp.isPaused() && !ccp.isConnected()) { ccp.setKeepAlive(false); closeDeadProxies(Collections.singletonList(ccp), true); return true; } else { if (logger.isDebugEnabled()) { logger.debug("Cannot close running durable client: {}", durableClientId); } // TODO: never throw an anonymous inner class throw new CacheException("Cannot close a running durable client : " + durableClientId) {}; } }