001    package railo.runtime.type.scope.storage;
002    
003    import railo.runtime.config.Config;
004    import railo.runtime.type.scope.SharedScope;
005    
006    
007    /**
008     * scope that can be stored, in a storage
009     */
010    public interface StorageScope extends SharedScope {
011            /*
012            public static Collection.Key CFID=Util.toKey("cfid");
013            public static Collection.Key CFTOKEN=Util.toKey("cftoken");
014            public static Collection.Key URLTOKEN=Util.toKey("urltoken");
015            public static Collection.Key LASTVISIT=Util.toKey("lastvisit");
016            public static Collection.Key HITCOUNT=Util.toKey("hitcount");
017            public static Collection.Key TIMECREATED=Util.toKey("timecreated");
018            public static Collection.Key SESSION_ID=Util.toKey("sessionid");
019            */
020            /**
021             * @return time when the Scope last time was visited
022             */
023            public abstract long lastVisit();
024            
025            public abstract String getStorageType();
026            
027            public long getLastAccess();
028            
029            public void touch();
030            
031            public boolean isExpired();
032            
033            public long getTimeSpan();
034    
035            /**
036             * store content on persistent layer
037             */
038            public void store(Config config);
039            
040            /**
041             * remove stored data from persistent layer
042             */
043            public void unstore(Config config);
044            
045    
046            /**
047             * sets the name of the storage used, this is not the storage type!
048             * @param storage
049             */
050            public void setStorage(String storage);
051            /**
052             * return the name of the storage used, this is not the storage type!
053             * @return
054             */
055            public String getStorage();
056            
057    
058            /**
059             * Specifies the time, in seconds, between client requests before the servlet container will invalidate this session. A negative time indicates the session should never timeout.
060             * @param interval - An integer specifying the number of seconds
061             */
062            public void setMaxInactiveInterval(int interval);
063            
064            /**
065             * Returns the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses. After this interval, the servlet container will invalidate the session. The maximum time interval can be set with the setMaxInactiveInterval method. A negative time indicates the session should never timeout.
066             * @return an integer specifying the number of seconds this session remains open between client requests
067             */
068            public int getMaxInactiveInterval();
069            
070    
071            
072            public long getCreated();
073            
074            public String generateToken(String key, boolean forceNew);
075            
076            public boolean verifyToken(String token, String key);
077    }