/** @return string */ @Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append( "\nRemoteHttpCacheResponse" ); buf.append( "\n success [" + isSuccess() + "]" ); buf.append( "\n payload [" + getPayload() + "]" ); buf.append( "\n errorMessage [" + getErrorMessage() + "]" ); return buf.toString(); } }
/** @return string */ @Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append( "\nRemoteHttpCacheResponse" ); buf.append( "\n success [" + isSuccess() + "]" ); buf.append( "\n payload [" + getPayload() + "]" ); buf.append( "\n errorMessage [" + getErrorMessage() + "]" ); return buf.toString(); } }
/** * Return the keys in this cache. * <p> * @param cacheName the name of the cache * @see org.apache.commons.jcs.auxiliary.AuxiliaryCache#getKeySet() */ @Override public Set<K> getKeySet( String cacheName ) throws IOException { if ( !isInitialized() ) { String message = "The Remote Http Client is not initialized. Cannot process request."; log.warn( message ); throw new IOException( message ); } RemoteCacheRequest<String, String> remoteHttpCacheRequest = RemoteCacheRequestFactory.createGetKeySetRequest(cacheName, 0 ); RemoteCacheResponse<Set<K>> remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest ); if ( remoteHttpCacheResponse != null && remoteHttpCacheResponse.getPayload() != null ) { return remoteHttpCacheResponse.getPayload(); } return Collections.emptySet(); }
/** * Return the keys in this cache. * <p> * @param cacheName the name of the cache * @see org.apache.commons.jcs.auxiliary.AuxiliaryCache#getKeySet() */ @Override public Set<K> getKeySet( String cacheName ) throws IOException { if ( !isInitialized() ) { String message = "The Remote Http Client is not initialized. Cannot process request."; log.warn( message ); throw new IOException( message ); } RemoteCacheRequest<String, String> remoteHttpCacheRequest = RemoteCacheRequestFactory.createGetKeySetRequest(cacheName, 0 ); RemoteCacheResponse<Set<K>> remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest ); if ( remoteHttpCacheResponse != null && remoteHttpCacheResponse.getPayload() != null ) { return remoteHttpCacheResponse.getPayload(); } return Collections.emptySet(); }
return remoteHttpCacheResponse.getPayload();
/** * Gets multiple items from the cache matching the pattern. * <p> * @param cacheName * @param pattern * @param requesterId * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no * data in cache matching the pattern. * @throws IOException */ @Override public Map<K, ICacheElement<K, V>> getMatching( String cacheName, String pattern, long requesterId ) throws IOException { if ( !isInitialized() ) { String message = "The Remote Http Client is not initialized. Cannot process request."; log.warn( message ); throw new IOException( message ); } RemoteCacheRequest<K, V> remoteHttpCacheRequest = RemoteCacheRequestFactory.createGetMatchingRequest( cacheName, pattern, requesterId ); RemoteCacheResponse<Map<K, ICacheElement<K, V>>> remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest ); if ( log.isDebugEnabled() ) { log.debug( "GetMatching [" + pattern + "] = " + remoteHttpCacheResponse ); } return remoteHttpCacheResponse.getPayload(); }
/** * Gets multiple items from the cache based on the given set of keys. * <p> * @param cacheName * @param keys * @param requesterId * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no * data in cache for any of these keys * @throws IOException */ @Override public Map<K, ICacheElement<K, V>> getMultiple( String cacheName, Set<K> keys, long requesterId ) throws IOException { if ( !isInitialized() ) { String message = "The Remote Http Client is not initialized. Cannot process request."; log.warn( message ); throw new IOException( message ); } RemoteCacheRequest<K, V> remoteHttpCacheRequest = RemoteCacheRequestFactory.createGetMultipleRequest( cacheName, keys, requesterId ); RemoteCacheResponse<Map<K, ICacheElement<K, V>>> remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest ); if ( log.isDebugEnabled() ) { log.debug( "GetMultiple [" + keys + "] = " + remoteHttpCacheResponse ); } return remoteHttpCacheResponse.getPayload(); }
/** * Gets multiple items from the cache matching the pattern. * <p> * @param cacheName * @param pattern * @param requesterId * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no * data in cache matching the pattern. * @throws IOException */ @Override public Map<K, ICacheElement<K, V>> getMatching( String cacheName, String pattern, long requesterId ) throws IOException { if ( !isInitialized() ) { String message = "The Remote Http Client is not initialized. Cannot process request."; log.warn( message ); throw new IOException( message ); } RemoteCacheRequest<K, V> remoteHttpCacheRequest = RemoteCacheRequestFactory.createGetMatchingRequest( cacheName, pattern, requesterId ); RemoteCacheResponse<Map<K, ICacheElement<K, V>>> remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest ); if ( log.isDebugEnabled() ) { log.debug( "GetMatching [" + pattern + "] = " + remoteHttpCacheResponse ); } return remoteHttpCacheResponse.getPayload(); }
/** * Gets multiple items from the cache based on the given set of keys. * <p> * @param cacheName * @param keys * @param requesterId * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no * data in cache for any of these keys * @throws IOException */ @Override public Map<K, ICacheElement<K, V>> getMultiple( String cacheName, Set<K> keys, long requesterId ) throws IOException { if ( !isInitialized() ) { String message = "The Remote Http Client is not initialized. Cannot process request."; log.warn( message ); throw new IOException( message ); } RemoteCacheRequest<K, V> remoteHttpCacheRequest = RemoteCacheRequestFactory.createGetMultipleRequest( cacheName, keys, requesterId ); RemoteCacheResponse<Map<K, ICacheElement<K, V>>> remoteHttpCacheResponse = getRemoteDispatcher().dispatchRequest( remoteHttpCacheRequest ); if ( log.isDebugEnabled() ) { log.debug( "GetMultiple [" + keys + "] = " + remoteHttpCacheResponse ); } return remoteHttpCacheResponse.getPayload(); }
return remoteHttpCacheResponse.getPayload();