Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.fasterxml.transistore.service.store;
  
  
 
 public class BasicTSStoreHandler extends StoreHandler<BasicTSKey,
 {
    
Flag mostly used by tests to force updates of last-accessed time stamps.
 
     protected boolean _defaultUpdateLastAccess = false;
     
     public BasicTSStoreHandler(SharedServiceStuff stuff,
             Stores<BasicTSKeyStoredEntry<BasicTSKey>> stores,
             ClusterViewByServer cluster,
             boolean defaultUpdateLastAccess)
     {
         super(stuffstorescluster);
          = defaultUpdateLastAccess;
     }
 
     @Override
             Stores<BasicTSKey,?> stores)
     {
         // 28-May-2013, tatu: For now, better keep DELETEs synchronous for tests.
         if (stuff.isRunningTests()) {
             return DeferredDeleter.nonDeferring(stores.getEntryStore());
         }
         return new DeferredDeleter(stores.getEntryStore(), stuff.getServiceConfig().);
     }
 
     /*
     /**********************************************************************
     /* Extracting last-accessed/updated info from key
     /**********************************************************************
      */
 
     @Override
             BasicTSKey key)
     {
         /* 31-Jan-2012, tatu: For now let's only enable last-access time tracking
          *   for tests, since there's no good way to pass that with request, and it simply adds
          *   overhead without benefits (for now)
          */
         if () {
             return .;
         }
         return .;
     }
 
     /*
     /**********************************************************************
     /* Updates to last-accessed/updated info
     /**********************************************************************
      */
         
     @Override
     protected void updateLastAccessedForGet(ServiceRequest requestServiceResponse response,
             StoredEntry<BasicTSKeyentrylong accessTime)
     {
         _updateLastAccessed(requestentryaccessTime);
     }
 
     @Override
     protected void updateLastAccessedForHead(ServiceRequest requestServiceResponse response,
             StoredEntry<BasicTSKeyentrylong accessTime)
     {
         _updateLastAccessed(requestentryaccessTime);
     }
 
     @Override
     protected void updateLastAccessedForDelete(ServiceRequest requestServiceResponse response,
             BasicTSKey keylong deletionTime)
     {
         TSLastAccess acc = _findLastAccessUpdateMethod(requestkey);
         // can only do straight delete with one-to-one mappings
         if (acc == .) {
             .getLastAccessStore().removeLastAccess(keyaccdeletionTime);
         }
     }
     
     /*
     /**********************************************************************
     /* Internal methods
     /**********************************************************************
      */
     
     private void _updateLastAccessed(ServiceRequest request
             StoredEntry<BasicTSKeyentrylong accessTime)
    {
        BasicTSKey key = entry.getKey();
        TSLastAccess acc = _findLastAccessUpdateMethod(requestkey);
        if (acc != null && !acc.meansNoUpdate()) {
            .getLastAccessStore().updateLastAccess(entryaccessTime);
        }
    }
New to GrepCode? Check out our FAQ X