- Timestamp:
- 2015-05-23T08:55:03+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/cache/CacheEntryAttributes.java
r8418 r8420 14 14 15 15 /** 16 * Class that contains attirubtes for JCS cache entries. Parameters are used to properly handle HTTP caching 16 * Class that contains attirubtes for JCS cache entries. Parameters are used to properly handle HTTP caching, 17 * and metadata structures, that should be stored together with the cache entry 17 18 * 18 19 * @author Wiktor Niesiobędzki … … 47 48 } 48 49 50 /** 51 * @return if the entry is marked as "no tile at this zoom level" 52 */ 49 53 public boolean isNoTileAtZoom() { 50 54 return Boolean.toString(true).equals(attrs.get(NO_TILE_AT_ZOOM)); 51 55 } 56 57 /** 58 * Sets the marker for "no tile at this zoom level" 59 * @param noTileAtZoom true if this entry is "no tile at this zoom level" 60 */ 52 61 public void setNoTileAtZoom(boolean noTileAtZoom) { 53 62 attrs.put(NO_TILE_AT_ZOOM, Boolean.toString(noTileAtZoom)); 54 63 } 64 65 /** 66 * @return ETag header value, that was returned for this entry. 67 */ 55 68 public String getEtag() { 56 69 return attrs.get(ETAG); 57 70 } 71 72 /** 73 * Sets the ETag header that was set with this entry 74 * @param etag Etag header 75 */ 58 76 public void setEtag(String etag) { 59 77 if(etag != null) { … … 62 80 } 63 81 82 /** 83 * Utility for conversion from String to int, with default to 0, in case of any errors 84 * 85 * @param key - integer as string 86 * @return int value of the string 87 */ 64 88 private long getLongAttr(String key) { 65 89 String val = attrs.get(key); … … 76 100 } 77 101 102 /** 103 * @return last modification of the object in cache in milliseconds from Epoch 104 */ 78 105 public long getLastModification() { 79 106 return getLongAttr(LAST_MODIFICATION); 80 107 } 108 109 /** 110 * sets last modification of the object in cache 111 * 112 * @param lastModification time in format of milliseconds from Epoch 113 */ 81 114 public void setLastModification(long lastModification) { 82 115 attrs.put(LAST_MODIFICATION, Long.toString(lastModification)); 83 116 } 117 118 /** 119 * @return when the object expires in milliseconds from Epoch 120 */ 84 121 public long getExpirationTime() { 85 122 return getLongAttr(EXPIRATION_TIME); 86 123 } 124 125 /** 126 * sets expiration time for the object in cache 127 * 128 * @param expirationTime in format of milliseconds from epoch 129 */ 87 130 public void setExpirationTime(long expirationTime) { 88 131 attrs.put(EXPIRATION_TIME, Long.toString(expirationTime)); 89 132 } 90 133 134 /** 135 * Sets the HTTP response code that was sent with the cache entry 136 * 137 * @param responseCode http status code 138 * @since 8389 139 */ 91 140 public void setResponseCode(int responseCode) { 92 141 attrs.put(HTTP_RESPONSE_CODE, Integer.toString(responseCode)); 93 142 } 94 143 144 /** 145 * @return http status code 146 * @since 8389 147 */ 95 148 public int getResponseCode() { 96 149 return (int) getLongAttr(HTTP_RESPONSE_CODE); … … 102 155 * 103 156 * @param map metadata to save 157 * @since 8418 104 158 */ 105 159 public void setMetadata(Map<String, String> map) { … … 115 169 /** 116 170 * Returns an unmodifiable Map containing all metadata. Unmodifiable prevents access to metadata within attributes. 171 * 117 172 * @return unmodifiable Map with cache element metadata 173 * @since 8418 118 174 */ 119 175 public Map<String, String> getMetadata() { -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r8418 r8420 1022 1022 } 1023 1023 1024 /** 1025 * Sets the Map of <header name, header value> that if any of this header 1026 * will be returned, then this tile will be treated as "no tile at this zoom level" 1027 * 1028 * @param noTileHeaders 1029 * @since 8344 1030 */ 1024 1031 public void setNoTileHeaders(Map<String, String> noTileHeaders) { 1025 1032 this.noTileHeaders = noTileHeaders; … … 1031 1038 } 1032 1039 1040 /** 1041 * Returns the map <header name, metadata key> indicating, which HTTP headers should 1042 * be moved to metadata 1043 * 1044 * @param metadataHeaders 1045 * @since 8418 1046 */ 1033 1047 public void setMetadataHeaders(Map<String, String> metadataHeaders) { 1034 1048 this.metadataHeaders = metadataHeaders;
Note:
See TracChangeset
for help on using the changeset viewer.