| 26 | import org.apache.commons.lang3.exception.ExceptionUtils; |
| 27 | |
| 28 | abstract public class AbsCache extends HttpServlet implements AbsComm |
| 29 | { |
| 30 | /** |
| 31 | * Path component under war/ to locate iconfinder_key file. |
| 32 | */ |
| 33 | protected static final String PUSHER_CONFIG_FILE_PATH = "pusher_properties"; |
| 34 | |
| 35 | /** |
| 36 | * Path component under war/ to locate iconfinder_key file. |
| 37 | */ |
| 38 | protected static final boolean debugOutput = false; |
| 39 | |
| 40 | /** |
| 41 | * Path component under war/ to locate iconfinder_key file. |
| 42 | */ |
| 43 | protected static final int expirationDelta = 300; |
| 44 | |
| 45 | /** |
| 46 | * Path component under war/ to locate iconfinder_key file. |
| 47 | */ |
| 48 | protected static final int maxCacheSize = 1000000; |
| 49 | |
| 50 | /** |
| 51 | * Path component under war/ to locate iconfinder_key file. |
| 52 | */ |
| 53 | protected static Pusher pusher = null; |
| 54 | |
| 55 | /** |
| 56 | * Global cache is used for patches, last versions and tokens. They are |
| 57 | * separated via their key formats as follows: |
| 58 | * |
| 59 | * Patches use ID:VERSION and map to a CacheEntry which contains the next |
| 60 | * version, patch data and secret. |
| 61 | * |
| 62 | * Last versions use ID@VERSION and map to a String which contains the |
| 63 | * known last version of the file. This is used to verify the secret. |
| 64 | * |
| 65 | * Tokens use ID#SECRET and map to a String which contains the token. |
| 66 | * The token is used to authorize the patch in a subsequent request. |
| 67 | */ |
| 68 | protected static Cache cache = null; |
| 69 | |
| 70 | static |
| 71 | { |
| 72 | try |
| 73 | { |
| 74 | cache = CacheFacade.createCache("AbsCache", expirationDelta); |
| 75 | } |
| 76 | catch (Exception e) |
| 77 | { |
| 78 | e.printStackTrace(); |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * Creates the key for the cache entry. |
| 84 | */ |
| 85 | protected static String createCacheEntryKey(String id, String version) |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…