001    package railo.commons.io.cache;
002    
003    import java.util.Date;
004    
005    import railo.runtime.type.Struct;
006    
007    
008    /**
009     * interface for a entry inside the cache, this interface is read-only
010     */
011    public interface CacheEntry {
012            
013            /**
014             * when was the entry accessed last time.
015             * this information is optional and depends on the implementation,
016             * when information is not available -1 is returned
017             * @return time in milliseconds since 1/1/1970 GMT
018             */
019            public Date lastHit();
020            
021            /**
022             * when was the entry last time modified.
023             * this information is optional and depends on the implementation,
024             * when information is not available -1 is returned
025             * @return time offset in milliseconds since 1/1/1970 GMT
026             */
027            public Date lastModified();
028            
029            /**
030             * when was the entry created.
031             * this information is optional and depends on the implementation,
032             * when information is not available -1 is returned
033             * @return time offset in milliseconds since 1/1/1970 GMT
034             */
035            public Date created();
036            
037            /**
038             * how many time was the entry accessed?
039             * this information is optional and depends on the implementation,
040             * when information is not available -1 is returned
041             * @return access count
042             */
043            public int hitCount();
044            
045            
046            /**
047             * @return the key associated with this entry
048             */
049            public String getKey();
050            
051            /**
052             * @return the value associated with this entry
053             */
054            public Object getValue();
055            
056            /**
057             * the size of the object
058             * @return size of the object
059             */
060            public long size();
061            
062            /**
063             * define time until the entry is valid
064             * @return time offset in milliseconds since 1/1/1970 GMT or Long.MIN_VALUE if value is not defined
065             */
066            public long liveTimeSpan();
067            
068            /**
069             * time in milliseconds after which the object is flushed from the cache if it is not accessed during that time.
070             * @return time milliseconds  since 1/1/1970 GMT or Long.MIN_VALUE if value is not defined
071             */
072            public long idleTimeSpan();
073    
074            /**
075             * get all information data available for this entry
076             */
077            public Struct getCustomInfo();
078    }