/** * Determines, if the given requestURI is a readOnly request and not blacklisted as a modifying request. * @param requestId the request uri to check * @return <code>true</code> if the given request uri can be regarded as read only. */ public boolean isReadOnlyRequest( final String requestId ) { if ( _log.isDebugEnabled() ) { _log.debug( "Asked for readonly request: " + requestId + " ("+ _readOnlyRequests.containsKey( requestId ) +")" ); } // TODO: add some threshold return _readOnlyRequests.containsKey( requestId ); }
@Test public void testRemove() { final LRUCache<String,String> cut = new LRUCache<String, String>( 3 ); cut.put("foo", "bar"); assertTrue( cut.containsKey( "foo" ) ); assertEquals( cut.remove( "foo" ), "bar" ); assertFalse( cut.containsKey( "foo" ) ); }
/** * Registers the given requestURI as a readonly request, as long as it has not been tracked * before as a modifying request (via {@link #modifyingRequest(String)}). * <p> * There's a limit on the number and the time readonly requests are beeing stored (simply a LRU cache), * so that the most frequently accessed readonly requests are stored. * </p> * @param requestId the request uri to track. * @return <code>true</code> if the requestURI was stored as readonly, <code>false</code> if it was on the blacklist. * @see #modifyingRequest(String) */ public boolean readOnlyRequest( final String requestId ) { if ( !_blacklist.containsKey( requestId ) ) { if ( _log.isDebugEnabled() ) { _log.debug( "Registering readonly request: " + requestId ); } incrementOrPut( _readOnlyRequests, requestId ); return true; } return false; }
/** * Determines, if the given requestURI is a readOnly request and not blacklisted as a modifying request. * @param requestId the request uri to check * @return <code>true</code> if the given request uri can be regarded as read only. */ public boolean isReadOnlyRequest( final String requestId ) { if ( _log.isDebugEnabled() ) { _log.debug( "Asked for readonly request: " + requestId + " ("+ _readOnlyRequests.containsKey( requestId ) +")" ); } // TODO: add some threshold return _readOnlyRequests.containsKey( requestId ); }
if ( !_sticky ) { if(!_invalidSessionsCache.containsKey(sessionId)) { _lockingStrategy.onBackupWithoutLoadedSession( sessionId, requestId, _backupSessionService );
if( _invalidSessionsCache.containsKey(session.getId()) ){ if ( _log.isDebugEnabled() ) { _log.debug( "Remove session id " + session.getId() + " from _invalidSessionsCache, marking new session valid" );
/** * Registers the given requestURI as a readonly request, as long as it has not been tracked * before as a modifying request (via {@link #modifyingRequest(String)}). * <p> * There's a limit on the number and the time readonly requests are beeing stored (simply a LRU cache), * so that the most frequently accessed readonly requests are stored. * </p> * @param requestId the request uri to track. * @return <code>true</code> if the requestURI was stored as readonly, <code>false</code> if it was on the blacklist. * @see #modifyingRequest(String) */ public boolean readOnlyRequest( final String requestId ) { if ( !_blacklist.containsKey( requestId ) ) { if ( _log.isDebugEnabled() ) { _log.debug( "Registering readonly request: " + requestId ); } incrementOrPut( _readOnlyRequests, requestId ); return true; } return false; }
if ( !_sticky ) { if(!_invalidSessionsCache.containsKey(sessionId)) { _lockingStrategy.onBackupWithoutLoadedSession( sessionId, requestId, _backupSessionService );
if( _invalidSessionsCache.containsKey(session.getId()) ){ if ( _log.isDebugEnabled() ) { _log.debug( "Remove session id " + session.getId() + " from _invalidSessionsCache, marking new session valid" );