Changeset 8420 in josm for trunk/src/org


Ignore:
Timestamp:
2015-05-23T08:55:03+02:00 (10 years ago)
Author:
wiktorn
Message:

Java docs for @8418, addresses #11456

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  
    1414
    1515/**
    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
    1718 *
    1819 * @author Wiktor Niesiobędzki
     
    4748    }
    4849
     50    /**
     51     * @return if the entry is marked as "no tile at this zoom level"
     52     */
    4953    public boolean isNoTileAtZoom() {
    5054        return Boolean.toString(true).equals(attrs.get(NO_TILE_AT_ZOOM));
    5155    }
     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     */
    5261    public void setNoTileAtZoom(boolean noTileAtZoom) {
    5362        attrs.put(NO_TILE_AT_ZOOM, Boolean.toString(noTileAtZoom));
    5463    }
     64
     65    /**
     66     * @return ETag header value, that was returned for this entry.
     67     */
    5568    public String getEtag() {
    5669        return attrs.get(ETAG);
    5770    }
     71
     72    /**
     73     * Sets the ETag header that was set with this entry
     74     * @param etag Etag header
     75     */
    5876    public void setEtag(String etag) {
    5977        if(etag != null) {
     
    6280    }
    6381
     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     */
    6488    private long getLongAttr(String key) {
    6589        String val = attrs.get(key);
     
    76100    }
    77101
     102    /**
     103     * @return last modification of the object in cache in milliseconds from Epoch
     104     */
    78105    public long getLastModification() {
    79106        return getLongAttr(LAST_MODIFICATION);
    80107    }
     108
     109    /**
     110     * sets last modification of the object in cache
     111     *
     112     * @param lastModification time in format of milliseconds from Epoch
     113     */
    81114    public void setLastModification(long lastModification) {
    82115        attrs.put(LAST_MODIFICATION, Long.toString(lastModification));
    83116    }
     117
     118    /**
     119     * @return when the object expires in milliseconds from Epoch
     120     */
    84121    public long getExpirationTime() {
    85122        return getLongAttr(EXPIRATION_TIME);
    86123    }
     124
     125    /**
     126     * sets expiration time for the object in cache
     127     *
     128     * @param expirationTime in format of milliseconds from epoch
     129     */
    87130    public void setExpirationTime(long expirationTime) {
    88131        attrs.put(EXPIRATION_TIME, Long.toString(expirationTime));
    89132    }
    90133
     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     */
    91140    public void setResponseCode(int responseCode) {
    92141        attrs.put(HTTP_RESPONSE_CODE, Integer.toString(responseCode));
    93142    }
    94143
     144    /**
     145     * @return http status code
     146     * @since 8389
     147     */
    95148    public int getResponseCode() {
    96149        return (int) getLongAttr(HTTP_RESPONSE_CODE);
     
    102155     *
    103156     * @param map metadata to save
     157     * @since 8418
    104158     */
    105159    public void setMetadata(Map<String, String> map) {
     
    115169    /**
    116170     * Returns an unmodifiable Map containing all metadata. Unmodifiable prevents access to metadata within attributes.
     171     *
    117172     * @return unmodifiable Map with cache element metadata
     173     * @since 8418
    118174     */
    119175    public Map<String, String> getMetadata() {
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java

    r8418 r8420  
    10221022    }
    10231023
     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     */
    10241031    public void setNoTileHeaders(Map<String, String> noTileHeaders) {
    10251032       this.noTileHeaders = noTileHeaders;
     
    10311038    }
    10321039
     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     */
    10331047    public void setMetadataHeaders(Map<String, String> metadataHeaders) {
    10341048        this.metadataHeaders = metadataHeaders;
Note: See TracChangeset for help on using the changeset viewer.